llamafile
One file that is both the model and the runtime. Download, chmod +x, run. No install at all.
llamafile is Mozilla’s trick: one file that is both the GGUF weights and the runtime (llama.cpp plus Cosmopolitan Libc). Download, chmod +x, run. No install, no Python, no Docker.
`--server` exposes OpenAI-compat on port 8080. Context is -c at launch. The right tool when you want to hand someone a model as an executable.
- Max context
- Set with -c at launch
- Free tier
- Unlimited and private
- Requirement
- Nothing — no account
Endpoint
Base URL
http://localhost:8080/v1Rate limit
None — it is your machine- OpenAI-compatible
- text
Code examples
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: 'LLaMA_CPP',
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="LLaMA_CPP",
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": "LLaMA_CPP",
"messages": [{"role": "user", "content": "Explain closures in one paragraph."}]
}'Worth knowing
- `chmod +x model.llamafile && ./model.llamafile --server` and you are done.
Models you get for free2
- Llama 3.3 70B
llama-3.3-70b - Mixtral 8x7B
open-mixtral-8x7b