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