Ollama
Ollama 是本機的預設選項:一個 CLI、一個模型庫、localhost:11434/v1 上的 OpenAI 相容服務。`ollama pull llama3.3` 拉一次,之後當一般供應商呼叫。
Ollama 是本機的預設選項:一個 CLI、一個模型庫、localhost:11434/v1 上的 OpenAI 相容服務。`ollama pull llama3.3` 拉一次,之後當一般供應商呼叫。
macOS、Linux、Windows。沒有配額。除非你主動選擇 Cloud,請求不會離開你的機器。想要圖形介面選 LM Studio;想要正式級批次處理選 vLLM。
- 最大上下文
- Whatever your RAM allows
- 免費額度
- 無限且私密
- 註冊要求
- 什麼都不用 —— 無帳號
端點
基底網址
http://localhost:11434/v1速率限制
None — it is your machine- OpenAI 相容
- 官方 SDK:Ollama SDK
- 文字
- 影像
- 程式碼
- 視覺
- 推理
程式碼範例
npm install openaiimport OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'http://localhost:11434/v1',
apiKey: 'not-needed'
})
const response = await client.chat.completions.create({
model: 'llama3.3',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.choices[0].message.content)pip install openaifrom openai import OpenAI
client = OpenAI(
base_url="http://localhost:11434/v1",
api_key="not-needed",
)
response = client.chat.completions.create(
model="llama3.3",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "llama3.3",
"messages": [{"role": "user", "content": "Explain closures in one paragraph."}]
}'npm install ollamaimport { Ollama } from 'ollama'
const ollama = new Ollama({ host: 'http://localhost:11434' })
const response = await ollama.chat({
model: 'llama3.3',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.message.content)pip install ollamafrom ollama import Client
client = Client(host="http://localhost:11434")
response = client.chat(
model="llama3.3",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response["message"]["content"])值得注意
- 第一次請求之前,先跑一次 `ollama pull llama3.3`。
你能免費使用的模型5
- Llama 3.3 70B
llama-3.3-70b - Qwen 3
qwen3 - GPT-OSS 120B
gpt-oss-120b - DeepSeek R1
deepseek-ai/DeepSeek-R1 - DeepSeek V4
deepseek-v4-flash