Skip to main content

Run Liquid AI's small models and 160 more from LLM API in AI Gateway

Say your on-call robot needs a bouncer: a cheap, fast model that decides whether a page is worth waking up for. Two new providers in AI Gateway sent candidates to the audition.

We sent each candidate two pages. Every one said WAKE when the production database went down. The second page came from a thirsty office plant, with its soil moisture sensor at 12%. LFM2.5-24B-A2B, Amazon Nova Pro, and Llama 3.3 70B all said SNOOZE. LFM3-1.7B said WAKE six times out of seven. It’s either overcautious or very fond of that plant.

Liquid AI

Liquid AI builds small models that answer fast and cost little. LFM3-1.7B, our plant enthusiast, costs $0.08 input and $0.20 output per 1M tokens. AI Gateway serves these Liquid models on your ngrok credits:

  • liquid/lfm3-1.7b and liquid/lfm2.5-24b-a2b for text.
  • liquid/lfm3-vl-2b for text and images.
  • liquid/lfm3-audio-2b and liquid/lfm3-omni-2b, which take audio input and can reply with audio. Audio tokens cost more than text tokens.
  • liquid/d1, liquid/d1.1, and liquid/d1-ultra, decision models that take the same System One requests as Jev and return typed answers with probabilities.

LLM API

LLM API serves models from many labs behind one API. Through AI Gateway, it adds more than 160 models, and 100 of them run on your ngrok credits. Dozens aren’t available from any other built-in provider, including Amazon Nova (amazon/nova-pro), Meta’s Llama 3.3 70B (meta-llama/llama-3.3-70b-instruct), Mistral Large 3 (mistral/mistral-large-2512), and ElevenLabs, Cartesia, and Deepgram voices on the speech endpoint.

LLM API also serves models that other providers already offer, such as Gemma 4. A bare model ID still goes to the model’s author first. To send a request through LLM API, prefix the ID, such as llmapi:google/gemma-4-31b-it.

Some LLM API models, including every Claude model, work only with your own LLM API key. On Models, filter by provider:llmapi and check each model’s providers to see which ones your credits cover.

Both providers also accept your own keys. Add a Liquid AI or LLM API key on Providers, and that provider bills you directly.

Get started

Create an ngrok account or sign in. Create an access key that allows Liquid AI or LLM API, and confirm your account has credits. The chat models here accept OpenAI chat completions requests.

Optionally, show the plant alert to a few candidates in the playground.

Follow the setup guide and select OpenAI and TypeScript.

Install the OpenAI SDK and TypeScript runner:

npm install openai && npm install --save-dev tsx

Save your ngrok access key in .env.local. Keep this file out of version control:

AI_GATEWAY_API_KEY=your_access_key_here

Use an ES module project ("type": "module" in package.json) for top-level await. Save this example as index.ts:

import OpenAI from "openai"; const client = new OpenAI({	baseURL: "https://gateway.ngrok.ai/v1",	apiKey: process.env.AI_GATEWAY_API_KEY,}); const response = await client.chat.completions.create({	model: "liquid/lfm3-1.7b",	messages: [		{			role: "system",			content: "You triage pages for an on-call robot. Reply with one word: WAKE or SNOOZE.",		},		{ role: "user", content: "Alert: the production database is down and checkout returns 500s." },	],}); console.log(response.choices[0]?.message.content);

Run the example from your project directory:

node --env-file=.env.local --import tsx index.ts

It prints WAKE. Your robot can read that one word and decide whether to get out of bed. Swap the alert for the office plant to see which candidates hold their nerve. Answers can vary between runs.

To hold the audition yourself, change model to "liquid/lfm2.5-24b-a2b", "amazon/nova-pro", "meta-llama/llama-3.3-70b-instruct", or "mistral/mistral-large-2512".

Open Activity, find each triage request, and inspect its model, provider, status, token usage, and cost. Each of our LFM3-1.7B verdicts cost less than two hundredths of a cent.