1 19 hours ago

A general-purpose 8.3B Mixture-of-Experts model from Liquid AI that activates only ~1.5B parameters per token — delivering strong reasoning, tool calling, and multilingual support while fitting comfortably in 8 GB VRAM.

ollama run oamazonasgabriel/lfm2.5-8b-a1b:q4_k_m-8gbGPU

Details

19 hours ago

f41222809e5f · 5.2GB ·

lfm2moe
·
8.47B
·
Q4_K_M
LFM Open License v1.0 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "
{ "frequency_penalty": 0, "min_p": 0, "num_batch": 512, "num_ctx": 32768, "num_g

Readme

LFM2.5-8B-A1B

A general-purpose 8.3B Mixture-of-Experts model from Liquid AI that activates only ~1.5B parameters per token — delivering strong reasoning, tool calling, and multilingual support while fitting comfortably in 8 GB VRAM.

Quick Start

ollama pull oamazonasgabriel/lfm2.5-8b-a1b:q4_k_m-8gbGPU
ollama run oamazonasgabriel/lfm2.5-8b-a1b:q4_k_m-8gbGPU

What Makes It Different

LFM2.5 uses a hybrid architecture that combines Liquid AI’s proprietary LIV (Liquid Interconnect Vision) convolution layers with standard GQA attention — unlike traditional transformer-only models. This gives it:

  • Efficient inference — Only 1.5B of 8.3B parameters activate per token
  • 128K native context — Long-form conversations and document analysis
  • Tool calling — Native function calling via tool_call_start/tool_call_end tokens
  • Multilingual — English, Arabic, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Spanish

Model Details

Property Value
Architecture Hybrid MoE (18 LIV conv blocks + 6 GQA layers)
Total Parameters 8.3B
Active Parameters ~1.5B per token
Layers 24
Native Context 128,000 tokens
Quantization Q4_K_M (~5.16 GB)
Effective Context (8 GB GPU) 32,768 tokens
License LFM Open License v1.0

Hardware Requirements

  • GPU: 8 GB VRAM (full GPU offload)
  • RAM: 8 GB system memory
  • Storage: ~5.5 GB for model weights

Optimizing for 8 GB GPUs

For best results on 8 GB GPUs, set these environment variables before starting Ollama:

export OLLAMA_KV_CACHE_TYPE=q8_0   # Reduces KV cache from ~0.8 GB to ~0.4 GB
export OLLAMA_NUM_PARALLEL=1        # Prevents memory fragmentation

With Q8_0 KV cache, total VRAM usage drops to ~5.9 GB, giving comfortable headroom.

Usage Examples

Interactive Chat

ollama run oamazonasgabriel/lfm2.5-8b-a1b:q4_k_m-8gbGPU

API (Chat Endpoint)

curl http://localhost:11434/api/chat -d '{
  "model": "oamazonasgabriel/lfm2.5-8b-a1b:q4_k_m-8gbGPU",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "What is the capital of France?"}
  ],
  "options": {"temperature": 0.2, "num_ctx": 32768}
}'

API (Raw Generate Endpoint)

Some use cases (e.g., function calling benchmarks) work better with the raw generate endpoint, which bypasses the chat template:

curl http://localhost:11434/api/generate -d '{
  "model": "oamazonasgabriel/lfm2.5-8b-a1b:q4_k_m-8gbGPU",
  "prompt": "You are a helpful assistant.\n\nQuestion: What is 2+2?",
  "stream": false,
  "options": {"temperature": 0.2}
}'

Tool Calling

LFM2.5 supports native tool calling through prompt mode. Define tools in the system prompt as JSON schemas and the model will generate structured function calls.

Example System Prompt for Tool Use

You are a helpful assistant with access to the following tools:

1. get_weather(location: str, unit: str = "celsius") -> str
   Get the current weather for a location.

2. search_web(query: str) -> list[str]
   Search the web for information.

When you need to call a tool, output:
[tool_name(param1="value1", param2="value2")]

Only call tools when necessary. Answer directly when you can.

Note: LFM2.5 does not support OpenAI-style tools parameter through Ollama’s chat API. Use prompt mode or the raw /api/generate endpoint for tool calling.

Performance Notes

  • Temperature 0.2 is recommended by Liquid AI for focused, accurate responses
  • The model generates verbose reasoning — it often explains its thinking before giving the answer
  • For structured output, use low temperature (0.0-0.2) and explicit format instructions
  • The ChatML-like format (im_start, im_end) is used internally by the tokenizer

Known Limitations

  • No native OpenAI tool calling — The chat API’s tools parameter produces empty responses. Use prompt mode instead.
  • Verbose output — The model tends to wrap answers in reasoning text. Add “Output only the answer, no explanation” to system prompts for concise results.
  • Irrelevance detection — May sometimes hallucinate function calls when none are appropriate (~59% accuracy on BFCL irrelevance tests).

Benchmark Results

BFCL (Berkeley Function Calling Leaderboard)

Both models benchmarked on the same hardware (single RTX 5060 Ti 16 GB) using the custom BFCL runner.

Category lfm2.5-8b-a1b:q4_k_m-8gbGPU (this model) qwen3.5-9b:q4-16gbGPU Δ
simple_python (400) 69.00% 82.75% - 13.75%
parallel (200) 57.50% 74.00% -16.50%
multiple (200) 62.00% 82.50% - 20.50%
irrelevance (240) 59.17% 87.50% - 28.33%
Overall (1040) 63.17% 82.12% - 18.95%

Latency: LFM 8B averages 1.68s/question vs Qwen 9B at 3.74s — LFM runs ~2.2× faster thanks to its MoE architecture (1.5B active vs 9B active parameters).

Takeaway: Both models fit entirely on a single 16 GB GPU. Qwen 9B achieves 82% accuracy with 9B dense parameters, while LFM 8B achieves 63% but with only 1.5B active parameters — trading accuracy for 2.2× faster inference. The ~19% accuracy gap is the cost of running 6× less compute per token.

License

LFM Open License v1.0 — Free for non-commercial and research use. Free for commercial use if annual revenue is below the threshold defined in the license. See LICENSE for full terms.