| 1 | --- |
| 2 | title: 模型设置 |
| 3 | description: 自动补全 \- 模型设置 |
| 4 | keywords: [模型, 自动补全] |
| 5 | sidebar_position: 2 |
| 6 | --- |
| 7 | |
| 8 | ## 最好的总体体验 |
| 9 | |
| 10 | 为了最好的自动补全体验,我们推荐通过 [Mistral API](https://console.mistral.ai/) 使用 Codestral 。这个模型提供高质量的补全,使用极好的代码上下文理解: |
| 11 | |
| 12 | ```json title="config.json" |
| 13 | { |
| 14 | "tabAutocompleteModel": { |
| 15 | "title": "Codestral", |
| 16 | "provider": "mistral", |
| 17 | "model": "codestral-latest", |
| 18 | "apiKey": "YOUR_API_KEY" |
| 19 | } |
| 20 | } |
| 21 | ``` |
| 22 | |
| 23 | :::tip[Codestral API Key] |
| 24 | Codestral 的 API key 和通常的 Mistral API 是不同的。如果你使用 Codestral ,你可能想要一个 Codestral API key ,但是如果你想分享 key 给团队或其他人想要使用 `api.mistral.ai` ,那么确保在你的 `tabAutocompleteModel` 中设置 `"apiBase": "https://api.mistral.ai/v1"` 。 |
| 25 | ::: |
| 26 | |
| 27 | ## 本地的,离线的/自托管的体验 |
| 28 | |
| 29 | 对于倾向于本地执行或自托管的, `StarCoder2-3b` 提供了一个对于大多数用户性能和质量的平衡: |
| 30 | |
| 31 | ```json title="config.json" |
| 32 | { |
| 33 | "tabAutocompleteModel": { |
| 34 | "title": "StarCoder2-3b", |
| 35 | "model": "starcoder2:3b", |
| 36 | "provider": "ollama" |
| 37 | } |
| 38 | } |
| 39 | ``` |
| 40 | |
| 41 | ## 可替代的体验 |
| 42 | |
| 43 | - 补全太慢?在更弱的机器上,试试 `deepseek-coder:1.3b-base` 更快的补全 |
| 44 | - 有更多的计算?使用 `deepseek-coder:6.7b-base` 获取可能更高质量的建议 |
| 45 | |
| 46 | :::note |
| 47 | 对于 LM Studio 用户,导航到 "My Models" 章节,找到你想要的模型,复制它的路径 (例如, second-state/StarCoder2-3B-GGUF/starcoder2-3b-Q8_0.gguf) 。使用这个路径作为你的配置中的 `model` 值。 |
| 48 | ::: |
| 49 | |
| 50 | ## 其他体验 |
| 51 | |
| 52 | 有很多更多的模型或提供者可以用来补全。在 [这里](../customize/model-roles/autocomplete.md) 查看它们。 |