docs: Add x.ai Grok example (#21655)

- Closes https://github.com/zed-industries/zed/issues/21635

<img width="639" alt="Screenshot 2024-12-06 at 13 57 42"
src="https://github.com/user-attachments/assets/a4434edb-3c7d-40c0-9df8-7e928a9307d0">


Release Notes:

- Document support for x.ai Grok
This commit is contained in:
Peter Tripp 2024-12-06 18:59:40 +00:00 committed by GitHub
parent 0368fff030
commit 7a1a7929bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -192,6 +192,30 @@ The Zed Assistant comes pre-configured to use the latest version for common mode
You must provide the model's Context Window in the `max_tokens` parameter, this can be found [OpenAI Model Docs](https://platform.openai.com/docs/models). OpenAI `o1` models should set `max_completion_tokens` as well to avoid incurring high reasoning token costs. Custom models will be listed in the model dropdown in the assistant panel.
### OpenAI API Compatible
Zed supports using OpenAI compatible APIs by specifying a custom `endpoint` and `available_models` for the OpenAI provider.
#### X.ai Grok
Example configuration for using X.ai Grok with Zed:
```json
"language_models": {
"openai": {
"api_url": "https://api.x.ai/v1",
"available_models": [
{
"name": "grok-beta",
"display_name": "X.ai Grok (Beta)",
"max_tokens": 131072
}
],
"version": "1"
},
}
```
### Advanced configuration {#advanced-configuration}
#### Example Configuration