Skip to main content

使用 Llama 3.1 与 Continue

Continue 使得使用最新的开源模型进行编码变得容易,包括整个 Llama 3.1 系列模型。Llama 3.2 模型也受支持,但不建议用于聊天,因为它们专门设计为小型或多模态模型。

如果您还没有安装Continue,您可以在这里为VS Code安装在这里为JetBrains安装。有关自定义Continue的更多一般信息,请阅读我们的自定义文档

下面我们分享一些根据您的使用场景,最简单的方法来启动和运行。

Ollama

Ollama 是启动和运行本地语言模型的最快方式。我们推荐尝试 Llama 3.1 8b,它在其规模上令人印象深刻,并且在大多数硬件上表现良好。

  1. 下载 Ollama 这里(它会引导你完成接下来的步骤)
  2. 打开终端并运行 ollama run llama3.1:8b
  3. 像这样更改您的Continue配置文件:
config.json
{
"models": [
{
"title": "Llama 3.1 8b",
"provider": "ollama",
"model": "llama3.1-8b"
}
]
}

Groq

Groq 为开源语言模型提供最快的推理速度,包括整个 Llama 3.1 系列。

  1. 获取API密钥 这里
  2. 像这样更新你的Continue配置文件:
config.json
{
"models": [
{
"title": "Llama 3.1 405b",
"provider": "groq",
"model": "llama3.1-405b",
"apiKey": "<API_KEY>"
}
]
}

Together AI

Together AI 提供快速且可靠的开源模型推理。您将能够以良好的速度运行405b模型。

  1. 创建一个账户 这里
  2. 复制欢迎屏幕上显示的API密钥
  3. 像这样更新你的Continue配置文件:
config.json
{
"models": [
{
"title": "Llama 3.1 405b",
"provider": "together",
"model": "llama3.1-405b",
"apiKey": "<API_KEY>"
}
]
}

复制

Replicate 使得通过 API 托管和运行开源 AI 变得简单。

  1. 获取您的 Replicate API 密钥 这里
  2. 像这样更改您的Continue配置文件:
config.json
{
"models": [
{
"title": "Llama 3.1 405b",
"provider": "replicate",
"model": "llama3.1-405b",
"apiKey": "<API_KEY>"
}
]
}

SambaNova

SambaNova Cloud 提供世界纪录的 Llama3.1 70B/405B 服务。

  1. 创建一个账户 这里
  2. 复制你的API密钥
  3. 像这样更新你的Continue配置文件:
~/.continue/config.json
{
"models": [
{
"title": "SambaNova Llama 3.1 405B",
"provider": "sambanova",
"model": "llama3.1-405b",
"apiKey": "YOUR_API_KEY"
}
]
}

Cerebras 推理

Cerebras推理使用专用硅片为Llama3.1 8B/70B提供快速推理。

  1. 在门户中创建一个账户 这里.
  2. 创建并复制API密钥以在Continue中使用。
  3. 更新您的Continue配置文件:
config.json
{
"models": [
{
"title": "Cerebras Llama 3.1 70B",
"provider": "cerebras",
"model": "llama3.1-70b",
"apiKey": "YOUR_API_KEY"
}
]
}