云端模型
Ollama 的云端模型是 Ollama 中的一种新型模型,可以在没有强大 GPU 的情况下运行。相反,云端模型会自动托管到 Ollama 的云服务中,同时提供与本地模型相同的功能,从而使您能够在运行无法在个人电脑上运行的大模型时,继续使用您的本地工具。
支持的模型
要查看支持的模型列表,请参阅 Ollama 的 模型库。
运行云端模型
Ollama 的云端模型需要 ollama.com 账号。要登录或创建账号,请运行:
ollama signinCLI
要运行云端模型,打开终端并运行:
ollama run gpt-oss:120b-cloudPython
首先,拉取一个云端模型以供访问:
ollama pull gpt-oss:120b-cloud接下来,安装 Ollama 的 Python 库:
pip install ollama然后,创建并运行一个简单的 Python 脚本:
python
from ollama import Client
client = Client()
messages = [
{
'role': 'user',
'content': 'Why is the sky blue?',
},
]
for part in client.chat('gpt-oss:120b-cloud', messages=messages, stream=True):
print(part['message']['content'], end='', flush=True)JavaScript
首先,拉取一个云端模型以供访问:
ollama pull gpt-oss:120b-cloud接下来,安装 Ollama 的 JavaScript 库:
npm i ollama然后使用该库运行云端模型:
typescript
const ollama = new Ollama();
const response = await ollama.chat({
model: "gpt-oss:120b-cloud",
messages: [{ role: "user", content: "Explain quantum computing" }],
stream: true,
});
for await (const part of response) {
process.stdout.write(part.message.content);
}cURL
首先,拉取一个云端模型以供访问:
ollama pull gpt-oss:120b-cloud运行以下 cURL 命令通过 Ollama 的 API 运行命令:
curl http://localhost:11434/api/chat -d '{
"model": "gpt-oss:120b-cloud",
"messages": [{
"role": "user",
"content": "Why is the sky blue?"
}],
"stream": false
}'云端 API 访问
也可以直接通过 ollama.com 的 API 访问云端模型。在此模式下,ollama.com 作为远程 Ollama 主机。
身份验证
要直接访问 ollama.com 的 API,首先创建 API 密钥。
然后,将 OLLAMA_API_KEY 环境变量设置为您的 API 密钥。
export OLLAMA_API_KEY=your_api_key列出模型
对于可通过 Ollama API 直接获取的模型,可以通过以下命令列出:
curl https://ollama.com/api/tags生成响应
Python
首先,安装 Ollama 的 Python 库
pip install ollama然后发起请求
python
from ollama import Client
client = Client(
host="https://ollama.com",
headers={'Authorization': 'Bearer ' + os.environ.get('OLLAMA_API_KEY')}
)
messages = [
{
'role': 'user',
'content': 'Why is the sky blue?',
},
]
for part in client.chat('gpt-oss:120b', messages=messages, stream=True):
print(part['message']['content'], end='', flush=True)JavaScript
首先,安装 Ollama 的 JavaScript 库:
npm i ollama接下来,向模型发起请求:
typescript
const ollama = new Ollama({
host: "https://ollama.com",
headers: {
Authorization: "Bearer " + process.env.OLLAMA_API_KEY,
},
});
const response = await ollama.chat({
model: "gpt-oss:120b",
messages: [{ role: "user", content: "Explain quantum computing" }],
stream: true,
});
for await (const part of response) {
process.stdout.write(part.message.content);
}cURL
通过 Ollama 的聊天 API 生成响应:
curl https://ollama.com/api/chat \
-H "Authorization: Bearer $OLLAMA_API_KEY" \
-d '{
"model": "gpt-oss:120b",
"messages": [{
"role": "user",
"content": "Why is the sky blue?"
}],
"stream": false
}'仅限本地
通过 禁用 Ollama 的云端功能,Ollama 可以以仅限本地模式运行。
停用
随着更新且更好的开源模型的发布,Ollama 将偶尔弃用并停用旧的云端模型。依赖于 Ollama 云端模型的工具和应用程序可能需要更新以保持正常工作。受影响的用户将在模型弃用和停用前收到通知。弃用通知将通过电子邮件和 Ollama 网站进行传达。
Ollama 云端模型的停用不会影响本地模型。
即将停用的模型
| 停用日期 | 模型 | 推荐替代方案 |
|---|---|---|
| July 15, 2026 | deepseek-v3.1:671b | deepseek-v4-flash |
| July 15, 2026 | deepseek-v3.2 | deepseek-v4-flash |
| July 15, 2026 | devstral-2:123b | mistral-large-3:675b |
| July 15, 2026 | devstral-small-2:24b | |
| July 15, 2026 | ministral-3:14b | |
| July 15, 2026 | ministral-3:3b | |
| July 15, 2026 | ministral-3:8b | |
| July 15, 2026 | gemini-3-flash-preview | minimax-m3 |
| July 15, 2026 | gemma3:12b | gemma4:31b |
| July 15, 2026 | gemma3:27b | gemma4:31b |
| July 15, 2026 | gemma3:4b | gemma4:31b |
| July 15, 2026 | glm-4.7 | glm-5.2 |
| July 15, 2026 | glm-5 | glm-5.2 |
| July 15, 2026 | minimax-m2.1 | minimax-m3 |
| July 15, 2026 | qwen3-coder-next | qwen3.5:397b |
| July 15, 2026 | qwen3-coder:480b | qwen3.5:397b |