|
| 1 | +--- |
| 2 | +meta: |
| 3 | + title: Adding AI to the Zed IDE using Generative APIs |
| 4 | + description: Learn how to integrate AI-powered code models into Zed using Scaleway's Generative APIs. |
| 5 | +content: |
| 6 | + h1: Adding AI to to the Zed IDE using Generative APIs |
| 7 | + paragraph: Elevate your coding experience by integrating AI-powered code models into the Zed IDE. With Continue and Scaleway's Generative APIs, you can leverage AI to understand, generate, and optimize code with ease. |
| 8 | +tags: generative-apis ai machine-learning language-models code-assistance vs-code continue |
| 9 | +validation_date: 2025-03-18 |
| 10 | +posted_date: 2025-03-18 |
| 11 | +--- |
| 12 | + |
| 13 | +Zed is an IDE (Integrated Development Environment) including AI coding assistance support. Scaleway's Generative APIs supports Zed AI code completion and more. |
| 14 | + |
| 15 | + |
| 16 | +<Macro id="requirements" /> |
| 17 | + |
| 18 | +- A Scaleway account logged into the [console](https://console.scaleway.com) |
| 19 | +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 20 | +- A valid [API key](/iam/how-to/create-api-keys/) for API authentication |
| 21 | +- Installed [Zed](https://zed.dev/) on your local machine |
| 22 | + |
| 23 | +### Configure custom endpoints and models |
| 24 | + |
| 25 | +1. Edit Zed settings located in `settings.json`, and add the following content to it: |
| 26 | + ```json |
| 27 | + { |
| 28 | + "language_models": { |
| 29 | + "openai": { |
| 30 | + "api_url": "https://api.scaleway.ai/v1", |
| 31 | + "available_models": [ |
| 32 | + { |
| 33 | + "name": "qwen2.5-coder-32b-instruct", |
| 34 | + "display_name": "Qwen 2.5 Coder 32B", |
| 35 | + "max_tokens": 128000 |
| 36 | + } |
| 37 | + ], |
| 38 | + "version": "1" |
| 39 | + } |
| 40 | + }, |
| 41 | + "assistant": { |
| 42 | + "default_model": { |
| 43 | + "provider": "openai", |
| 44 | + "model": "qwen2.5-coder-32b-instruct" |
| 45 | + }, |
| 46 | + "version": "2" |
| 47 | + } |
| 48 | + } |
| 49 | + ``` |
| 50 | + |
| 51 | + This configuration will add a `qwen2.5-coder-32b-instruct` Scaleway hosted model available with the Zed `openai` provider, and use it as default model. |
| 52 | + |
| 53 | +2. Open AI Assistant configuration by either using the command palette and typing `assistant: show configuration` or clicking on the bottom right **Assistant Panel** button and then **Assistant menu** in top right and finally **Configure**. |
| 54 | + |
| 55 | +3. Scroll down to the OpenAI configuration, and paste your Scaleway Secret Key as API Key credentials. |
| 56 | + <Message type="note"> |
| 57 | + Your key will be deleted if you restart Zed. To store it permanently, alternatively, you can also setup your Scaleway Secret Key as `OPENAI_API_KEY` environment variable and restart Zed. |
| 58 | + </Message> |
| 59 | + |
| 60 | +4. Your setup is complete. If you open a new chat and select `Qwen 2.5 Coder 32B` model, you can send text and retrieve model answer. Additionally, you can also use [Inline Assist](https://zed.dev/docs/assistant/inline-assistant#:~:text=You%20can%20use%20ctrl%2Denter,even%20within%20the%20terminal%20panel.) feature when editing your code. |
0 commit comments