llama.cpp
llama.cpp 是幾乎所有其他本機工具包著的那層 C++ 引擎。不需要 Python,除了編譯器(或直接下發布二進位)別無依賴。`llama-server -hf ggml-org/gpt-oss-120b-GGUF` 在 8080 埠說 OpenAI。
llama.cpp 是幾乎所有其他本機工具包著的那層 C++ 引擎。不需要 Python,除了編譯器(或直接下發布二進位)別無依賴。`llama-server -hf ggml-org/gpt-oss-120b-GGUF` 在 8080 埠說 OpenAI。
上下文用啟動參數 -c 設定。CPU、Metal、CUDA、ROCm 都行。想貼著硬體用,或者嫌 Ollama 和 LM Studio 在模型外面包了太多東西,就用它。
- 最大上下文
- Set with -c at launch
- 免費額度
- 無限且私密
- 註冊要求
- 什麼都不用 —— 無帳號
端點
基底網址
http://localhost:8080/v1速率限制
None — it is your machine- OpenAI 相容
- 文字
程式碼範例
npm install openaiimport OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'http://localhost:8080/v1',
apiKey: 'not-needed'
})
const response = await client.chat.completions.create({
model: 'gpt-oss-120b',
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:8080/v1",
api_key="not-needed",
)
response = client.chat.completions.create(
model="gpt-oss-120b",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-oss-120b",
"messages": [{"role": "user", "content": "Explain closures in one paragraph."}]
}'值得注意
- 先啟動伺服器:`llama-server -hf ggml-org/gpt-oss-120b-GGUF`。
你能免費使用的模型2
- Llama 3.3 70B
llama-3.3-70b - Qwen 3
qwen3