Using LFM2.5-24B-A2B on Vercel AI Gateway
Implementation guide · LFM-2.5 · Liquid AI
Vercel AI Gateway exposes LFM2.5-24B-A2B through model ID liquid/lfm2.5-24b-a2b. Use the setup steps, sourced pricing, capabilities, and official provider links below to validate this route before deployment.
Last refreshed 2026-10-14. Next refresh: weekly.
Quick Start
- 1
- 2Use the Vercel AI Gateway SDK or REST API to call
liquid/lfm2.5-24b-a2b— see the documentation for request format. - 3
Code Examples
pip install openaiAI_GATEWAY_API_KEYliquid/lfm2.5-24b-a2bcreator/model-name e.g. kwaipilot/kat-coder-pro-v2
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AI_GATEWAY_API_KEY"],
base_url="https://ai-gateway.vercel.sh/v1"
)
response = client.chat.completions.create(
model="liquid/lfm2.5-24b-a2b",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Pricing on Vercel AI Gateway
| Type | Price (per 1M) |
|---|---|
| Input tokens | $0.05 |
| Output tokens | $0.70 |
Capabilities
About LFM2.5-24B-A2B
LFM2.5-24B-A2B is Liquid AI's largest LFM2.5 model: a 24B-parameter mixture-of-experts reasoning model with about 2B active parameters per token, built for fast on-device agents. It keeps the LFM2 hybrid of gated short convolutions and GQA (40 layers, 64 experts, top-4 routing), extends context from 32,768 to 131,072 tokens, doubles the vocabulary to 128K, and scales pre-training from 17T to 33T tokens. Unlike LFM2-24B-A2B, it is reasoning-only (explicit chain of thought before the final answer) and is post-trained for tool calling and multi-step agent harnesses.