From 7a1a7929bd245ebcd206edf575299cf8c94ad41f Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Fri, 6 Dec 2024 18:59:40 +0000 Subject: [PATCH] docs: Add x.ai Grok example (#21655) - Closes https://github.com/zed-industries/zed/issues/21635 Screenshot 2024-12-06 at 13 57 42 Release Notes: - Document support for x.ai Grok --- docs/src/assistant/configuration.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/src/assistant/configuration.md b/docs/src/assistant/configuration.md index 2145bd95045c43177b4218c95d16dd3316c6020c..8e558007bf24ae98f049d95975e22dd0498c2a5b 100644 --- a/docs/src/assistant/configuration.md +++ b/docs/src/assistant/configuration.md @@ -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