Skip to content

Commit 362019f

Browse files
Add The Grid model integration guide (#1291)
1 parent 34a8b9b commit 362019f

3 files changed

Lines changed: 81 additions & 6 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: The Grid
3+
subtitle: Use The Grid instruments in Vapi through the custom-llm provider
4+
description: Wire The Grid, an OpenAI-compatible inference marketplace, into Vapi with the custom-llm provider and Custom Credentials.
5+
slug: customization/custom-llm/thegrid
6+
---
7+
8+
The Grid is an inference marketplace that serves models from several labs behind one OpenAI-compatible API. Its instrument IDs describe capability tiers rather than specific lab models.
9+
10+
`text-standard`, `code-prime`, and `agent-max` each route to a current model for that tier. When The Grid replaces an underlying model, an assistant can keep using the same instrument ID.
11+
12+
The Grid exposes an OpenAI-compatible Chat Completions API, so you can connect it to Vapi as a [custom LLM](/customization/custom-llm/fine-tuned-openai-models).
13+
14+
Before starting, create an account with The Grid and a [Consumption API key](https://thegrid.ai/docs/api-reference/authentication).
15+
16+
## Add your credential
17+
18+
Send the following body to `POST https://api.vapi.ai/credential`. Use your [Vapi private API key](/security-and-privacy/api-keys) in the `Authorization: Bearer <VAPI_PRIVATE_KEY>` header:
19+
20+
```json
21+
{
22+
"provider": "custom-llm",
23+
"apiKey": "<YOUR THE GRID API KEY>"
24+
}
25+
```
26+
27+
Save the credential `id` from the response. Add it to the assistant's `credentialIds` to select that credential.
28+
29+
## Create the assistant
30+
31+
Send this body to `POST https://api.vapi.ai/assistant` with the same Vapi private API key. Set `model.url` to The Grid's base URL and `model.model` to an instrument ID:
32+
33+
```json
34+
{
35+
"name": "My Assistant",
36+
"credentialIds": ["<YOUR THE GRID CREDENTIAL ID>"],
37+
"model": {
38+
"provider": "custom-llm",
39+
"url": "https://api.thegrid.ai/v1",
40+
"model": "text-standard",
41+
"metadataSendMode": "off",
42+
"maxTokens": 600,
43+
"messages": [
44+
{
45+
"role": "system",
46+
"content": "You are a helpful voice assistant. Keep replies short."
47+
}
48+
]
49+
}
50+
}
51+
```
52+
53+
Setting `metadataSendMode` to `off` keeps Vapi call metadata out of requests to The Grid.
54+
55+
## Choose an instrument
56+
57+
`GET https://api.thegrid.ai/v1/models` lists available instrument IDs. Check [instrument specifications](https://thegrid.ai/instruments) and [pricing](https://thegrid.ai/pricing) for current details. Examples include:
58+
59+
| Instrument | Use it for |
60+
| --- | --- |
61+
| `text-standard` | General conversation. The usual starting point. |
62+
| `text-prime`, `text-max` | More demanding questions; compare current speed and price. |
63+
| `agent-standard`, `agent-max` | Multi-step tool use. |
64+
| `code-standard`, `code-prime` | Assistants that read or write code. |
65+
66+
## Set `maxTokens` for spoken replies
67+
68+
Vapi uses `250` for `maxTokens` when it is omitted and sends the value to The Grid as `max_tokens`. A low cap can cut off a response.
69+
70+
The `600` value in the example is a starting point. Test your chosen instrument with representative spoken turns and raise the limit if replies are truncated. Keep the system prompt explicit about brevity.
71+
72+
## Tool calling
73+
74+
The Grid's API supports OpenAI-style function calling. To configure Vapi tools, see the [tool calling integration guide](/customization/tool-calling-integration). Test a tool call with your chosen instrument before relying on it.
75+
76+
## Verify the assistant
77+
78+
Start a test call and ask the assistant a short question. Confirm it speaks a complete answer. Check the call logs for custom LLM errors. If you attached a tool, request an action that uses it. Confirm the tool runs.

‎fern/docs.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,8 @@ navigation:
858858
path: providers/model/openrouter.mdx
859859
- page: Perplexity
860860
path: providers/model/perplexity.mdx
861+
- page: The Grid
862+
path: customization/custom-llm/thegrid.mdx
861863
- page: TogetherAI
862864
path: providers/model/togetherai.mdx
863865
- page: xAI

‎fern/providers/model/overview.mdx‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,14 @@ The provider string is the exact value you pass in `model.provider`.
3131
| [OpenAI](/providers/model/openai#language-model) | `openai` |
3232
| [OpenRouter](/providers/model/openrouter#language-model) | `openrouter` |
3333
| [Perplexity](/providers/model/perplexity#language-model) | `perplexity-ai` |
34+
| [The Grid](/customization/custom-llm/thegrid) | `custom-llm` |
3435
| [Together AI](/providers/model/togetherai#language-model) | `together-ai` |
3536
| [xAI](/providers/model/xai#language-model) | `xai` |
3637

3738
<Note>
3839
The **Assistant → Model** dropdown in the [Vapi Dashboard](https://dashboard.vapi.ai) is the most current list of selectable models.
3940
</Note>
4041

41-
{/* verify: access mode is feature-flag gated per provider; confirm current state before publishing.
42-
Some providers are Vapi-managed (selectable without your own key); others require your own key
43-
added under Integrations. Anthropic and Anthropic (Bedrock) are two routes to the same Claude
44-
models, kept as separate pages. Vapi (white-label model) is omitted because it is gated by the enable-vapi-model
45-
flag and not generally visible. Mistral is dashboard-only (not in the public API model union). */}
46-
4742
## Related
4843

4944
<CardGroup cols={2}>

0 commit comments

Comments
 (0)