deepinfra://¶
DeepInfra — serverless hosted open-source models via an OpenAI-compatible API. Pay per token, broad catalogue covering Llama, Mixtral, Phi, Qwen, DeepSeek, etc.
Built on pkg/component/llmutil/ — same chat/embeddings shape as
openai://. This page covers only the DeepInfra-specific
defaults.
URI shape¶
deepinfra://chat?model=<id>&apiKey=<key>&temperature=<float>&maxTokens=<int>&baseURL=<url>
deepinfra://embeddings?model=<id>&apiKey=<key>
Parameters¶
| Param | Type | Default | Producer/Consumer/Both | Description |
|---|---|---|---|---|
| path | enum | required | Producer | chat or embeddings. |
model |
string | meta-llama/Meta-Llama-3.1-70B-Instruct |
Producer | DeepInfra model id — typically <org>/<model>. Browse https://deepinfra.com/models. |
apiKey |
string | (from constructor) | Producer | DeepInfra API token. Sent as Authorization: Bearer <key>. |
baseURL |
string | https://api.deepinfra.com/v1/openai |
Producer | Override for proxies. Note the URL ends in /openai — DeepInfra exposes the OpenAI-compatible subset under that prefix. |
temperature |
float | 0.7 |
Producer | Sampling temperature. |
maxTokens |
int | 4096 |
Producer | Output cap. |
Producer-only. Default timeout 120 s.
Headers¶
Namespaced under deepinfra.* (deepinfra.model, deepinfra.id,
deepinfra.finishReason, deepinfra.usage.*). Input header
systemPrompt works the same way.
Examples¶
DeepSeek for code:
Embeddings:
Behavior notes¶
See openai://. The /v1/openai suffix
on baseURL is the DeepInfra-specific quirk to keep in mind if you
ever override the base URL.
Source¶
pkg/component/deepinfra/deepinfra.go.pkg/component/llmutil/llmutil.go.