Skills2026年3月31日·1 分钟阅读

llamafile — Single-File LLM, No Install Needed

llamafile distributes LLMs as single-file executables that run on any OS. 23.9K+ GitHub stars. No installation, cross-platform, built on llama.cpp + Cosmopolitan. Apache 2.0.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
llamafile — Single-File LLM, No Install Needed
先审查命令
npx -y tokrepo@latest install f30a667e-1b6a-4140-a92f-b5027f16c8bc --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Run LLMs as single-file executables on any OS with zero installation, built on llama.cpp and Cosmopolitan.
§01

What it is

llamafile packages a large language model and its inference engine into a single executable file that runs on Windows, macOS, Linux, and FreeBSD without any installation. The project combines llama.cpp (the inference engine) with Cosmopolitan libc (a cross-platform binary format) to create truly portable LLM executables. Download one file, make it executable, and run it.

This tool targets developers, researchers, and anyone who wants to run LLMs locally without dealing with Python environments, package managers, or GPU driver setup. llamafile is the simplest path from zero to a running local LLM.

§02

How it saves time or tokens

llamafile eliminates the entire setup process for running local LLMs. No pip install, no conda environment, no model downloading step, no configuration files. A single chmod +x && ./model.llamafile gets you a running model with a web UI. This saves the 30-60 minutes typically spent on local LLM setup and avoids all API token costs by running entirely on your hardware.

§03

How to use

  1. Download a llamafile from Hugging Face (Mozilla publishes several popular models)
  2. Make it executable with chmod +x
  3. Run it directly; a web UI opens at localhost for chat
§04

Example

# Download a model (e.g., Qwen 0.8B)
curl -LO https://huggingface.co/mozilla-ai/llamafile_0.10.0/resolve/main/Qwen3.5-0.8B-Q8_0.llamafile

# Make executable and run
chmod +x Qwen3.5-0.8B-Q8_0.llamafile
./Qwen3.5-0.8B-Q8_0.llamafile

# Web UI opens at http://localhost:8080
# Or use the API:
curl http://localhost:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"messages":[{"role":"user","content":"Hello"}]}'
§05

Related on TokRepo

§06

Common pitfalls

  • Large models (7B+) require significant RAM; the file size roughly indicates the memory needed at runtime
  • GPU acceleration works but may need specific flags depending on your GPU vendor and driver version
  • Windows may flag the executable as untrusted; you need to allow it through SmartScreen or Defender

常见问题

Which models are available as llamafiles?+

Mozilla publishes several popular models on Hugging Face in llamafile format, including Llama, Mistral, and Qwen variants. Community members also publish their own conversions. Any GGUF model can be converted to llamafile format.

Does llamafile support GPU acceleration?+

Yes. llamafile supports NVIDIA CUDA, Apple Metal, and AMD ROCm for GPU acceleration. The appropriate backend is selected automatically on most systems. Use --gpu flag to force GPU offloading.

How large are llamafile executables?+

File size depends on the model and quantization level. A small 0.8B model at Q8 quantization is around 1GB. A 7B model at Q4 is around 4GB. The executable includes both the model weights and the inference engine.

Can I use llamafile as an API server?+

Yes. llamafile starts an OpenAI-compatible API server alongside the web UI. Any tool that works with the OpenAI API format can connect to llamafile at localhost:8080 as a drop-in local replacement.

What is Cosmopolitan libc?+

Cosmopolitan libc is a C library that produces single binaries running on multiple operating systems. llamafile uses it to create one executable that works on Windows, macOS, Linux, and FreeBSD without recompilation.

引用来源 (3)
🙏

来源与感谢

Created by Mozilla. Licensed under Apache 2.0. Mozilla-Ocho/llamafile — 23,900+ GitHub stars

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产