ZeroGPU
ZeroGPU is a compute-efficient inference provider for apps and agents. We run purpose-built small and nano language models across an edge network for the high-volume tasks you run constantly — classification, extraction, moderation, routing, summarization — at ~10x lower latency and 50%+ lower cost than frontier-model workflows. Auto-scaling, with zero GPU infrastructure to manage. Plug in and you’re live.
The ZeroGPU provider for the AI SDK supports:
- Text generation: streaming, tool calling, structured output and image input
- Classification and extraction: IAB taxonomy, signal extraction, GLiNER entity extraction and zero-shot classification models
- Embeddings: 384-dimensional sentence and retrieval embeddings
- Speech: text-to-speech and speech-to-text
Learn more in the ZeroGPU documentation.
Setup
The ZeroGPU provider is available in the @zerogpu/ai-sdk-provider module. You can install it with:
$ pnpm add @zerogpu/ai-sdk-provider
$ npm install @zerogpu/ai-sdk-provider
$ yarn add @zerogpu/ai-sdk-provider
$ bun add @zerogpu/ai-sdk-provider
Get an API key from the ZeroGPU dashboard and set it as an environment variable:
Provider Instance
You can import the default provider instance zerogpu from @zerogpu/ai-sdk-provider:
If you need a customized setup, you can use createZeroGPU and create a provider instance with your settings:
You can use the following optional settings to customize the ZeroGPU provider instance:
-
baseURL string
Use a different URL prefix for API calls, e.g. to use proxy servers. The default prefix is
https://api.zerogpu.ai/v1. -
apiKey string
API key that is being sent using the
Authorizationheader. It defaults to theZEROGPU_API_KEYenvironment variable. -
headers Record<string,string>
Custom headers to include in the requests.
-
fetch (input: RequestInfo, init?: RequestInit) => Promise<Response>
Custom fetch implementation. You can use it as a middleware to intercept requests, or to provide a custom fetch implementation for e.g. testing.
Language Models
You can create language models using a provider instance. The first argument is the model ID, for example:
Example
You can use ZeroGPU language models to generate text with the generateText function:
ZeroGPU language models can also be used in the streamText function
(see AI SDK Core).
Classification and Extraction Models
ZeroGPU's classification and extraction models are called with generateText and return their result as a JSON string.
They don't support streaming.
The GLiNER models take their task configuration through the metadata provider option:
deberta-v3-small classifies text against labels that you pass as instructions, e.g. instructions: '[Sports,Technology,Finance]'.
Provider Options
The following optional provider options are available for ZeroGPU language models:
-
reasoningEffort 'none' | 'minimal' | 'low' | 'medium' | 'high'
The reasoning effort for models that support adjustable reasoning. You can also use the AI SDK
reasoningoption. -
metadata Record<string, unknown>
Task configuration for the GLiNER models:
usecase(ner,jsonorclassification),labels,schemaandthreshold. -
categories string[]
Signal categories to extract with
zlm-v1-signal-extract. -
maxKeywords number
The maximum number of keywords returned by
zlm-v1-signal-extract.
Model Capabilities
| Model | Image Input | Object Generation | Tool Usage | Tool Streaming |
|---|---|---|---|---|
deepseek-v4.1-flash | ||||
glm-5.3-flash | ||||
gpt-4.1-mini | ||||
gpt-5.4-nano | ||||
gpt-5.6-luna | ||||
gpt-6-luna | ||||
gpt-oss-120b | ||||
qwen3-30b-a3b-fp8 | ||||
qwen3.6-35b-a3b | ||||
llama-3.1-8b-instruct-fast | ||||
llama-3.2-3b-instruct-fast | ||||
LFM2.5-1.2B-Instruct | ||||
LFM2.5-1.2B-Thinking | ||||
zlm-v1-tool-decisions |
The classification and extraction models are zlm-v1-iab-classify-edge, zlm-v2-iab-classify-edge-enriched, zlm-v1-iab-domain-classifier, zlm-v1-signal-extract, gliner2.5-base-v1, gliner2.5-multi-v1, gliner2.5-decide-v1 and deberta-v3-small.
Please see the ZeroGPU model catalog for the full list of available models and their input and output formats. You can also pass any available provider model ID as a string if needed.
Embedding Models
You can create models that call the ZeroGPU embeddings API using the .embeddingModel() factory method.
| Model | Default Dimensions |
|---|---|
bge-small-en-v1.5 | 384 |
all-minilm-l6-v2 | 384 |
Speech Models
You can create models that call the ZeroGPU speech API using the .speech() factory method.
| Model | Instructions | Speed | Language | Output Formats |
|---|---|---|---|---|
chatterbox-nano | mp3, wav, opus, aac, flac, pcm |
outputFormat can be mp3 (default), wav, opus, aac, flac or pcm.
The optional provider options seed, temperature, topP, topK and repetitionPenalty are also available.
Transcription Models
You can create models that call the ZeroGPU transcription API using the .transcription() factory method.
| Model | Transcription | Duration | Segments | Language |
|---|---|---|---|---|
whisper-tiny |
The optional provider options language (ISO-639-1, e.g. en) and temperature are available.