Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

llamafile

БесплатноБез исполняемых скриптовНе проверен

When setting up local LLM inference without cloud APIs. When running GGUF models locally. When needing OpenAI-compatible API from a local model. When building…

BbgnsurfTechот BbgnsurfTech★ 30 звёзд на GitHub

Об этом скилле

Llamafile

Configure and manage Mozilla Llamafile - a cross-platform executable distribution format that runs LLMs locally with an OpenAI-compatible API.

When to Use This Skill

Use this skill when:

  • Installing llamafile binary and GGUF model files
  • Starting llamafile server with optimal configuration
  • Integrating llamafile with LiteLLM or OpenAI SDK
  • Configuring llamafile for different performance profiles (GPU, CPU, network access)
  • Troubleshooting llamafile server startup or API connection issues
  • Building applications requiring local LLM inference
  • Setting up commit message tools, code review systems, or other developer tools with local AI
  • Managing llamafile as a background service
  • Selecting and downloading appropriate GGUF models
  • Validating OpenAI-compatible API responses

Core Capabilities

What Llamafile Provides

Llamafile combines llama.cpp with Cosmopolitan Libc to create single-file executables that:

  • Run on macOS, Windows, Linux, FreeBSD, OpenBSD, NetBSD
  • Support AMD64 and ARM64 architectures
  • Serve OpenAI-compatible HTTP API on localhost
  • Load GGUF model files for inference
  • Provide /health endpoint for monitoring
  • Support GPU acceleration (CUDA, Metal, Vulkan)
  • Enable embeddings generation with --embedding flag

API Compatibility

Llamafile exposes these OpenAI-compatible endpoints when running with --server:

Endpoint Description Requirements
http://localhost:8080/v1/chat/completions Chat completions (primary) Server mode
http://localhost:8080/v1/completions Text completions Server mode
http://localhost:8080/v1/embeddings Generate embeddings --embedding flag
http://localhost:8080/health Health check Server mode

Critical Detail: All OpenAI-compatible endpoints require /v1 prefix in the URL path.

Installation

Download Llamafile Binary

# Download llamafile v0.9.3 binary
curl -L -o llamafile https://github.com/mozilla-ai/llamafile/releases/download/0.9.3/llamafile-0.9.3

# Make executable
chmod 755 llamafile

# Verify version
./llamafile --version

Alternative download sources:

  • GitHub Release: https://github.com/mozilla-ai/llamafile/releases/download/0.9.3/llamafile-0.9.3
  • SourceForge Mirror: https://sourceforge.net/projects/llamafile.mirror/files/0.9.3/

Download GGUF Model

Llamafile requires GGUF format models. Download from Hugging Face:

# Recommended: Gemma 3 3B (balanced speed/quality, ~2GB)
curl -L -o gemma-3-3b.gguf \
  https://huggingface.co/Mozilla/gemma-3-3b-it-gguf/resolve/main/gemma-3-3b-it-Q4_K_M.gguf

# Alternative: Pre-packaged llamafile with embedded model
curl -LO https://huggingface.co/Mozilla/llava-v1.5-7b-llamafile/resolve/main/llava-v1.5-7b-q4.llamafile
chmod +x llava-v1.5-7b-q4.llamafile

Recommended models by use case:

Model Size Use Case Download
Gemma 3 3B ~2GB Balanced speed/quality Mozilla/gemma-3-3b-it-gguf
Qwen3-0.6B ~500MB Fast, lower quality Mozilla/Qwen3-0.6B-gguf
Mistral 7B ~4GB Higher quality, slower Mozilla/Mistral-7B-gguf
Llama 3.1 8B ~5GB Best quality, slowest Mozilla/Llama-3.1-8B-gguf

Quantization recommendation: Use Q4_K_M quantized models for optimal balance of quality and performance.

Server Configuration

Basic Server Command

Start llamafile server for local API access:

./llamafile --server \
    -m /path/to/model.gguf \
    --nobrowser \
    --port 8080 \
    --host 127.0.0.1

Critical flags explained:

  • --server: Required to enable HTTP API endpoints
  • -m: Path to GGUF model file (required)
  • --nobrowser: Prevents auto-opening browser on startup
  • --port 8080: Default port (note: NOT 8000)
  • --host 127.0.0.1: Localhost only (secure default)

Performance-Optimized Configuration

For GPU-accelerated inference with higher throughput:

./llamafile --server \
    -m /path/to/model.gguf \
    --nobrowser \
    --port 8080 \
    --host 127.0.0.1 \
    --ctx-size 4096 \
    --n-gpu-layers 99 \
    --threads 8 \
    --cont-batching \
    --parallel 4

Advanced flags:

Flag Purpose Default When to Use
--ctx-size Prompt context window size 512 Increase for longer conversations
--n-gpu-layers GPU offload layer count 0 Set to 99 to offload all layers to GPU
--threads CPU threads for generation Auto Set explicitly for consistent performance
--threads-batch Threads for batc
Полный SKILL.md на GitHub

Установить llamafile в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл llamafile?

When setting up local LLM inference without cloud APIs. When running GGUF models locally. When needing OpenAI-compatible API from a local model. When building offline/air-gapped AI tools. When troubleshooting local LLM server connections.

Как установить скилл llamafile?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл llamafile запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить llamafile с