llamafile
llamafile ist Mozillas Trick: Eine Datei ist sowohl das GGUF-Gewicht als auch die Laufzeit (llama.cpp plus Cosmopolitan Libc). Herunterladen, chmod +x, ausführen. Keine Installation, kein Python, kein Docker.
llamafile ist Mozillas Trick: Eine Datei ist sowohl das GGUF-Gewicht als auch die Laufzeit (llama.cpp plus Cosmopolitan Libc). Herunterladen, chmod +x, ausführen. Keine Installation, kein Python, kein Docker.
`--server` legt OpenAI-Kompatibilität auf Port 8080. Kontext steht beim Start via -c fest. Das richtige Werkzeug, um jemandem ein Modell als Programm in die Hand zu drücken.
- Max. Kontext
- Set with -c at launch
- Gratis-Tarif
- Unbegrenzt und privat
- Anforderung
- Nichts — kein Konto
Endpunkt
Basis-URL
http://localhost:8080/v1Ratengrenze
None — it is your machine- OpenAI-kompatibel
- Text
Codebeispiele
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."}]
}'Wissenswert
- `chmod +x model.llamafile && ./model.llamafile --server` — fertig.
Modelle, die Sie gratis bekommen2
- Llama 3.3 70B
llama-3.3-70b - Mixtral 8x7B
open-mixtral-8x7b