Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployment/gpu-inference/baseten.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Baseten"
description: "Baseten is an AI infrastructure platform for deploying and serving ML models with optimized inference, autoscaling, and multi-cloud support."
description: "Deploy Liquid AI LFM models on Baseten with optimized inference, autoscaling, and multi-cloud support."

Check warning on line 3 in deployment/gpu-inference/baseten.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/baseten.mdx#L3

Did you really mean 'Baseten'?

Check warning on line 3 in deployment/gpu-inference/baseten.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/baseten.mdx#L3

Did you really mean 'autoscaling'?
---

<Tip>
Use Baseten for production ML model deployments with optimized inference, autoscaling, and multi-cloud support.

Check warning on line 7 in deployment/gpu-inference/baseten.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/baseten.mdx#L7

Did you really mean 'Baseten'?

Check warning on line 7 in deployment/gpu-inference/baseten.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/baseten.mdx#L7

Did you really mean 'autoscaling'?
</Tip>

## Clone the repository[​](#clone-the-repository "Direct link to Clone the repository")
Expand All @@ -15,7 +15,7 @@

## Deployment[​](#deployment "Direct link to Deployment")

The deployment script is based on Baseten's [documentation](https://docs.baseten.co/examples/vllm) of `Run any LLM with vLLM`.

Check warning on line 18 in deployment/gpu-inference/baseten.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/baseten.mdx#L18

Did you really mean 'Baseten's'?

Launch command:

Expand All @@ -42,5 +42,5 @@
```

<Note>
Baseten endpoints expect the `Api-Key` prefix in the `Authorization` header.

Check warning on line 45 in deployment/gpu-inference/baseten.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/baseten.mdx#L45

Did you really mean 'Baseten'?
</Note>
2 changes: 1 addition & 1 deletion deployment/gpu-inference/fal.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Fal"
description: "Fal is a serverless generative media platform offering lightning-fast inference for AI models for image, video, and audio generation."
description: "Deploy Liquid AI LFM models on Fal for serverless inference with fast autoscaling."

Check warning on line 3 in deployment/gpu-inference/fal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/fal.mdx#L3

Did you really mean 'Fal'?

Check warning on line 3 in deployment/gpu-inference/fal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/fal.mdx#L3

Did you really mean 'serverless'?

Check warning on line 3 in deployment/gpu-inference/fal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/fal.mdx#L3

Did you really mean 'autoscaling'?
---

<Tip>
Use Fal for serverless cloud deployments with lightning-fast inference, autoscaling, and easy API access.

Check warning on line 7 in deployment/gpu-inference/fal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/fal.mdx#L7

Did you really mean 'Fal'?

Check warning on line 7 in deployment/gpu-inference/fal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/fal.mdx#L7

Did you really mean 'serverless'?

Check warning on line 7 in deployment/gpu-inference/fal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/fal.mdx#L7

Did you really mean 'autoscaling'?
</Tip>

## Clone the repository
Expand Down Expand Up @@ -56,5 +56,5 @@
```

<Note>
Fal endpoints expect the `Key` prefix in the `Authorization` header.

Check warning on line 59 in deployment/gpu-inference/fal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/fal.mdx#L59

Did you really mean 'Fal'?
</Note>
2 changes: 1 addition & 1 deletion deployment/gpu-inference/modal.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Modal"
description: "Modal is a serverless cloud platform for running AI/ML workloads with instant autoscaling on GPUs and CPUs."
description: "Deploy Liquid AI LFM models on Modal with serverless GPU inference and instant autoscaling."

Check warning on line 3 in deployment/gpu-inference/modal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/modal.mdx#L3

Did you really mean 'serverless'?

Check warning on line 3 in deployment/gpu-inference/modal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/modal.mdx#L3

Did you really mean 'autoscaling'?
---

<Tip>
Use Modal for serverless cloud deployments with instant autoscaling, GPU access, and production-ready inference serving.

Check warning on line 7 in deployment/gpu-inference/modal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/modal.mdx#L7

Did you really mean 'serverless'?

Check warning on line 7 in deployment/gpu-inference/modal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/modal.mdx#L7

Did you really mean 'autoscaling'?
</Tip>

## Clone the repository
Expand All @@ -31,7 +31,7 @@

## Production deployment

* Since vLLM takes over 2 min to cold start, if you run the inference server for production, it is recommended to keep a minimum number of warm instances with `min_containers = 1` and `buffer_containers = 1`. The `buffer_containers` config is necessary because all Modal GPUs are subject to [preemption](https://modal.com/docs/guide/preemption). See [docs](https://modal.com/docs/guide/cold-start#overprovision-resources-with-min_containers-and-buffer_containers) for details about cold start performance tuning.

Check warning on line 34 in deployment/gpu-inference/modal.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/modal.mdx#L34

Did you really mean 'GPUs'?
* Warm up the vLLM server after deployment by sending a single request. The warm-up process is included in the [deploy-vllm.py](https://github.com/Liquid4All/lfm-inference/blob/main/modal/deploy-vllm.py) script already.

## Test commands
Expand Down
2 changes: 1 addition & 1 deletion deployment/gpu-inference/transformers.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Transformers"
description: "Transformers is a library for inference and training of pretrained models."
description: "Run Liquid AI LFM models with Hugging Face Transformers. Load, configure, and generate with LFM2.5 models in Python."
---

<Tip>
Expand All @@ -11,7 +11,7 @@

<div className="colab-link">
<a href="https://colab.research.google.com/github/Liquid4All/docs/blob/main/notebooks/LFM2_Inference_with_Transformers.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" />

Check warning on line 14 in deployment/gpu-inference/transformers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/transformers.mdx#L14

Did you really mean 'Colab'?
</a>
</div>

Expand Down Expand Up @@ -70,10 +70,10 @@

* **`model_id`**: Can be a Hugging Face model ID (e.g., `"LiquidAI/LFM2.5-1.2B-Instruct"`) or a local path
* **`device_map="auto"`**: Automatically distributes across available GPUs/CPU (requires `accelerate`). Use `device="cuda"` for single GPU or `device="cpu"` for CPU only
* **`dtype="bfloat16"`**: Recommended for modern GPUs. Use `"auto"` for automatic selection, or `"float32"` (slower, more memory)

Check warning on line 73 in deployment/gpu-inference/transformers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/transformers.mdx#L73

Did you really mean 'GPUs'?

<Accordion title="Click to see a pipeline() example">
The [`pipeline()`](https://huggingface.co/docs/transformers/en/main_classes/pipelines) interface provides a simpler API for text generation with automatic chat template handling. It wraps model loading and tokenization, making it ideal for quick prototyping.

Check warning on line 76 in deployment/gpu-inference/transformers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/transformers.mdx#L76

Did you really mean 'tokenization'?

```python
from transformers import pipeline
Expand All @@ -98,10 +98,10 @@

* **`"text-generation"`**: Task type for the pipeline
* **`model_name_or_path`**: Model ID (e.g., `"LiquidAI/LFM2.5-1.2B-Instruct"`) or local path (download locally with `hf download --local-dir ./LFM2.5-1.2B-Instruct LiquidAI/LFM2.5-1.2B-Instruct`)
* **`dtype="auto"`**: Automatically selects optimal dtype (`bfloat16` on modern devices). Can use `"bfloat16"` explicitly or `"float32"` (slower, more memory)

Check warning on line 101 in deployment/gpu-inference/transformers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/transformers.mdx#L101

Did you really mean 'dtype'?
* **`device_map="auto"`**: Automatically distributes across available GPUs/CPU (requires `accelerate`). Alternative: `device="cuda"` for single GPU, `device="cpu"` for CPU only. Don't mix `device_map` and `device`

The pipeline automatically handles chat templates and tokenization, returning structured output with the generated text.

Check warning on line 104 in deployment/gpu-inference/transformers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/transformers.mdx#L104

Did you really mean 'tokenization'?
</Accordion>

### Generation Parameters
Expand All @@ -110,7 +110,7 @@

* **`do_sample`** (`bool`): Enable sampling (`True`) or greedy decoding (`False`, default)
* **`temperature`** (`float`, default 1.0): Controls randomness (0.0 = deterministic, higher = more random). Typical range: 0.1-2.0
* **`top_p`** (`float`, default 1.0): Nucleus sampling - limits to tokens with cumulative probability ≤ top\_p. Typical range: 0.1-1.0

Check warning on line 113 in deployment/gpu-inference/transformers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/gpu-inference/transformers.mdx#L113

Did you really mean 'top_p'?
* **`top_k`** (`int`, default 50): Limits to top-k most probable tokens. Typical range: 1-100
* **`min_p`** (`float`): Minimum token probability threshold. Typical range: 0.01-0.2
* **`max_new_tokens`** (`int`): Maximum number of tokens to generate (preferred over `max_length`)
Expand Down
2 changes: 1 addition & 1 deletion deployment/on-device/atomic-chat.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Atomic Chat"
description: "Atomic Chat is a desktop and mobile app for running LLMs locally with a graphical user interface."
description: "Run Liquid AI LFM models locally with Atomic Chat, a desktop and mobile app with a graphical interface."
---

<Tip>
Expand Down Expand Up @@ -42,7 +42,7 @@
Control text generation behavior using the GUI sidebar or API parameters. Key parameters:

* **`temperature`** (`float`, default 1.0): Controls randomness (0.0 = deterministic, higher = more random). Typical range: 0.1-2.0
* **`top_p`** (`float`, default 1.0): Nucleus sampling - limits to tokens with cumulative probability ≤ top\_p. Typical range: 0.1-1.0

Check warning on line 45 in deployment/on-device/atomic-chat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/atomic-chat.mdx#L45

Did you really mean 'top_p'?
* **`top_k`** (`int`, default 40): Limits to top-k most probable tokens. Typical range: 1-100
* **`repeat_penalty`** (`float`, default 1.0): Penalty for repeating tokens (>1.0 = discourage repetition). Typical range: 1.0-1.5

Expand All @@ -54,7 +54,7 @@
messages=[{"role": "user", "content": "What is machine learning?"}],
temperature=0.1,
max_tokens=512,
extra_body={"top_k": 50, "repeat_penalty": 1.05},

Check warning on line 57 in deployment/on-device/atomic-chat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/atomic-chat.mdx#L57

Did you really mean 'top_k'?

Check warning on line 57 in deployment/on-device/atomic-chat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/atomic-chat.mdx#L57

Did you really mean 'repeat_penalty'?
)
```

Expand Down Expand Up @@ -134,7 +134,7 @@

<Accordion title="Using the API">
```python
from openai import OpenAI

Check warning on line 137 in deployment/on-device/atomic-chat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/atomic-chat.mdx#L137

Did you really mean 'openai'?
import base64

client = OpenAI(
Expand All @@ -143,8 +143,8 @@
)

# Encode image to base64
with open("image.jpg", "rb") as image_file:

Check warning on line 146 in deployment/on-device/atomic-chat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/atomic-chat.mdx#L146

Did you really mean 'rb'?

Check warning on line 146 in deployment/on-device/atomic-chat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/atomic-chat.mdx#L146

Did you really mean 'image_file'?
image_data = base64.b64encode(image_file.read()).decode("utf-8")

Check warning on line 147 in deployment/on-device/atomic-chat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/atomic-chat.mdx#L147

Did you really mean 'image_data'?

response = client.chat.completions.create(
model="<model-id-from-v1-models>",
Expand Down
2 changes: 1 addition & 1 deletion deployment/on-device/llama-cpp.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "llama.cpp"
description: "llama.cpp is a C++ library for efficient LLM inference with minimal dependencies. It's designed for CPU-first inference with cross-platform support."
description: "Run Liquid AI LFM models locally with llama.cpp. Setup, GGUF downloads, and generation parameters for on-device inference."
---

<Tip>
Expand All @@ -8,14 +8,14 @@
</Tip>

<Note>
Building an application with llama.cpp? Jump to [Build with llama.cpp](#building-applications) for mobile, desktop, chat, tool-calling, structured-output, and multimodal guides.

Check warning on line 11 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L11

Did you really mean 'multimodal'?
</Note>

For GPU-accelerated inference at scale, consider using [vLLM](/deployment/gpu-inference/vllm) instead.

<div className="colab-link">
<a href="https://colab.research.google.com/github/Liquid4All/docs/blob/main/notebooks/LFM2_Inference_with_llama_cpp.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" />

Check warning on line 18 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L18

Did you really mean 'Colab'?
</a>
</div>

Expand Down Expand Up @@ -92,8 +92,8 @@
```bash
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build

Check warning on line 95 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L95

Did you really mean 'cmake'?
cmake --build build --config Release -j 8

Check warning on line 96 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L96

Did you really mean 'cmake'?
```

The compiled programs will be in `./build/bin/`.
Expand Down Expand Up @@ -215,7 +215,7 @@
Control text generation behavior using parameters in the OpenAI-compatible API or command-line flags. Key parameters:

* **`temperature`** (`float`): Controls randomness (0.0 = deterministic, higher = more random). Typical range: 0.1-2.0
* **`top_p`** (`float`): Nucleus sampling - limits to tokens with cumulative probability ≤ top\_p. Typical range: 0.1-1.0

Check warning on line 218 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L218

Did you really mean 'top_p'?
* **`top_k`** (`int`): Limits to top-k most probable tokens. Typical range: 1-100
* **`min_p`** (`float`): Filters tokens below `min_p * max_probability`. Typical range: 0.05-0.3
* **`max_tokens`** / **`--n-predict`** (`int`): Maximum number of tokens to generate
Expand Down Expand Up @@ -247,7 +247,7 @@

## Vision Models

LFM2-VL GGUF models can be used for multimodal inference with llama.cpp.

Check warning on line 250 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L250

Did you really mean 'multimodal'?

### Quick Start with llama-cli

Expand Down Expand Up @@ -307,7 +307,7 @@
</Accordion>

<Accordion title="Using llama-server">
Start a vision model server with both the model and mmproj files:

Check warning on line 310 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L310

Did you really mean 'mmproj'?

```bash
llama-server \
Expand Down Expand Up @@ -353,12 +353,12 @@
</Accordion>

<Info>
For a complete working example with step-by-step instructions, see the [llama.cpp Vision Model Colab notebook](https://colab.research.google.com/drive/1q2PjE6O_AahakRlkTNJGYL32MsdUcj7b?usp=sharing).

Check warning on line 356 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L356

Did you really mean 'Colab'?
</Info>

## Converting Custom Models

If you have a finetuned model or need to create a GGUF from a Hugging Face model:

Check warning on line 361 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L361

Did you really mean 'finetuned'?

```bash
# Clone llama.cpp if you haven't already
Expand All @@ -377,7 +377,7 @@

<CardGroup cols={2}>
<Card title="iOS & Android" icon="mobile" href="/deployment/on-device/llama-cpp/mobile">
Link the XCFramework or NDK build and run LFM GGUFs in-process.

Check warning on line 380 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L380

Did you really mean 'XCFramework'?

Check warning on line 380 in deployment/on-device/llama-cpp.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/llama-cpp.mdx#L380

Did you really mean 'GGUFs'?
</Card>
<Card title="Desktop & Server Apps" icon="desktop" href="/deployment/on-device/llama-cpp/desktop">
llama-server as a sidecar, or Python / Node.js / .NET bindings.
Expand Down
2 changes: 1 addition & 1 deletion deployment/on-device/lm-studio.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "LM Studio"
description: "LM Studio is a desktop application for running LLMs locally with a graphical interface."
description: "Run Liquid AI LFM models in LM Studio. Download GGUF models and start generating with a graphical interface."
---

<Tip>
Expand Down Expand Up @@ -32,7 +32,7 @@
Control text generation behavior using the GUI sidebar or API parameters. Key parameters:

* **`temperature`** (`float`, default 1.0): Controls randomness (0.0 = deterministic, higher = more random). Typical range: 0.1-2.0
* **`top_p`** (`float`, default 1.0): Nucleus sampling - limits to tokens with cumulative probability ≤ top\_p. Typical range: 0.1-1.0

Check warning on line 35 in deployment/on-device/lm-studio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/lm-studio.mdx#L35

Did you really mean 'top_p'?
* **`top_k`** (`int`, default 40): Limits to top-k most probable tokens. Typical range: 1-100
* **`max_tokens`** (`int`): Maximum number of tokens to generate
* **`repeat_penalty`** (`float`, default 1.0): Penalty for repeating tokens (>1.0 = discourage repetition). Typical range: 1.0-1.5
Expand All @@ -46,7 +46,7 @@
messages=[{"role": "user", "content": "What is machine learning?"}],
temperature=0.1,
max_tokens=512,
extra_body={"top_k": 50, "repeat_penalty": 1.05},

Check warning on line 49 in deployment/on-device/lm-studio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/lm-studio.mdx#L49

Did you really mean 'top_k'?

Check warning on line 49 in deployment/on-device/lm-studio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/lm-studio.mdx#L49

Did you really mean 'repeat_penalty'?
)
```

Expand Down Expand Up @@ -120,7 +120,7 @@

<Accordion title="Using the API">
```python
from openai import OpenAI

Check warning on line 123 in deployment/on-device/lm-studio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/lm-studio.mdx#L123

Did you really mean 'openai'?
import base64

client = OpenAI(
Expand All @@ -129,8 +129,8 @@
)

# Encode image to base64
with open("image.jpg", "rb") as image_file:

Check warning on line 132 in deployment/on-device/lm-studio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/lm-studio.mdx#L132

Did you really mean 'rb'?

Check warning on line 132 in deployment/on-device/lm-studio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/lm-studio.mdx#L132

Did you really mean 'image_file'?
image_data = base64.b64encode(image_file.read()).decode("utf-8")

Check warning on line 133 in deployment/on-device/lm-studio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/lm-studio.mdx#L133

Did you really mean 'image_data'?

response = client.chat.completions.create(
model="local-model",
Expand Down
2 changes: 1 addition & 1 deletion deployment/on-device/mlx.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: "MLX"
description: "MLX is Apple's machine learning framework optimized for Apple Silicon. It provides efficient inference on Mac devices with M-series chips (M1, M2, M3, M4) using Metal acceleration for GPU computing."
description: "Run Liquid AI LFM models on Apple Silicon with MLX. Setup, model downloads, and Metal-accelerated inference on M-series chips."
---

<Tip>
Use MLX for running models on Apple Silicon Macs with Metal GPU acceleration.
</Tip>

MLX leverages unified memory architecture on Apple Silicon, allowing seamless data sharing between CPU and GPU. The `mlx-lm` package provides a simple interface for loading and serving LLMs.

Check warning on line 10 in deployment/on-device/mlx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/mlx.mdx#L10

Did you really mean 'LLMs'?

## Installation

Expand Down Expand Up @@ -47,7 +47,7 @@
Control text generation behavior using parameters in the `generate()` function. Key parameters:

* **`temperature`** (`float`, default 1.0): Controls randomness (0.0 = deterministic, higher = more random). Typical range: 0.1-2.0
* **`top_p`** (`float`, default 1.0): Nucleus sampling - limits to tokens with cumulative probability ≤ top\_p. Typical range: 0.1-1.0

Check warning on line 50 in deployment/on-device/mlx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/mlx.mdx#L50

Did you really mean 'top_p'?
* **`top_k`** (`int`, default 50): Limits to top-k most probable tokens. Typical range: 1-100
* **`max_tokens`** (`int`): Maximum number of tokens to generate
* **`repetition_penalty`** (`float`, default 1.0): Penalty for repeating tokens (>1.0 = discourage repetition). Typical range: 1.0-1.5
Expand Down Expand Up @@ -111,7 +111,7 @@
],
temperature=0.3,
max_tokens=512,
extra_body={"min_p": 0.15, "repetition_penalty": 1.05},

Check warning on line 114 in deployment/on-device/mlx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/mlx.mdx#L114

Did you really mean 'min_p'?

Check warning on line 114 in deployment/on-device/mlx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/mlx.mdx#L114

Did you really mean 'repetition_penalty'?
)
print(response.choices[0].message.content)
```
Expand All @@ -134,11 +134,11 @@

## Vision Models

LFM2-VL models support both text and image inputs for multimodal inference. Use `mlx_vlm` to load and generate with vision models:

Check warning on line 137 in deployment/on-device/mlx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/mlx.mdx#L137

Did you really mean 'multimodal'?

<Accordion title="Single Image Example">
```python
from mlx_vlm import load, generate

Check warning on line 141 in deployment/on-device/mlx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/mlx.mdx#L141

Did you really mean 'mlx_vlm'?
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_image_processor
from PIL import Image
Expand Down
2 changes: 1 addition & 1 deletion deployment/on-device/ollama.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
title: "Ollama"
description: "Ollama is a command-line tool for running LLMs locally with a simple interface. It provides easy model management and serving with an OpenAI-compatible API."
description: "Deploy Liquid AI LFM models with Ollama. Pull, configure, and serve LFM2.5 models locally with an OpenAI-compatible API."

Check warning on line 3 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L3

Did you really mean 'Ollama'?
---

<Tip>
Use Ollama for quick local model serving with a simple CLI or Docker-based deployment.

Check warning on line 7 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L7

Did you really mean 'Ollama'?
</Tip>

Ollama uses GGUF models and supports GPU acceleration (CUDA, Metal, ROCm).

Check warning on line 10 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L10

Did you really mean 'Ollama'?

Check warning on line 10 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L10

Did you really mean 'ROCm'?

<Warning>
The official Ollama v0.17.0 (latest stable) from [ollama.com](https://ollama.com) fails with a `missing tensor 'output_norm.weight'` error on the `lfm2moe` architecture. This affects all LFM MoE models (e.g. LFM2-24B-A2B, LFM2-8A-A1B). To run any LFM MoE model you specifically need [v0.17.1-rc0](https://github.com/ollama/ollama/releases/tag/v0.17.1-rc0) or later.

Check warning on line 13 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L13

Did you really mean 'Ollama'?
</Warning>

<div className="colab-link">
<a href="https://colab.research.google.com/github/Liquid4All/docs/blob/main/notebooks/LFM2_Inference_with_Ollama.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" />

Check warning on line 18 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L18

Did you really mean 'Colab'?
</a>
</div>

Expand Down Expand Up @@ -52,15 +52,15 @@
docker exec -it ollama ollama run hf.co/LiquidAI/LFM2.5-1.2B-Instruct-GGUF
```

See the [Ollama Docker documentation](https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image) for more details.

Check warning on line 55 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L55

Did you really mean 'Ollama'?
</Tab>
</Tabs>

## Using LFM2 Models

Ollama can load GGUF models directly from Hugging Face or from local files.

Check warning on line 61 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L61

Did you really mean 'Ollama'?

### Running GGUFs

Check warning on line 63 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L63

Did you really mean 'GGUFs'?

You can run LFM2 models directly from Hugging Face:

Expand Down Expand Up @@ -107,7 +107,7 @@
PARAMETER stop "<|endoftext|>"
```

Import the model with the Modelfile:

Check warning on line 110 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L110

Did you really mean 'Modelfile'?

```bash
ollama create my-model -f Modelfile
Expand Down Expand Up @@ -138,11 +138,11 @@
ollama run hf.co/LiquidAI/LFM2.5-1.2B-Instruct-GGUF "What is machine learning?"
```

If you imported a model with a custom name using a Modelfile, use that name instead (e.g., `ollama run my-model`).

Check warning on line 141 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L141

Did you really mean 'Modelfile'?

## Serving Models

Ollama automatically starts a server on `http://localhost:11434` with an OpenAI-compatible API for programmatic access.

Check warning on line 145 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L145

Did you really mean 'Ollama'?

### Python Client

Expand All @@ -166,7 +166,7 @@
```

<Accordion title="Curl request examples">
Ollama provides two native API endpoints:

Check warning on line 169 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L169

Did you really mean 'Ollama'?

**Generate API** (simple completion):

Expand All @@ -191,7 +191,7 @@

## Vision Models

LFM2-VL GGUF models can also be used for multimodal inference with Ollama.

Check warning on line 194 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L194

Did you really mean 'multimodal'?

Check warning on line 194 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L194

Did you really mean 'Ollama'?

<Accordion title="Interactive Chat with Images">
Run a vision model directly and provide images in the chat:
Expand All @@ -215,7 +215,7 @@

<Accordion title="Using the API">
```python
from openai import OpenAI

Check warning on line 218 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L218

Did you really mean 'openai'?
import base64

client = OpenAI(
Expand All @@ -224,8 +224,8 @@
)

# Encode image to base64
with open("image.jpg", "rb") as image_file:

Check warning on line 227 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L227

Did you really mean 'rb'?

Check warning on line 227 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L227

Did you really mean 'image_file'?
image_data = base64.b64encode(image_file.read()).decode("utf-8")

Check warning on line 228 in deployment/on-device/ollama.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/ollama.mdx#L228

Did you really mean 'image_data'?

response = client.chat.completions.create(
model="hf.co/LiquidAI/LFM2.5-VL-1.6B-GGUF",
Expand Down
2 changes: 1 addition & 1 deletion deployment/on-device/onnx.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: "ONNX"
description: "ONNX provides a platform-agnostic inference specification that allows running the model on device-specific runtimes that include CPU, GPU, NPU, and WebGPU."
description: "Run Liquid AI LFM models with ONNX Runtime on CPU, GPU, NPU, and WebGPU for cross-platform on-device inference."
---

<Tip>
Use ONNX for cross-platform deployment, edge devices, and browser-based inference with WebGPU and Transformers.js.
</Tip>

ONNX (Open Neural Network Exchange) is a portable format that enables LFM inference across diverse hardware and runtimes. ONNX models run on CPUs, GPUs, NPUs, and in browsers via WebGPU—making them ideal for edge deployment and web applications.

Check warning on line 10 in deployment/on-device/onnx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/onnx.mdx#L10

Did you really mean 'runtimes'?

Check warning on line 10 in deployment/on-device/onnx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/onnx.mdx#L10

Did you really mean 'CPUs'?

Check warning on line 10 in deployment/on-device/onnx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/onnx.mdx#L10

Did you really mean 'GPUs'?

Check warning on line 10 in deployment/on-device/onnx.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

deployment/on-device/onnx.mdx#L10

Did you really mean 'NPUs'?

## LiquidONNX

Expand Down
1 change: 1 addition & 0 deletions deployment/tools/model-bundling/changelog.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Changelog"
description: "Release history for leap-bundle, the Liquid AI model bundling CLI tool."
---

## `v0.9.0` - 2026-01-02
Expand Down
4 changes: 4 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"vscode"
]
},
"metadata": {
"og:site_name": "Liquid AI Docs",
"twitter:card": "summary"
},
"favicon": "/favicon.svg",
"logo": {
"light": "/logo/light.svg",
Expand Down
1 change: 1 addition & 0 deletions examples/android/leap-koog-agent.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Build AI Agents with Koog Framework on Android"

Check warning on line 2 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L2

Did you really mean 'Koog'?
description: "Build on-device AI agents on Android using the Koog framework with Liquid AI LFM models, supporting tool calling and MCP."

Check warning on line 3 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L3

Did you really mean 'Koog'?
---

<Note>
Expand All @@ -10,7 +11,7 @@
Browse the complete example on GitHub
</Card>

This example demonstrates how to integrate the **Koog framework** with LeapSDK on Android to build intelligent AI agents. Koog is an open-source framework for creating AI agents that can understand natural language, invoke tools, manage context, and integrate with MCP (Model Context Protocol) servers.

Check warning on line 14 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L14

Did you really mean 'Koog'?

LeapKoogAgent shows how to bring autonomous agent capabilities to mobile devices, enabling apps that can reason, plan, and execute complex tasks on behalf of users—all running locally on Android.

Expand All @@ -18,7 +19,7 @@

LeapKoogAgent showcases advanced AI agent capabilities:

- **Koog Framework Integration** - Build structured AI agents with reasoning capabilities

Check warning on line 22 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L22

Did you really mean 'Koog'?
- **Natural Language Understanding** - Process user intents and commands
- **Tool Invocation** - Enable agents to call functions and use external tools
- **Context Management** - Maintain conversation state and agent memory
Expand All @@ -29,9 +30,9 @@

This example demonstrates building production-ready AI agents that run entirely on Android devices.

## What is the Koog Framework?

Check warning on line 33 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L33

Did you really mean 'Koog'?

**Koog** is an open-source framework for building AI agents. It provides a structured approach to creating agents that can:

Check warning on line 35 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L35

Did you really mean 'Koog'?

- **Reason and plan** - Break down complex tasks into steps
- **Use tools** - Invoke functions to accomplish specific tasks (calculations, API calls, database queries)
Expand All @@ -57,7 +58,7 @@
- Smart home controllers that understand natural language commands

<Card title="Learn More About Koog" icon="book" href="https://docs.koog.ai">
Explore the Koog framework documentation and examples

Check warning on line 61 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L61

Did you really mean 'Koog'?
</Card>

## Environment setup
Expand Down Expand Up @@ -101,7 +102,7 @@
adb shell ls -lh /data/local/tmp/liquid/
```

**Note:** Apps cannot read `/tmp/` on Android — use `/data/local/tmp/<your-namespace>/` for ADB-pushed assets (matches the other Android examples). If you deploy to a different location, update the `modelPath` in your app code accordingly. The example snippets below use `loadSimpleModel(model: ModelSource(...))` to load the sideloaded file; switch to `loadModel(modelName:, quantizationType:)` if you'd rather have the SDK download the model automatically.

Check warning on line 105 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L105

Did you really mean 'sideloaded'?
</Accordion>

<Accordion title="Dependencies Setup">
Expand Down Expand Up @@ -153,7 +154,7 @@
- Navigate to the `LeapKoogAgent` folder

4. **Build the project**
- Wait for Gradle sync to complete

Check warning on line 157 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L157

Did you really mean 'Gradle'?
- Resolve any dependency issues

5. **Run on device or emulator**
Expand All @@ -173,9 +174,9 @@

## Understanding the architecture

### Koog Agent Initialization

Check warning on line 177 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L177

Did you really mean 'Koog'?

Load the LEAP model first, then bridge it to a Koog agent. The Koog APIs below are illustrative — see the linked GitHub example for the canonical adapter wiring, since `ai.koog:koog-agents` evolves independently from LeapSDK.

Check warning on line 179 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L179

Did you really mean 'Koog'?

```kotlin
import ai.liquid.leap.ModelRunner
Expand Down Expand Up @@ -406,7 +407,7 @@

### Resource Cleanup

**Important:** Always clean up agent resources properly to prevent memory leaks and ANRs:

Check warning on line 410 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L410

Did you really mean 'ANRs'?

```kotlin
class AgentViewModel(application: Application) : AndroidViewModel(application) {
Expand Down Expand Up @@ -437,7 +438,7 @@
```

**Why this matters:**
- **Avoid `runBlocking`** in `onCleared()` - it blocks the main thread and can cause ANRs (Application Not Responding)

Check warning on line 441 in examples/android/leap-koog-agent.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/leap-koog-agent.mdx#L441

Did you really mean 'ANRs'?
- **Use `CoroutineScope(Dispatchers.IO).launch`** instead - model unloading happens asynchronously
- **Always clean up agent resources** - prevents memory leaks and ensures proper shutdown
- **Catch exceptions** - cleanup should never crash the app
Expand Down
1 change: 1 addition & 0 deletions examples/android/recipe-generator-constrained-output.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Generate Structured Recipes with Constrained Output"
description: "Android app demonstrating constrained JSON generation to produce structured recipe output using a Liquid AI LFM model on-device."
---

<Note>
Expand All @@ -10,7 +11,7 @@
Browse the complete example on GitHub
</Card>

This example demonstrates **constrained generation** with LeapSDK on Android. Instead of generating free-form text, the RecipeGenerator app produces structured JSON output that follows a predefined schema, ensuring consistent and parseable results.

Check warning on line 14 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L14

Did you really mean 'parseable'?

Constrained generation is essential for building reliable AI-powered applications where the output needs to integrate with downstream systems or databases. This example shows how to enforce structure while maintaining creative and useful AI-generated content.

Expand All @@ -20,7 +21,7 @@

- **Structured Output Generation** - Enforce JSON schema constraints on model outputs
- **Automatic Model Downloading** - Models download automatically via `LeapDownloader` on first run
- **Constrained Decoding** - Guide the model to produce valid, parseable data structures

Check warning on line 24 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L24

Did you really mean 'parseable'?
- **Schema Validation** - Ensure generated recipes follow a specific format
- **Type Safety** - Parse AI outputs directly into Kotlin data classes with kotlinx.serialization
- **@Generatable Annotation** - Use LeapSDK's annotation for simplified structured output generation
Expand All @@ -34,10 +35,10 @@
**Constrained generation** refers to the ability to enforce specific formatting or structural requirements on model outputs. Instead of generating free-form text, the model produces outputs that conform to a predefined schema or pattern.

**Benefits:**
- **Reliability** - Guaranteed parseable output every time

Check warning on line 38 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L38

Did you really mean 'parseable'?
- **Type Safety** - Direct integration with typed programming languages
- **Validation** - Automatic schema compliance
- **Downstream Integration** - Feed structured data into databases, APIs, or UIs

Check warning on line 41 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L41

Did you really mean 'UIs'?
- **Error Reduction** - Eliminate parsing errors from inconsistent formats

**Common use cases:**
Expand Down Expand Up @@ -150,8 +151,8 @@
- Select "Open an existing project"
- Navigate to the `RecipeGenerator` folder and open it

3. **Gradle sync**

Check warning on line 154 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L154

Did you really mean 'Gradle'?
- Wait for Gradle to sync all dependencies

Check warning on line 155 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L155

Did you really mean 'Gradle'?
- Ensure LeapSDK 0.10.7 is downloaded

4. **Run the app**
Expand All @@ -167,7 +168,7 @@
- The model is cached for future use

6. **Generate recipes**
- Enter ingredients or a dish name (e.g., "pasta carbonara", "chocolate chip cookies")

Check warning on line 171 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L171

Did you really mean 'carbonara'?
- Tap "Generate Recipe"
- The app will produce a structured recipe with ingredients, steps, and metadata
- All output will be valid JSON conforming to the recipe schema
Expand All @@ -176,7 +177,7 @@
**After First Run**: The model is cached locally. Subsequent app launches work offline and start immediately without downloading.
</Note>

## Code walkthrough

Check warning on line 180 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L180

Did you really mean 'walkthrough'?

The core business logic is implemented in `MainActivityViewModel.kt`. Here's how it works:

Expand Down Expand Up @@ -348,7 +349,7 @@
```

**Best practices:**
- Never use `runBlocking` in `onCleared()` - it causes ANRs (Application Not Responding)

Check warning on line 352 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L352

Did you really mean 'ANRs'?
- Use `CoroutineScope(Dispatchers.IO).launch` for async cleanup
- Always catch exceptions to prevent crashes during cleanup
- This ensures smooth app shutdown without blocking the UI
Expand Down Expand Up @@ -422,7 +423,7 @@
"In a separate bowl, whisk together flour, baking soda, and salt",
"Gradually blend dry ingredients into butter mixture",
"Stir in chocolate chips",
"Drop rounded tablespoons of dough onto ungreased cookie sheets",

Check warning on line 426 in examples/android/recipe-generator-constrained-output.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/recipe-generator-constrained-output.mdx#L426

Did you really mean 'ungreased'?
"Bake for 9-11 minutes or until golden brown",
"Cool on baking sheet for 2 minutes before transferring to a wire rack"
],
Expand Down
1 change: 1 addition & 0 deletions examples/android/slogan-generator.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Product Slogan Generator with LeapSDK"
description: "Simple Android app for on-device text generation using a Liquid AI LFM model to create product slogans."
---

<Note>
Expand All @@ -12,7 +13,7 @@

This example demonstrates how to use LeapSDK for **single-turn generation** tasks on Android. The SloganApp generates creative product slogans on-device using local language models, showcasing how to integrate AI capabilities for specific product needs without requiring cloud connectivity.

Built with traditional **Android Views**, this example provides a different UI approach compared to Jetpack Compose, making it ideal for teams working with legacy Android codebases.

Check warning on line 16 in examples/android/slogan-generator.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/slogan-generator.mdx#L16

Did you really mean 'Jetpack'?

## What's inside?

Expand All @@ -24,7 +25,7 @@
- **Simple Integration** - Minimal setup for focused AI tasks
- **Product-focused Prompting** - Optimized prompts for marketing and slogan generation

This example is perfect for understanding how to integrate LeapSDK into existing Android applications that use the traditional View system rather than Jetpack Compose.

Check warning on line 28 in examples/android/slogan-generator.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/slogan-generator.mdx#L28

Did you really mean 'Jetpack'?

## Environment setup

Expand Down Expand Up @@ -77,8 +78,8 @@
- Select "Open an existing project"
- Navigate to the `SloganApp` folder and open it

3. **Gradle sync**

Check warning on line 81 in examples/android/slogan-generator.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/slogan-generator.mdx#L81

Did you really mean 'Gradle'?
- Wait for Gradle to sync all dependencies

Check warning on line 82 in examples/android/slogan-generator.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/slogan-generator.mdx#L82

Did you really mean 'Gradle'?
- Resolve any dependency conflicts if prompted

4. **Run the app**
Expand Down Expand Up @@ -126,7 +127,7 @@

### Traditional Android Views Approach

Unlike examples that use Jetpack Compose, SloganApp demonstrates integration with the traditional Android View system:

Check warning on line 130 in examples/android/slogan-generator.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/slogan-generator.mdx#L130

Did you really mean 'Jetpack'?

**XML Layout Structure:**
```xml
Expand Down
1 change: 1 addition & 0 deletions examples/android/vision-language-model-example.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Image Understanding with Vision Language Models"
description: "Android app for on-device image understanding and visual Q&A using LFM2.5-VL-1.6B with Jetpack Compose."

Check warning on line 3 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L3

Did you really mean 'Jetpack'?
---

<Note>
Expand All @@ -10,18 +11,18 @@
Browse the complete example on GitHub
</Card>

This example demonstrates how to use **Vision Language Models (VLMs)** with LeapSDK on Android. VLMs combine image understanding with natural language processing, enabling your app to analyze images, answer questions about visual content, and generate detailed descriptions—all on-device.

Check warning on line 14 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L14

Did you really mean 'VLMs'?

Check warning on line 14 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L14

Did you really mean 'VLMs'?

Built with **Jetpack Compose** and the **Coil** image loading library, this example shows how to create a multimodal AI application that processes both images and text locally on Android devices.

Check warning on line 16 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L16

Did you really mean 'Jetpack'?

Check warning on line 16 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L16

Did you really mean 'multimodal'?

## What's inside?

The VLMExample showcases cutting-edge multimodal AI capabilities:

Check warning on line 20 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L20

Did you really mean 'VLMExample'?

Check warning on line 20 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L20

Did you really mean 'multimodal'?

- **Vision Language Models** - Analyze images and generate text descriptions
- **Image Input Processing** - Handle image selection from gallery or camera
- **Multimodal Understanding** - Combine visual and textual information

Check warning on line 24 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L24

Did you really mean 'Multimodal'?
- **Jetpack Compose UI** - Modern, declarative UI for image display and results

Check warning on line 25 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L25

Did you really mean 'Jetpack'?
- **Coil Integration** - Efficient image loading and rendering
- **On-device Inference** - Complete privacy with local VLM processing
- **Interactive Q&A** - Ask questions about images and get contextual answers
Expand All @@ -30,7 +31,7 @@

## What are Vision Language Models?

**Vision Language Models (VLMs)** are AI models that can process both images and text simultaneously, enabling them to:

Check warning on line 34 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L34

Did you really mean 'VLMs'?

- **Describe images** - Generate detailed captions of what's in a photo
- **Answer visual questions** - Respond to queries about image content ("What color is the car?")
Expand Down Expand Up @@ -79,7 +80,7 @@

The example uses **LFM2.5-VL-1.6B** from the [LEAP Model Library](https://leap.liquid.ai/models). The code below loads it via `LeapModelDownloader.loadModel(...)`, which fetches the GGUF + matching `mmproj` companion file from the registry on first launch and caches them on device. No manual ADB step is needed.

**Manual deployment (alternative).** If you'd rather sideload the files, push the GGUF and its `mmproj` companion via ADB and use `loadSimpleModel(model: ModelSource(...))` instead of `loadModel(...)`:

Check warning on line 83 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L83

Did you really mean 'sideload'?

```bash
adb shell mkdir -p /data/local/tmp/liquid/
Expand Down Expand Up @@ -121,14 +122,14 @@

[Coil](https://coil-kt.github.io/coil/) is a Kotlin-first image loading library for Android that:
- Efficiently loads and caches images
- Integrates seamlessly with Jetpack Compose

Check warning on line 125 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L125

Did you really mean 'Jetpack'?
- Handles image transformations and processing
- Provides modern coroutine-based APIs
</Accordion>

## How to run it

Follow these steps to start analyzing images with VLMs:

Check warning on line 132 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L132

Did you really mean 'VLMs'?

1. **Clone the repository**
```bash
Expand All @@ -138,7 +139,7 @@

2. **Pick a deployment strategy**
- Default: let `LeapModelDownloader.loadModel(...)` fetch LFM2.5-VL-1.6B from the LEAP Model Library on first launch
- Optional manual push: see the **Model Bundle Setup** accordion above for the ADB sideload path

Check warning on line 142 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L142

Did you really mean 'sideload'?

3. **Open in Android Studio**
- Launch Android Studio
Expand Down Expand Up @@ -286,7 +287,7 @@

**Resource cleanup best practices:**
- Always unload models in `onCleared()` to prevent memory leaks
- Never use `runBlocking` in `onCleared()` - it causes ANRs

Check warning on line 290 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L290

Did you really mean 'ANRs'?
- Use async cleanup with `CoroutineScope(Dispatchers.IO).launch`
- Catch exceptions to ensure cleanup doesn't crash the app

Expand Down Expand Up @@ -399,13 +400,13 @@
}
```

`ModelRunner.unload()` is `suspend` (per `ai.liquid.leap.ModelRunner`), so call it from a coroutine scope.

Check warning on line 403 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L403

Did you really mean 'coroutine'?

## Results

The VLMExample demonstrates powerful image understanding capabilities:

Check warning on line 407 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L407

Did you really mean 'VLMExample'?

![VLMExample Screenshot](https://raw.githubusercontent.com/Liquid4All/LeapSDK-Examples/main/Android/VLMExample/docs/vlm_example.png)

Check warning on line 409 in examples/android/vision-language-model-example.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/vision-language-model-example.mdx#L409

Did you really mean 'VLMExample'?

The interface shows:
- Selected image displayed clearly with Coil
Expand Down
1 change: 1 addition & 0 deletions examples/android/web-content-summarizer.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Web Content Summarizer for Android"
description: "Android app that summarizes web pages on-device using a Liquid AI LFM model, with no cloud dependencies."
---

<Note>
Expand Down Expand Up @@ -126,8 +127,8 @@
- Select "Open an existing project"
- Navigate to the `ShareAI` folder and open it

3. **Gradle sync**

Check warning on line 130 in examples/android/web-content-summarizer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/web-content-summarizer.mdx#L130

Did you really mean 'Gradle'?
- Wait for Gradle to sync all dependencies

Check warning on line 131 in examples/android/web-content-summarizer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/web-content-summarizer.mdx#L131

Did you really mean 'Gradle'?
- Ensure all libraries download successfully

4. **Install on device**
Expand Down Expand Up @@ -186,7 +187,7 @@

### Web Content Extraction

The app uses **Jsoup** to parse HTML and extract main content:

Check warning on line 190 in examples/android/web-content-summarizer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/web-content-summarizer.mdx#L190

Did you really mean 'Jsoup'?

```kotlin
suspend fun extractWebContent(url: String): String = withContext(Dispatchers.IO) {
Expand Down Expand Up @@ -265,11 +266,11 @@

1. **Receive Intent** → Extract URL from share intent
2. **Fetch Content** → Download HTML via OkHttp
3. **Parse HTML** → Extract main text content with Jsoup

Check warning on line 269 in examples/android/web-content-summarizer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/web-content-summarizer.mdx#L269

Did you really mean 'Jsoup'?
4. **Generate Summary** → Process with LeapSDK on-device
5. **Display Result** → Show summary in UI with options to copy/share

All steps run asynchronously using Kotlin coroutines to keep the UI responsive.

Check warning on line 273 in examples/android/web-content-summarizer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/web-content-summarizer.mdx#L273

Did you really mean 'coroutines'?

## Demo

Expand Down Expand Up @@ -301,7 +302,7 @@
**Privacy-conscious Reading**
- Summarize sensitive content without sending it to cloud services
- Process work-related articles without data leaving your device
- Read summaries of paywalled content (from accessible portions)

Check warning on line 305 in examples/android/web-content-summarizer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/web-content-summarizer.mdx#L305

Did you really mean 'paywalled'?

**Time Efficiency**
- Decide if an article is worth reading in full
Expand All @@ -316,7 +317,7 @@
- **Summary length control** - Let users choose brief, medium, or detailed summaries
- **Language detection** - Automatically detect and handle non-English content
- **Offline queue** - Save shared URLs for summarization when model is available
- **Export options** - Save summaries as text files, PDFs, or to note-taking apps

Check warning on line 320 in examples/android/web-content-summarizer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/android/web-content-summarizer.mdx#L320

Did you really mean 'PDFs'?
- **Reading time estimate** - Show how long the original article would take to read
- **Key quotes extraction** - Highlight important quotes in addition to summary
- **Topic tagging** - Automatically categorize summaries by topic
Expand Down
1 change: 1 addition & 0 deletions examples/customize-models/car-maker-identification.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
title: "Fine tuning LFM2-VL to identify car makers from images"
description: "Fine-tune LFM2-VL to identify car makers from images using structured output, LoRA, and an evaluation pipeline."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/car-maker-identification">
Browse the complete example on GitHub
</Card>

A step by step guide on fine tuning a Vision Language Model for image identification tasks. The task we solve in this example is to identify the car maker from an image, but the learnings transfer to any other image classification task you might be interested in.

Check warning on line 10 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L10

Did you really mean 'learnings'?

![](/images/examples/customize-models/assets/images/task-01484227e78d02da63eeb840de314523.png)

Expand Down Expand Up @@ -107,14 +108,14 @@
### Weights & Biases setup[​](#weights--biases-setup "Direct link to Weights & Biases setup")

<Accordion title="Click to see installation instructions">
1. Create an account at [wandb.ai](https://wandb.ai/)

Check warning on line 111 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L111

Did you really mean 'wandb'?

Check warning on line 111 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L111

Did you really mean 'wandb'?
2. Install the Weights & Biases Python package inside your virtual environment:
```
uv add wandb

Check warning on line 114 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L114

Did you really mean 'uv'?
```
3. Authenticate with Weights & Biases:
```
uv run wandb login

Check warning on line 118 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L118

Did you really mean 'uv'?
```
This will open a browser window where you can copy your API key and paste it in the terminal.
</Accordion>
Expand All @@ -124,7 +125,7 @@
<Accordion title="Click to see installation instructions">
1. Install make:
```
sudo apt-get install make

Check warning on line 128 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L128

Did you really mean 'sudo'?
```
</Accordion>

Expand All @@ -146,7 +147,7 @@

3. **Fine-tune with LoRA**. Apply parameter-efficient fine-tuning using Low-Rank Adaptation to improve model accuracy while keeping computational costs manageable.

4. **Evaluate improvements**. Compare fine-tuned model performance against baselines to measure the effectiveness of our customization. If you are happy with th results, you are done. Otherwise, you need to dig deeper into model failures and improve the dataset you started with, or the fine-tuning process.

Check warning on line 150 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L150

Did you really mean 'th'?

Let's go one by one.

Expand Down Expand Up @@ -174,11 +175,11 @@
* **Classes**: 49 unique car manufacturers.
* **Splits**: Train (6,860 images) and test (6,750 images) splits.

The dataset includes additional splits with various image corruptions (gaussian noise, motion blur, etc.) for robustness testing, making it ideal for evaluating model performance under different conditions. In this tutorial we will only use the train and test splits.

Check warning on line 178 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L178

Did you really mean 'gaussian'?

## Step 2. Baseline performance of LFM2-VL models[​](#step-2-baseline-performance-of-lfm2-vl-models "Direct link to Step 2. Baseline performance of LFM2-VL models")

Before embarking into any fine-tuning experiment, we need to establish a baseline performance for existing models. In this case, we will evaluate the peformance of

Check warning on line 182 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L182

Did you really mean 'peformance'?

* LFM2-VL-450M
* LFM2-VL-1.6B
Expand All @@ -195,7 +196,7 @@
└── eval_lfm_3B_raw_generation.yaml
```

These YAML configs are loaded into our Python script using the `EvaluationConfig` class in `src/car_maker_identification/config.py`, so we ensure

Check warning on line 199 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L199

Did you really mean 'configs'?

Check warning on line 199 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L199

Did you really mean 'car_maker'?

* all necessary parameters are passed and
* they all have valid values according to their types.
Expand All @@ -204,14 +205,14 @@

<Accordion title="Click to see system and user prompts">
```yaml
system_prompt: |

Check warning on line 208 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L208

Did you really mean 'system_prompt'?
You excel at identifying car makers from pictures.

user_prompt: |
What car maker do you see in this picture?
Pick one from the following list:
- AM
- Acura

Check warning on line 215 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L215

Did you really mean 'Acura'?
- Aston
- Audi
- BMW
Expand All @@ -221,19 +222,19 @@
- Cadillac
- Chevrolet
- Chrysler
- Daewoo

Check warning on line 225 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L225

Did you really mean 'Daewoo'?
- Dodge
- Eagle
- FIAT
- Ferrari
- Fisker

Check warning on line 230 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L230

Did you really mean 'Fisker'?
- Ford
- GMC
- Geo
- HUMMER
- Honda
- Hyundai
- Infiniti

Check warning on line 237 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L237

Did you really mean 'Infiniti'?
- Isuzu
- Jaguar
- Jeep
Expand All @@ -241,7 +242,7 @@
- Land
- Lincoln
- MINI
- Maybach

Check warning on line 245 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L245

Did you really mean 'Maybach'?
- Mazda
- McLaren
- Mercedes-Benz
Expand All @@ -252,7 +253,7 @@
- Ram
- Rolls-Royce
- Scion
- Spyker

Check warning on line 256 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L256

Did you really mean 'Spyker'?
- Suzuki
- Tesla
- Toyota
Expand Down Expand Up @@ -287,7 +288,7 @@

However, before blaming it on the model, let's dig deeper into the model predictions to see what's going on.

If you look at the confusion matrix of the 3B model, you will see that even though the model works okeyish overall, it sometimes fails terribly too, and generates output that does not correspond to any car maker name.

Check warning on line 291 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L291

Did you really mean 'okeyish'?

![](/images/examples/customize-models/assets/images/confusion_matrix_lfm2_3b_raw_generation-2b4949c6ff212ebbb275982abf4784fb.png)

Expand Down Expand Up @@ -362,7 +363,7 @@

![](/images/examples/customize-models/assets/images/confusion_matrix_lfm2_3b_structured_generation-f93ecf885ff6ee370009f1c97873de1b.png)

At this point you need to decide if the performance is good enough for your use case. If it is, you are done. Otherwis, it is time to fine-tune the model.

Check warning on line 366 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L366

Did you really mean 'Otherwis'?

## Step 4. Fine tuning with LoRA[​](#step-4-fine-tuning-with-lora "Direct link to Step 4. Fine tuning with LoRA")

Expand All @@ -387,17 +388,17 @@

At this stage we know that for the same training dataset, the LFM2-VL-3B model is able to fit the data better than the other two models.

Apart from this, the train loss curves do not tell us much about the actual model peformance. Language Models are highly parametric neural networks, that can fit **anything** in the training dataset. This **anything** includes both actual patterns in the data, and noise, that does not generalize to the test set.

Check warning on line 391 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L391

Did you really mean 'peformance'?

So, to get a better understanding of the model performance, we need to evaluate the model on a held-out dataset. This is what the evaluation loss curve tells us.

![](/images/examples/customize-models/assets/images/eval_loss-dc36b175d7b477b1a872968ee044c8f6.png)

Again LFM2-VL-3B is able to fit the data better than the other two models. When you look at its evaluation loss curve, you can see that it is stricly decreasing, meaning the model is learning epoch by epoch and still has not gotten to the point of overfitting.

Check warning on line 397 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L397

Did you really mean 'stricly'?

Check warning on line 397 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L397

Did you really mean 'overfitting'?

The following table shows the evaluation loss at different checkpoints during fine-tuning:

| Checkpoint | Train Loss | Eval Loss |

Check warning on line 401 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L401

Did you really mean 'Eval'?
| ---------- | ---------- | --------- |
| 100 | 5.82 | 5.46 |
| 200 | 0.16 | 0.20 |
Expand All @@ -406,7 +407,7 @@
| 1000 | 0.008 | 0.005 |

<Check>
Overfitting is when a model learns the noise in the training data, and does not generalize to the test set. In other words, the training loss is decreasing, but the evaluation loss is increasing.

Check warning on line 410 in examples/customize-models/car-maker-identification.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/car-maker-identification.mdx#L410

Did you really mean 'Overfitting'?
</Check>

At this point, we can conclude that LFM2-VL-3B is the most promising model for our use case. However, we still need to check its actual performance on the test set.
Expand Down
1 change: 1 addition & 0 deletions examples/customize-models/home-assistant.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Fine-tuning LFM for a local Home Assistant"
description: "End-to-end guide to fine-tuning and deploying a local home assistant with Liquid AI LFM models, covering prototyping, synthetic data, and tool calling."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/home-assistant">
Expand All @@ -17,7 +18,7 @@
1. Build a proof of concept for a fully local Home Assistant.
2. Benchmark its tool-calling accuracy so you have a clear baseline to improve on.
3. Generate synthetic data for model fine-tuning.
4. Fine-tune the model on this synthetic data to maximise accuracy using serverless GPUs by Modal.

Check warning on line 21 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L21

Did you really mean 'serverless'?

Check warning on line 21 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L21

Did you really mean 'GPUs'?
5. Deploy the fine-tuned model in the app.

## Quickstart
Expand Down Expand Up @@ -59,7 +60,7 @@

Let's go one by one.

### Install uv

Check warning on line 63 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L63

Did you really mean 'uv'?

<Accordion title="Click to see installation instructions for your platform">
**macOS/Linux:**
Expand Down Expand Up @@ -106,14 +107,14 @@
### Weights & Biases setup

<Accordion title="Click to see installation instructions">
1. Create an account at [wandb.ai](https://wandb.ai/)

Check warning on line 110 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L110

Did you really mean 'wandb'?

Check warning on line 110 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L110

Did you really mean 'wandb'?
2. Install the Weights & Biases Python package:
```bash
uv add wandb

Check warning on line 113 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L113

Did you really mean 'uv'?
```
3. Authenticate:
```bash
uv run wandb login

Check warning on line 117 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L117

Did you really mean 'uv'?
```
</Accordion>

Expand Down Expand Up @@ -266,7 +267,7 @@
```

1. **Blocklist in the prompt.** Every benchmark utterance is listed and the model is told not to reproduce them.
2. **Filter by exact or substring match.** Catches verbatim copies.

Check warning on line 270 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L270

Did you really mean 'substring'?
3. **Filter by trigram similarity.** Catches light paraphrases by measuring overlapping three-word chunks. Candidates with more than 50% overlap are discarded.
4. **Agent cross-validation.** Each surviving candidate is run through the real agent. Only examples where the agent produces the expected tool call are kept.

Expand All @@ -287,7 +288,7 @@

Fine-tuning adapts the base model to our specific task. We use LoRA (Low-Rank Adaptation), which injects a small set of trainable weight matrices on top of the frozen base model. This keeps GPU memory usage low and training fast while still producing meaningful accuracy gains.

Training runs on [Modal](https://modal.com) (a serverless GPU cloud) via [leap-finetune](https://github.com/Liquid4All/leap-finetune), Liquid AI's open source fine-tuning tool.

Check warning on line 291 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L291

Did you really mean 'serverless'?

```mermaid
sequenceDiagram
Expand Down Expand Up @@ -358,7 +359,7 @@
| lights | 25.0% | 87.5% |
| scene | 0.0% | 80.0% |
| doors | 56.2% | 56.2% |
| multi_tool | 8.3% | 33.3% |

Check warning on line 362 in examples/customize-models/home-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/home-assistant.mdx#L362

Did you really mean 'multi_tool'?
| status | 0.0% | 30.0% |
| thermostat | 0.0% | 18.8% |
| rejection | 0.0% | 0.0% |
Expand Down
1 change: 1 addition & 0 deletions examples/customize-models/satellite-vlm.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Fine-Tune a Vision-Language Model on Satellite Imagery"
description: "Fine-tune LFM2.5-VL-450M on satellite imagery for visual question answering, grounding, and captioning with leap-finetune."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/satellite-vlm">
Expand All @@ -9,7 +10,7 @@
Fine-tune [LiquidAI/LFM2.5-VL-450M](https://huggingface.co/LiquidAI/LFM2.5-VL-450M) on satellite imagery tasks using

- [leap-finetune](https://github.com/Liquid4All/leap-finetune/): Liquid AI's fine-tuning framework for LFM models.
- [Modal](https://modal.com): serverless GPU cloud for running data prep and training without managing infrastructure.

Check warning on line 13 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L13

Did you really mean 'serverless'?
- [VRSBench](https://huggingface.co/datasets/xiang709/VRSBench) dataset (NeurIPS 2024) which supports three tasks:
- **VQA**: answer questions about satellite images (123K QA pairs)
- **Visual Grounding**: detect and localize objects with bounding boxes (52K references)
Expand All @@ -21,7 +22,7 @@

1. **Install and authenticate** (run from `cookbook/examples/satellite-vlm/`):

Modal provides serverless GPUs you pay for per second. New accounts include $30 of free credit, enough to run this example end to end. No local GPU required.

Check warning on line 25 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L25

Did you really mean 'serverless'?

Check warning on line 25 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L25

Did you really mean 'GPUs'?

```bash
uv sync
Expand All @@ -48,13 +49,13 @@

All heavy computation runs in the cloud. The only things that run locally are the `prepare_vrsbench.py` launcher and the `leap-finetune` CLI, both of which just submit jobs and stream logs.

1. **Data prep (Modal CPU container):** `prepare_vrsbench.py --modal` spins up a Modal container, downloads VRSBench (~12 GB) from HuggingFace, converts it to JSONL, and writes everything to a Modal volume named `satellite-vlm`.

Check warning on line 52 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L52

Did you really mean 'VRSBench'?
2. **Training (Modal H100):** `leap-finetune` submits a training job that reads data from the same volume, fine-tunes the model, and saves checkpoints back to the volume.
3. **Retrieval (local):** you pull the checkpoints from the volume to your local machine with `modal volume get`.

## Data Preparation

`prepare_vrsbench.py` downloads VRSBench from HuggingFace and converts it to the JSONL format required by leap-finetune.

Check warning on line 58 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L58

Did you really mean 'VRSBench'?

**Modal (recommended):** runs entirely in the cloud, writes directly to the `satellite-vlm` Modal volume:

Expand Down Expand Up @@ -82,7 +83,7 @@

The job runs on an H100, streams logs to your terminal, and saves checkpoints to the `satellite-vlm` Modal volume under `/satellite-vlm/outputs/`.

To enable experiment tracking, uncomment `tracker: "wandb"` in the config.

Check warning on line 86 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L86

Did you really mean 'uncomment'?

## Retrieving Checkpoints

Expand All @@ -95,7 +96,7 @@

## Data Format

The grounding task uses JSON bounding box format with 0-1 normalized coordinates, matching the LFM VLM's pretraining format:

Check warning on line 99 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L99

Did you really mean 'VLM's'?

Check warning on line 99 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L99

Did you really mean 'pretraining'?

```
User: Inspect the image and detect the large white ship.
Expand All @@ -112,21 +113,21 @@

Benchmarks run automatically during training at every `eval_steps`:

- **VQA**: `short_answer` metric (case-insensitive substring match)

Check warning on line 116 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L116

Did you really mean 'substring'?
- **Grounding**: `grounding_iou` metric (IoU@0.5 threshold)
- **Captioning**: `CIDEr` or `BLEU` metrics

Each eval dataset can be limited (e.g., 500 samples) via the `limit` field in the YAML config for faster iteration.

Check warning on line 120 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L120

Did you really mean 'eval'?

**Running a full standalone evaluation:** to evaluate on the complete dataset without retraining, use `configs/vrsbench_full_eval.yaml`. Set `eval_on_start: true`, remove the `limit` fields, and point the config at your checkpoint path. The model runs the full evaluation at step 0, logs results to WandB, and terminates.

## AI in Space Hackathon

Check warning on line 124 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L124

Did you really mean 'Hackathon'?

This example is the official starting point for the [**AI in Space Hackathon**](https://luma.com/n9cw58h0), a fully online event organised in partnership between [DPhi Space](https://github.com/DPhi-Space/SimSat) and Liquid AI, open to builders from all around the globe.

Check warning on line 126 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L126

Did you really mean 'Hackathon'?

Use this fine-tuning pipeline as your baseline and push it further with real satellite data.

[![AI in Space Hackathon](/images/examples/customize-models/satellite-vlm/hackathon_banner.jpeg)](https://luma.com/n9cw58h0)

Check warning on line 130 in examples/customize-models/satellite-vlm.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/satellite-vlm.mdx#L130

Did you really mean 'Hackathon'?

<CardGroup cols={1}>

Expand Down
1 change: 1 addition & 0 deletions examples/customize-models/wildfire-prevention.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Build a Wildfire Prevention System with a Compact VLM"
description: "Build an on-satellite wildfire detection system using Sentinel-2 imagery and LFM2.5-VL-450M for in-orbit inference."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/wildfire-prevention">
Expand All @@ -9,7 +10,7 @@
In this example you will learn how to build a basic wildfire prevention system using:

- Sentinel-2 satellite images
- [LFM2.5-VL-450M](https://huggingface.co/LiquidAI/LFM2.5-VL-450M), a compact Vision-Language Model running directly on the satellite, so inference happens in orbit and only a lightweight JSON payload is downlinked to Earth.

Check warning on line 13 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L13

Did you really mean 'downlinked'?

```mermaid
flowchart LR
Expand Down Expand Up @@ -50,9 +51,9 @@
<Note>
**What is Sentinel-2?**

Sentinel-2 is a European Space Agency (ESA) satellite mission that captures high-resolution optical imagery of Earth's surface. It's part of the EU's Copernicus programme.

Check warning on line 54 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L54

Did you really mean 'EU's'?

It consists of 3 satellites (Sentinel-2A, 2B and 2C) which orbit in tandem, revisiting the same location every 5 days at the equator (more frequently at higher latitudes), and capturing **multispectral** images across **13 discrete wavelength ranges** simultaneously. Each range is called a band, and each band carries information about vegetation health, water content, soil moisture, or atmospheric conditions that is not visible to the naked eye.

Check warning on line 56 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L56

Did you really mean 'multispectral'?
</Note>

In this repository we use two different images for a given location:
Expand All @@ -76,15 +77,15 @@
```json
{
"risk_level": "high",
"dry_vegetation_present": true,

Check warning on line 80 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L80

Did you really mean 'dry_vegetation_present'?
"urban_interface": true,
"steep_terrain": true,

Check warning on line 82 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L82

Did you really mean 'steep_terrain'?
"water_body_present": false,

Check warning on line 83 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L83

Did you really mean 'water_body_present'?
"image_quality_limited": false
}
```

3. This payload is downlinked to ground control on Earth. As the image tile has high risk, the system sends an alert to local fire services. These can then take precautionary measures like ground patrol deployment or controlled burns to reduce available fuel.

Check warning on line 88 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L88

Did you really mean 'downlinked'?

## 2. System design

Expand All @@ -94,7 +95,7 @@

The bottleneck is not capability. It is **data transmission**.

A frontier model runs on a server on Earth. To use it, the satellite downlinks raw images to a ground station, the ground station feeds the model, and the model produces the output on Earth. Images are high-dimensional: large matrices of pixel values per band, per frame. Multiply that by the number of captures per orbit, and you have a serious bandwidth problem.

Check warning on line 98 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L98

Did you really mean 'downlinks'?

```mermaid
flowchart LR
Expand All @@ -112,7 +113,7 @@
A =="|⚠️ raw image downlink<br/>hundreds of MB per frame|"==> B
```

A small model removes that bottleneck entirely. At 450M parameters, LFM2.5-VL-450M is compact enough to run directly on the satellite: the satellite captures the image and runs inference on-board, the local model produces the payload output in orbit, and only the lightweight output is downlinked to the ground station.

Check warning on line 116 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L116

Did you really mean 'downlinked'?

```mermaid
flowchart LR
Expand All @@ -138,26 +139,26 @@
|----|----------|
| `angeles_nf_ca` | Angeles National Forest, California |
| `santa_barbara_ca` | Santa Barbara, California |
| `napa_valley_ca` | Napa Valley, California |

Check warning on line 142 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L142

Did you really mean 'Napa'?
| `sierra_nevada_ca` | Sierra Nevada, California |
| `alentejo_portugal` | Alentejo, Portugal |

Check warning on line 144 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L144

Did you really mean 'Alentejo'?
| `attica_greece` | Attica, Greece |
| `cerrado_brazil` | Cerrado, Brazil |

Check warning on line 146 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L146

Did you really mean 'Cerrado'?
| `patagonia_argentina` | Patagonia, Argentina |
| `black_forest_germany` | Black Forest, Germany |
| `scottish_highlands` | Scottish Highlands |
| `borneo_rainforest` | Borneo Rainforest |

Check warning on line 150 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L150

Did you really mean 'Rainforest'?
| `tanzania_savanna` | Tanzania Savanna |
| `outback_nsw_australia` | Outback NSW, Australia |
| `victorian_alpine_au` | Victorian Alps, Australia |
| `kalahari_botswana` | Kalahari, Botswana |
| `zagros_iran` | Zagros Mountains, Iran |

Check warning on line 155 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L155

Did you really mean 'Zagros'?
| `negev_israel` | Negev Desert, Israel |
| `alpine_switzerland` | Swiss Alps |
| `amazon_brazil` | Amazon, Brazil |
| `congo_basin_drc` | Congo Basin, DRC |
| `lahaina_maui_hi` | Lahaina, Maui, Hawaii |

Check warning on line 160 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L160

Did you really mean 'Lahaina'?
| `mati_attica_gr` | Mati, Attica, Greece |

Check warning on line 161 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L161

Did you really mean 'Mati'?
</Accordion>

### Quickstart
Expand Down Expand Up @@ -245,7 +246,7 @@
2. Samples `--n-temporal-tiles` timestamps evenly spaced within `[--start-date, --end-date]` using bin-center placement, so timestamps are always in the interior of the window.
3. Builds a centered square grid of `--n-spatial-tiles` tiles around each location center, spaced `--size-km` apart.
4. Fetches the RGB and SWIR images in parallel from SimSat for each `(spatial tile, timestamp)` pair.
5. Saves `rgb.png` and `swir.png` to the tile subfolder.

Check warning on line 249 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L249

Did you really mean 'subfolder'?
6. Sends both images to `claude-opus-4-6` for risk annotation, with automatic retry on rate-limit errors.
7. Saves the structured JSON output as `annotation.json`.
8. Assigns the tile to `train/` or `test/` based on a temporal cutoff. This prevents near-duplicate images (Sentinel-2 revisits every 5 days) from appearing on both sides of the split.
Expand Down Expand Up @@ -314,20 +315,20 @@
- `results.json`: per-sample records with the model's actual predictions, ground truth, and per-field match results
- `meta.json`: run metadata (model, dataset, backend, split)

Once you have two or more eval runs, launch the comparison app to explore results visually:

Check warning on line 318 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L318

Did you really mean 'eval'?

```bash
uv run streamlit run app/eval_compare.py
```

![Eval comparison app demo](/images/examples/customize-models/wildfire-prevention/eval_app_demo.gif)

Check warning on line 324 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L324

Did you really mean 'Eval'?

### Results

Evaluated on 22 locations ([Paulescu/wildfire-prevention](https://huggingface.co/datasets/Paulescu/wildfire-prevention)), ground truth from `claude-opus-4-6`:

- `claude-opus-4-6` scores 0.99 overall, near-perfect across all fields. The result is not 100% due to non-determinism in token sampling.
- The base LFM2.5-VL-450M scores 0.38 overall: it produces valid JSON reliably but struggles with field accuracy, especially `risk_level` (0.08) and `urban_interface` (0.25). This is expected for a zero-shot compact model on a specialized task. Fine-tuning addresses this gap.

Check warning on line 331 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L331

Did you really mean 'risk_level'?

Check warning on line 331 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L331

Did you really mean 'urban_interface'?

| field | claude-opus-4-6 | LFM2.5-VL-450M Q8\_0 |
|---|---|---|
Expand All @@ -344,7 +345,7 @@

## 5. Fine-tuning

We use [leap-finetune](https://github.com/Liquid4All/leap-finetune) to fine-tune `LFM2.5-VL-450M` on the Opus-labeled dataset via Modal's serverless H100 infrastructure.

Check warning on line 348 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L348

Did you really mean 'serverless'?

### Step 1. Install leap-finetune

Expand Down Expand Up @@ -421,8 +422,8 @@

Two important observations:

- **Full fine-tuning, not LoRA (`use_peft: false`):** we update both the multimodal projector and the full language model backbone. Satellite imagery is severely underrepresented in standard VLM pretraining data, so the projector needs to genuinely re-learn how to map multispectral patches into meaningful tokens. At 450M parameters, full fine-tuning fits on a single H100 without the memory pressure that motivates LoRA on larger models.

Check warning on line 425 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L425

Did you really mean 'multimodal'?

Check warning on line 425 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L425

Did you really mean 'pretraining'?

Check warning on line 425 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L425

Did you really mean 'multispectral'?
- **Modal section:** the `modal` block tells leap-finetune to run the training job on Modal's serverless GPU platform rather than locally. It specifies the GPU type (`H100:1`), a timeout, and the Modal volume where the prepared dataset lives and where checkpoints are written.

Check warning on line 426 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L426

Did you really mean 'serverless'?

### Step 4. Kick off the fine-tuning

Expand Down Expand Up @@ -470,9 +471,9 @@
```

- **`--output`** sets the backbone path: the language model weights, quantized to Q8\_0 by default.
- The mmproj (`mmproj-lfm2.5-vl-wildfire-Q8_0.gguf`) is written automatically to the same directory, with `mmproj-` prepended. It contains the vision tower and multimodal projector weights (always F16).

Check warning on line 474 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L474

Did you really mean 'mmproj'?

Check warning on line 474 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L474

Did you really mean 'prepended'?

Check warning on line 474 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L474

Did you really mean 'multimodal'?

To use a different quantization level for the backbone, pass `--quant Q4_K_M` (or `Q4_0`, `Q5_K_M`, `Q6_K`, `F16`). The mmproj is always F16 regardless of `--quant`.

Check warning on line 476 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L476

Did you really mean 'mmproj'?

### Step 7. (Optional) Push the GGUF pair to HuggingFace

Expand Down Expand Up @@ -505,7 +506,7 @@

### Results

Evaluated on 172 test samples ([Paulescu/wildfire-prevention](https://huggingface.co/datasets/Paulescu/wildfire-prevention)), ground truth from `claude-opus-4-6`. Fine-tuning takes the model from 0.38 to 0.84 overall accuracy, more than doubling performance. The largest gains are on `risk_level` (0.08 → 0.76), `urban_interface` (0.25 → 0.93), and `image_quality_limited` (0.28 → 0.86).

Check warning on line 509 in examples/customize-models/wildfire-prevention.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/customize-models/wildfire-prevention.mdx#L509

Did you really mean 'image_quality_limited'?

| field | claude-opus-4-6 | LFM2.5-VL-450M Q8\_0 (base) | LFM2.5-VL-450M Q8\_0 (fine-tuned) |
|---|---|---|---|
Expand Down
1 change: 1 addition & 0 deletions examples/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Examples Library"
description: "Browse example projects and tutorials built with Liquid AI LFM models across laptop, Android, web, and fine-tuning use cases."
---

## Laptop
Expand Down Expand Up @@ -61,11 +62,11 @@
</Card>

<Card title="Vision Language Model Demo" icon="eye" href="/examples/android/vision-language-model-example">
Analyze images and answer visual questions on Android using Vision Language Models. Built with Jetpack Compose and Coil.

Check warning on line 65 in examples/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/index.mdx#L65

Did you really mean 'Jetpack'?
</Card>

<Card title="AI Agents with Koog" icon="robot" href="/examples/android/leap-koog-agent">
Build intelligent AI agents on Android with the Koog framework. Demonstrates tool invocation, context management, and MCP integration.

Check warning on line 69 in examples/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/index.mdx#L69

Did you really mean 'Koog'?
</Card>

</CardGroup>
Expand Down
1 change: 1 addition & 0 deletions examples/laptop-examples/audio-car-cockpit.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Audio car cockpit demo"
description: "Voice-controlled car cockpit demo combining LFM2.5-Audio for speech and LFM2 for tool calling, running entirely local."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/audio-car-cockpit">
Expand All @@ -8,7 +9,7 @@

## What's inside?

Combines [LFM2.5-Audio-1.5B](https://huggingface.co/LiquidAI/LFM2.5-Audio-1.5B-GGUF) in TTS and STT modes with [LFM2-1.2B-Tool](https://huggingface.co/LiquidAI/LFM2-1.2B-Tool-GGUF) within a mockup of a car cockpit, letting the user control the car functionalities by voice.

Check warning on line 12 in examples/laptop-examples/audio-car-cockpit.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/audio-car-cockpit.mdx#L12

Did you really mean 'mockup'?

All running locally in real-time.

Expand Down
1 change: 1 addition & 0 deletions examples/laptop-examples/audio-to-text-in-real-time.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Audio transcription in real-time"
description: "Real-time audio transcription using LFM2.5-Audio-1.5B with llama.cpp, running fully local on your machine."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/audio-transcription-cli">
Expand All @@ -18,7 +19,7 @@
cd cookbook/examples/audio-transcription-cli
```

2. Install uv on your system, if you don't have it already.

Check warning on line 22 in examples/laptop-examples/audio-to-text-in-real-time.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/audio-to-text-in-real-time.mdx#L22

Did you really mean 'uv'?

<Accordion title="Click to see installation instructions for uv">
**macOS/Linux:**
Expand Down Expand Up @@ -79,7 +80,7 @@

## llama.cpp support for audio models

[llama.cpp](https://github.com/ggerganov/llama.cpp) is a super fast and lightweight open-source inference engine for Language Models. It is written in C++ and can be used to run LLMs on your local machine. For example, our Python CLI used llama.cpp under the hood to deliver fast transcriptions, instead of using either `PyTorch` or the higher-level `transformers` library.

Check warning on line 83 in examples/laptop-examples/audio-to-text-in-real-time.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/audio-to-text-in-real-time.mdx#L83

Did you really mean 'LLMs'?

In the [examples.sh](https://github.com/Liquid4All/cookbook/blob/main/examples/audio-transcription-cli/examples.sh) script you will find 3 examples on how to run inference with LFM2.5-Audio-1.5B for 3 common use cases:

Expand Down
1 change: 1 addition & 0 deletions examples/laptop-examples/browser-control.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Browser control with GRPO reinforcement learning"
description: "Train a Liquid AI LFM model for web automation using GRPO reinforcement learning with BrowserGym environments."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/browser-control">
Expand All @@ -16,7 +17,7 @@

- A Vision Language Model (VLM) can take as inputs a screenshot and the user goal, and generates a sequence of actions to accomplish that goal.

![Browser control multimodal](https://github.com/Liquid4All/cookbook/raw/main/examples/browser-control/media/browser_control_multimodal.gif)

Check warning on line 20 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L20

Did you really mean 'multimodal'?

- A text-only Language Model can take as input the HTML code of the page and proceeds in the same way.

Expand Down Expand Up @@ -46,7 +47,7 @@

### Example

Task: "book the shortest one-way flight from LAF to Akuton, AK on 12/06/2016"

Check warning on line 50 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L50

Did you really mean 'Akuton'?

![Book flight](https://github.com/Liquid4All/cookbook/raw/main/examples/browser-control/media/book-flight.png)

Expand Down Expand Up @@ -101,35 +102,35 @@

It is simple enough to showcase the whole training pipeline without having to spend too much time training the model.

Feel free to choose another task from [this list](https://miniwob.farama.org/environments/list/) and burn some GPUs to hit good performance.

Check warning on line 105 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L105

Did you really mean 'GPUs'?

### 2. The RL algorithm -> GRPO

As the Language Model interacts with the environment you collect a sequence of rollouts with sparse rewards from the environment. Using these sparse rewards the RL algorithm (e.g. GRPO) adjusts the Language Model parameters to increase the chances of getting larger rewards.

Check warning on line 109 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L109

Did you really mean 'rollouts'?

Here is a sample of 4 rollouts for the same initial prompt/task, where the model:

Check warning on line 111 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L111

Did you really mean 'rollouts'?

1. Solves the task in the first step
2. Solves the task in the second step
3. Solves the task in the third step
4. Does not solve the task after 4 steps, which is the max rollout length we set.

Check warning on line 116 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L116

Did you really mean 'rollout'?

![4 rollouts](https://github.com/Liquid4All/cookbook/raw/main/examples/browser-control/media/4_rollouts.gif)

Check warning on line 118 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L118

Did you really mean 'rollouts'?

GRPO uses the relative performance within that group to determine which actions to reinforce.

![GRPO rewards](https://github.com/Liquid4All/cookbook/raw/main/examples/browser-control/media/grpo_rewards.jpg)

Responses that perform better than their groupmates get positive advantages, while worse ones get negative advantages. This approach is more memory-efficient than previous RL algorithms like Proximal Policy Optimization (PPO) since it eliminates the need to train and store a second language model for the value function.

Check warning on line 124 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L124

Did you really mean 'groupmates'?

GRPO has become one of the most popular algorithms used by AI labs and AI practitioners to train/fine-tune LMs with Reinforcement Learning.

Check warning on line 126 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L126

Did you really mean 'LMs'?

### 3. The policy -> LFM2-350M

We will be using [LFM2-350M](https://huggingface.co/LiquidAI/LFM2-350M), which is a small-yet-powerful-and-fast language model with:

- knowledge (MMLU, GPQA)
- instruction following (IFEval, IFBench)

Check warning on line 133 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L133

Did you really mean 'IFEval'?

Check warning on line 133 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L133

Did you really mean 'IFBench'?
- mathematical reasoning (GSM8K, MGSM)

To speed up training we will also add support for LoRA adapters, so we don't need a whole model fine-tune.
Expand All @@ -138,8 +139,8 @@

The 3 components of our RL training framework are:

1. The `GRPOTrainer` from the trl library that implements the GRPO algorithm. It needs to run on GPU so the backward pass that updates model parameters is fast enough.

Check warning on line 142 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L142

Did you really mean 'trl'?
2. The `vLLM` server to generate rollouts with LFM2-350M. It needs to run on GPU to parallelize the generation of rollouts.

Check warning on line 143 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L143

Did you really mean 'rollouts'?

Check warning on line 143 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L143

Did you really mean 'rollouts'?
3. The Docker container with the `BrowserGym` environment, running as a Hugging Face space. Feel free to run on locally or on your infra Kubernetes. This one can run on CPU.

![3 components](https://github.com/Liquid4All/cookbook/raw/main/examples/browser-control/media/3_components.jpg)
Expand All @@ -148,7 +149,7 @@

![Collocate vLLM](https://github.com/Liquid4All/cookbook/raw/main/examples/browser-control/media/collocate_vllm.jpg)

We use [Modal](https://modal.com/) for serverless GPU infrastructure. Modal is a great option for AI engineers who don't want to worry too much about infrastructure and prefer to pay per usage. It provides on-demand GPU access with simple Python-based configuration, making it easy to scale training workloads without managing clusters or dealing with complex DevOps setup.

Check warning on line 152 in examples/laptop-examples/browser-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/browser-control.mdx#L152

Did you really mean 'serverless'?

## Experiments

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Build a game with decision models"
description: "Build a pixel-art survival racer where Liquid AI decision models choose the safest lane in real time via structured classification."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/road-decider">
Expand All @@ -10,7 +11,7 @@

![Road Decider demo](/images/examples/laptop-examples/road-decider/demo.png)

Two cars race side by side on identical roads that get faster over time. Each car has three lives, and hitting traffic costs one. Play **You vs d1** with the arrow keys, or watch **Jev vs d1** to compare two decision models head-to-head.

Check warning on line 14 in examples/laptop-examples/build-a-game-with-decision-models.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/build-a-game-with-decision-models.mdx#L14

Did you really mean 'Jev'?

Decision models are purpose-built for classification, routing, and scoring. Instead of generating text token by token, they return a structured answer in a single call. That makes them fast enough to use inside a game loop, and cheap enough to call on every tick.

Expand Down Expand Up @@ -44,7 +45,7 @@
```

<Note>
Jev vs d1 mode is optional. To enable it, add an OpenRouter key as `OPENROUTER_API_KEY`.

Check warning on line 48 in examples/laptop-examples/build-a-game-with-decision-models.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/build-a-game-with-decision-models.mdx#L48

Did you really mean 'Jev'?
</Note>

### 3. Install dependencies and start the demo
Expand Down
1 change: 1 addition & 0 deletions examples/laptop-examples/flight-search-assistant.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Flight search assistant with tool calling"
description: "CLI flight search assistant using LFM2.5-1.2B-Thinking for multi-step reasoning and tool calling to search and book flights."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/flight-search-assistant">
Expand All @@ -12,7 +13,7 @@

## Quickstart

### 1. Verify uv installation

Check warning on line 16 in examples/laptop-examples/flight-search-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/flight-search-assistant.mdx#L16

Did you really mean 'uv'?

Check that you have `uv` available on your system:

Expand Down Expand Up @@ -57,7 +58,7 @@
```

<Note>
The implementation uses mocked flight data for demonstration purposes, though it supports integration with real APIs like Amadeus, Skyscanner, or Kiwi for production deployment.

Check warning on line 61 in examples/laptop-examples/flight-search-assistant.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/flight-search-assistant.mdx#L61

Did you really mean 'Skyscanner'?
</Note>

## Future Development
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
title: "Invoice extractor tool"
description: "Extract structured payment details from invoice PDFs using LFM2.5-VL-1.6B and llama.cpp, running fully local."

Check warning on line 3 in examples/laptop-examples/invoice-extractor-tool-with-liquid-nanos.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/invoice-extractor-tool-with-liquid-nanos.mdx#L3

Did you really mean 'PDFs'?
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/invoice-parser">
Browse the complete example on GitHub
</Card>

A Python CLI that extracts payment details from invoice PDFs.

Check warning on line 10 in examples/laptop-examples/invoice-extractor-tool-with-liquid-nanos.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/invoice-extractor-tool-with-liquid-nanos.mdx#L10

Did you really mean 'PDFs'?

![](https://github.com/Liquid4All/cookbook/raw/main/examples/invoice-parser/media/diagram.jpg)

Expand Down
1 change: 1 addition & 0 deletions examples/laptop-examples/lfm2-english-to-korean.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Bidirectional English to Korean translation CLI"
description: "CLI translation tool using a fine-tuned Liquid AI LFM2 model for bidirectional English-Korean translation with automatic language detection."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/lfm2-english-to-korean">
Expand All @@ -8,7 +9,7 @@

## What's inside?

An efficient bidirectional translation system powered by Liquid AI's LFM2 1.2B model fine-tuned for Korean-English translation. This project demonstrates how domain-specific fine-tuning can achieve superior performance compared to models 3x larger, outperforming Google's Gemma-3 4B and Alibaba's Qwen3 4B on the Flores-200 benchmark.

Check warning on line 12 in examples/laptop-examples/lfm2-english-to-korean.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/lfm2-english-to-korean.mdx#L12

Did you really mean 'Alibaba's'?

Key features:
- **Automatic language detection** - Intelligently detects input language and translates accordingly
Expand Down Expand Up @@ -48,7 +49,7 @@

- **Base Model**: `gyung/lfm2-1.2b-koen-mt-v4-100k` - SFT fine-tuned LFM2 1.2B
- **Adapter**: `gyung/lfm2-1.2b-koen-mt-v5-rl-10k-adapter` - LoRA adapter trained with GRPO
- **Automatic Detection**: Regular expression pattern matching for Korean text (Hangul syllables, Jamo)

Check warning on line 52 in examples/laptop-examples/lfm2-english-to-korean.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/lfm2-english-to-korean.mdx#L52

Did you really mean 'Jamo'?

The system automatically detects the input language and applies the appropriate translation direction, supporting both English→Korean and Korean→English translation.

Expand Down Expand Up @@ -103,7 +104,7 @@
- **Speed optimization** with quantization techniques (GGUF, AWQ, GPTQ)
- **llama.cpp integration** for faster CPU inference
- **Full parameter RL training** with expanded compute resources
- **Length normalization removal** based on recent Qwen team findings

Check warning on line 107 in examples/laptop-examples/lfm2-english-to-korean.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/lfm2-english-to-korean.mdx#L107

Did you really mean 'Qwen'?
- **Extended dataset training** with 200K SFT + 25K RL samples

### Performance Optimization
Expand Down
1 change: 1 addition & 0 deletions examples/laptop-examples/meeting-summarization.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Meeting summarization CLI"
description: "Summarize meeting transcripts locally using LFM2-2.6B-Transcript and llama.cpp with no cloud dependencies."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/meeting-summarization">
Expand All @@ -22,7 +23,7 @@

## Quick Start

### Install uv

Check warning on line 26 in examples/laptop-examples/meeting-summarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/laptop-examples/meeting-summarization.mdx#L26

Did you really mean 'uv'?

<Accordion title="Click to see installation instructions for uv">
**macOS/Linux:**
Expand Down
1 change: 1 addition & 0 deletions examples/web/audio-webgpu-demo.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "LFM2.5-Audio browser demo with WebGPU"
description: "Run LFM2.5-Audio-1.5B in the browser with WebGPU for speech recognition, text-to-speech, and audio conversations, fully client-side."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/audio-webgpu-demo">
Expand Down Expand Up @@ -61,12 +62,12 @@
**2. Text-to-Speech (TTS)**
- Input: Written text
- Output: Natural-sounding audio
- Use case: Create voice assistants, audiobooks, or accessibility features

Check warning on line 65 in examples/web/audio-webgpu-demo.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/web/audio-webgpu-demo.mdx#L65

Did you really mean 'audiobooks'?

**3. Interleaved Mode**
- Input: Mixed audio and text
- Output: Conversational responses in text or audio
- Use case: Interactive voice assistants and chatbots

Check warning on line 70 in examples/web/audio-webgpu-demo.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/web/audio-webgpu-demo.mdx#L70

Did you really mean 'chatbots'?

## System Requirements

Expand Down
1 change: 1 addition & 0 deletions examples/web/hand-voice-racer.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Hand & Voice Racer"
description: "Browser-based driving game controlled by hand gestures and voice commands using LFM2.5-Audio, running entirely client-side with WebGPU."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/hand-voice-racer">
Expand Down
1 change: 1 addition & 0 deletions examples/web/vl-webgpu-demo.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Real-time video captioning with LFM2.5-VL-1.6B and WebGPU"
description: "Run LFM2.5-VL-1.6B in the browser with WebGPU for real-time, private video captioning with no server required."
---

<Card title="View Source Code" icon="github" href="https://github.com/Liquid4All/cookbook/tree/main/examples/vl-webgpu-demo">
Expand Down Expand Up @@ -77,9 +78,9 @@
This demo can be deployed to any platform that supports CORS headers and SharedArrayBuffer:

- **Hugging Face Spaces** - Recommended for quick deployment
- **PaaS Providers** - Vercel, Netlify

Check warning on line 81 in examples/web/vl-webgpu-demo.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/web/vl-webgpu-demo.mdx#L81

Did you really mean 'Vercel'?

Check warning on line 81 in examples/web/vl-webgpu-demo.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/web/vl-webgpu-demo.mdx#L81

Did you really mean 'Netlify'?
- **Cloud Storage** - AWS S3 + CloudFront, Google Cloud Storage, Azure Blob Storage
- **Traditional Servers** - nginx, Apache, Caddy

Check warning on line 83 in examples/web/vl-webgpu-demo.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/web/vl-webgpu-demo.mdx#L83

Did you really mean 'nginx'?

Check warning on line 83 in examples/web/vl-webgpu-demo.mdx

View check run for this annotation

Mintlify / Mintlify Validation (liquidai) - vale-spellcheck

examples/web/vl-webgpu-demo.mdx#L83

Did you really mean 'Caddy'?

<Note>
**Important**: GitHub Pages is not supported due to CORS and SharedArrayBuffer requirements.
Expand Down
Loading