llamafarm

llama-farmApache-2.0更新放缓

几分钟内就能在本地或远程部署任意 AI 模型、智能体、数据库、RAG 和流水线,省去繁琐的环境配置和运维工作。

Deploy any AI model, agent, database, RAG, and pipeline locally or remotely in minutes

v0.0.34发布于 2026-05-22 01:49 UTC836star59fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
curl -fsSL https://raw.githubusercontent.com/llama-farm/llamafarm/main/install.sh | bash
lf init my-project
lf start
硬件要求按 README 说明

README 未说明具体显存要求;支持 Apple Silicon、NVIDIA、AMD 的 GPU/NPU 自动加速,Ollama 可跑 CPU/GPU,模型下载后可离线使用。

支持 Apple Silicon
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

本地跑 RAG、分类、OCR 和异常检测的开源 AI 平台,数据不出设备

几分钟内就能在本地或远程部署任意 AI 模型、智能体、数据库、RAG 和流水线,省去繁琐的环境配置和运维工作。

核心能力

  • 用 llamafarm.yaml 统一配置项目与运行时
  • 内置 RAG 流水线,支持 PDF、DOCX、Markdown 上传与语义检索
  • Universal Runtime 提供嵌入、OCR、重排与异常检测
  • 支持 Ollama、OpenAI 兼容接口和本地 GGUF 多模型切换
  • 通过 MCP 让模型调用外部工具

容易踩的坑

从源码开发需先全局安装 Nx 并执行 nx init,且三个服务要分别启动;服务默认占用 14345 和 11540 端口;离线使用前需先下载模型。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.0.34
  1. v0.0.34最新正式版2026-05-22 · 2026-05-22 01:49 UTC

    0.0.34 (2026-05-21)

    Features

    • ci: add Linux ARM64 CUDA build profiles (#837) (571c4ef)

    Miscellaneous Chores

    Desktop App Downloads

    macOS (Apple Silicon only)

    Download for Apple Silicon (M1+) Macs:

    • Apple Silicon (arm64): LlamaFarm-desktop-app-mac-arm64.dmg or .zip

    Installation:

    1. Download the DMG or ZIP file
    2. Open the DMG and drag LlamaFarm to Applications (or extract the ZIP)
    3. Launch the app (it's signed and notarized, so it will open normally)
    4. The app will auto-install the CLI and start services

    Linux

    Download the appropriate package for your Linux distribution:

    • AppImage (Universal): LlamaFarm-desktop-app-linux.AppImage
    • Debian/Ubuntu: LlamaFarm-desktop-app-linux.deb

    Installation:

    # AppImage (works on all distributions)
    chmod +x LlamaFarm-desktop-app-linux.AppImage
    ./LlamaFarm-desktop-app-linux.AppImage
    
    # Debian/Ubuntu
    sudo dpkg -i LlamaFarm-desktop-app-linux.deb
    

    Windows

    Download the Windows installer:

    • Windows Installer: LlamaFarm-desktop-app-windows.exe

    Installation:

    1. Download the installer
    2. Run the installer (it will install to your user directory)
    3. Launch LlamaFarm from the Start Menu
    4. The app will auto-install the CLI and start services

    Auto-Updates

    Once installed, the app will automatically check for updates and prompt you to install them.

  2. v0.0.332026-05-14 · 2026-05-14 19:13 UTC
    查看更新说明

    0.0.33 (2026-05-14)

    Features

    • cli,runtime: bundle llama.cpp binaries in release artifacts (#829) (17c4a26)
    • cli: wire Linux x86_64 CUDA artifacts in llamabinary resolver (c5fe799)
    • runtime: build and host Linux x86_64 CUDA llama.cpp binaries (091c637)
    • runtime: build and host Linux x86_64 CUDA llama.cpp binaries (#834) (c4d0d56)

    Bug Fixes

    • ci: use pinned CUDA 13.0.2 devel image tag (ee5e9ae)
    • common: guard detect_model_format HF fallback in offline mode (#831) (aa39031)
    • edge: surface backend-init state on local/llm/status (#830) (c697ff8)
    • rag: filter empty chunks before embedding to prevent ingestion f… (#835) (cb72dd4)
    • runtime,cli: forward-fall-back cuda13 to cuda12 when no cuda13 artifact (09b0835)
    • runtime: address PR review feedback for CUDA binary support (98304f0)
    • runtime: pick a LlamaFarm release that actually ships the wanted asset (ef05083)

    Miscellaneous Chores

    Desktop App Downloads

    macOS (Apple Silicon only)

    Download for Apple Silicon (M1+) Macs:

    • Apple Silicon (arm64): LlamaFarm-desktop-app-mac-arm64.dmg or .zip

    Installation:

    1. Download the DMG or ZIP file
    2. Open the DMG and drag LlamaFarm to Applications (or extract the ZIP)
    3. Launch the app (it's signed and notarized, so it will open normally)
    4. The app will auto-install the CLI and start services

    Linux

    Download the appropriate package for your Linux distribution:

    • AppImage (Universal): LlamaFarm-desktop-app-linux.AppImage
    • Debian/Ubuntu: LlamaFarm-desktop-app-linux.deb

    Installation:

    # AppImage (works on all distributions)
    chmod +x LlamaFarm-desktop-app-linux.AppImage
    ./LlamaFarm-desktop-app-linux.AppImage
    
    # Debian/Ubuntu
    sudo dpkg -i LlamaFarm-desktop-app-linux.deb
    

    Windows

    Download the Windows installer:

    • Windows Installer: LlamaFarm-desktop-app-windows.exe

    Installation:

    1. Download the installer
    2. Run the installer (it will install to your user directory)
    3. Launch LlamaFarm from the Start Menu
    4. The app will auto-install the CLI and start services

    Auto-Updates

    Once installed, the app will automatically check for updates and prompt you to install them.

  3. v0.0.322026-04-28 · 2026-04-28 17:28 UTC
    查看更新说明

    0.0.32 (2026-04-28)

    Features

    Bug Fixes

    • edge: harden chat completions error handling (ROW-79) (#823) (f4634c6)
    • llamafarm-llama: prepend BOS in create_chat_completion (#821) (0ab0d4a)
    • runtime: harden context summarizer and truncation in offline mode (#825) (2d22d36)

    Miscellaneous Chores

    Desktop App Downloads

    macOS (Apple Silicon only)

    Download for Apple Silicon (M1+) Macs:

    • Apple Silicon (arm64): LlamaFarm-desktop-app-mac-arm64.dmg or .zip

    Installation:

    1. Download the DMG or ZIP file
    2. Open the DMG and drag LlamaFarm to Applications (or extract the ZIP)
    3. Launch the app (it's signed and notarized, so it will open normally)
    4. The app will auto-install the CLI and start services

    Linux

    Download the appropriate package for your Linux distribution:

    • AppImage (Universal): LlamaFarm-desktop-app-linux.AppImage
    • Debian/Ubuntu: LlamaFarm-desktop-app-linux.deb

    Installation:

    # AppImage (works on all distributions)
    chmod +x LlamaFarm-desktop-app-linux.AppImage
    ./LlamaFarm-desktop-app-linux.AppImage
    
    # Debian/Ubuntu
    sudo dpkg -i LlamaFarm-desktop-app-linux.deb
    

    Windows

    Download the Windows installer:

    • Windows Installer: LlamaFarm-desktop-app-windows.exe

    Installation:

    1. Download the installer
    2. Run the installer (it will install to your user directory)
    3. Launch LlamaFarm from the Start Menu
    4. The app will auto-install the CLI and start services

    Auto-Updates

    Once installed, the app will automatically check for updates and prompt you to install them.

  4. v0.0.312026-04-17 · 2026-04-17 14:40 UTC
    查看更新说明

    0.0.31 (2026-04-17)

    Features

    • ci: add ref input to docker build workflow (2f83127)

    Bug Fixes

    • ci: preserve multi-arch manifest when retagging release images (97361a1)
    • ci: use checked-out SHA for docker image tags, not workflow SHA (614b808)
    • ci: use checked-out SHA for docker image tags, not workflow SHA (1e41756)
    • cli: recurse into subdirectories when scanning HF cache for GGUFs (#814) (ffbd3f7)
    • edge: resolve model format from local dir before HF API (#817) (e9f89ec)
    • llamafarm-llama: fetch model chat template + prepend BOS in raw completions (#820) (2dd8278)
    • llamafarm-llama: honor temperature=0 as greedy, wire up repeat_penalty (#818) (eb25906)
    • llamafarm-llama: restore fixes lost in merge + add regression tests (1e58071)

    Desktop App Downloads

    macOS (Apple Silicon only)

    Download for Apple Silicon (M1+) Macs:

    • Apple Silicon (arm64): LlamaFarm-desktop-app-mac-arm64.dmg or .zip

    Installation:

    1. Download the DMG or ZIP file
    2. Open the DMG and drag LlamaFarm to Applications (or extract the ZIP)
    3. Launch the app (it's signed and notarized, so it will open normally)
    4. The app will auto-install the CLI and start services

    Linux

    Download the appropriate package for your Linux distribution:

    • AppImage (Universal): LlamaFarm-desktop-app-linux.AppImage
    • Debian/Ubuntu: LlamaFarm-desktop-app-linux.deb

    Installation:

    # AppImage (works on all distributions)
    chmod +x LlamaFarm-desktop-app-linux.AppImage
    ./LlamaFarm-desktop-app-linux.AppImage
    
    # Debian/Ubuntu
    sudo dpkg -i LlamaFarm-desktop-app-linux.deb
    

    Windows

    Download the Windows installer:

    • Windows Installer: LlamaFarm-desktop-app-windows.exe

    Installation:

    1. Download the installer
    2. Run the installer (it will install to your user directory)
    3. Launch LlamaFarm from the Start Menu
    4. The app will auto-install the CLI and start services

    Auto-Updates

    Once installed, the app will automatically check for updates and prompt you to install them.

  5. v0.0.302026-04-09 · 2026-04-09 03:18 UTC
    查看更新说明

    0.0.30 (2026-04-09)

    Features

    • cli: native lf models commands without server boot (#810) (9b4b996)

    Miscellaneous Chores

    Desktop App Downloads

    macOS (Apple Silicon only)

    Download for Apple Silicon (M1+) Macs:

    • Apple Silicon (arm64): LlamaFarm-desktop-app-mac-arm64.dmg or .zip

    Installation:

    1. Download the DMG or ZIP file
    2. Open the DMG and drag LlamaFarm to Applications (or extract the ZIP)
    3. Launch the app (it's signed and notarized, so it will open normally)
    4. The app will auto-install the CLI and start services

    Linux

    Download the appropriate package for your Linux distribution:

    • AppImage (Universal): LlamaFarm-desktop-app-linux.AppImage
    • Debian/Ubuntu: LlamaFarm-desktop-app-linux.deb

    Installation:

    # AppImage (works on all distributions)
    chmod +x LlamaFarm-desktop-app-linux.AppImage
    ./LlamaFarm-desktop-app-linux.AppImage
    
    # Debian/Ubuntu
    sudo dpkg -i LlamaFarm-desktop-app-linux.deb
    

    Windows

    Download the Windows installer:

    • Windows Installer: LlamaFarm-desktop-app-windows.exe

    Installation:

    1. Download the installer
    2. Run the installer (it will install to your user directory)
    3. Launch LlamaFarm from the Start Menu
    4. The app will auto-install the CLI and start services

    Auto-Updates

    Once installed, the app will automatically check for updates and prompt you to install them.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    LlamaFarm - Edge AI for Everyone

    Enterprise AI capabilities on your own hardware. No cloud required.

    License: Apache 2.0 Python 3.10+ Go 1.24+ Docs Discord

    LlamaFarm is an open-source AI platform that runs entirely on your hardware. Build RAG applications, train custom classifiers, detect anomalies, and run document processing—all locally with complete privacy.

    • 🔒 Complete Privacy — Your data never leaves your device
    • 💰 No API Costs — Use open-source models without per-token fees
    • 🌐 Offline Capable — Works without internet once models are downloaded
    • ⚡ Hardware Optimized — Automatic GPU/NPU acceleration on Apple Silicon, NVIDIA, and AMD

    Desktop App Downloads

    Get started instantly — no command line required:

    PlatformDownload
    Mac (Universal)Download
    WindowsDownload
    Linux (x86_64)Download
    Linux (ARM64)Download

    What Can You Build?

    CapabilityDescription
    RAG (Retrieval-Augmented Generation)Ingest PDFs, docs, CSVs and query them with AI
    Custom ClassifiersTrain text classifiers with 8-16 examples using SetFit
    Anomaly Detection12+ algorithms for batch and streaming anomaly detection
    Tool Calling (MCP)Connect models to external tools via Model Context Protocol
    OCR & Document ExtractionExtract text and structured data from images and PDFs
    Named Entity RecognitionFind people, organizations, and locations
    Multi-Model RuntimeSwitch between Ollama, OpenAI, vLLM, or local GGUF models

    Video demo (90 seconds): https://youtu.be/W7MHGyN0MdQ


    Quickstart

    Option 1: Desktop App

    Download the desktop app above and run it. No additional setup required.

    Option 2: CLI + Development Mode

    1. Install the CLI

      macOS / Linux:

      curl -fsSL https://raw.githubusercontent.com/llama-farm/llamafarm/main/install.sh | bash
      

      Windows (PowerShell):

      irm https://raw.githubusercontent.com/llama-farm/llamafarm/main/install.ps1 | iex
      

      Or download directly from releases.

    2. Create and run a project

      lf init my-project      # Generates llamafarm.yaml
      lf start                # Starts services and opens Designer UI
      
    3. Chat with your AI

      lf chat                           # Interactive chat
      lf chat "Hello, LlamaFarm!"       # One-off message
      

    The Designer web interface is available at http://localhost:14345.

    Option 3: Development from Source

    git clone https://github.com/llama-farm/llamafarm.git
    cd llamafarm
    
    # Install Nx globally and initialize the workspace
    npm install -g nx
    nx init --useDotNxInstallation --interactive=false  # Required on first clone
    
    # Start all services (run each in a separate terminal)
    nx start server           # FastAPI server (port 14345)
    nx start rag              # RAG worker for document processing
    nx start universal-runtime # ML models, OCR, embeddings (port 11540)
    

    Architecture

    LlamaFarm consists of three main services:

    ServicePortPurpose
    Server14345FastAPI REST API, Designer web UI, project management
    RAG Worker-Celery worker for async document processing
    Universal Runtime11540ML model inference, embeddings, OCR, anomaly detection

    All configuration lives in llamafarm.yaml—no scattered settings or hidden defaults.


    Runtime Options

    Universal Runtime (Recommended)

    The Universal Runtime provides access to HuggingFace models plus specialized ML capabilities:

    • Text Generation - Any HuggingFace text model
    • Embeddings - sentence-transformers and other embedding models
    • OCR - Text extraction from images/PDFs (Surya, EasyOCR, PaddleOCR, Tesseract)
    • Document Extraction - Forms, invoices, receipts via vision models
    • Text Classification - Pre-trained or custom models via SetFit
    • Named Entity Recognition - Extract people, organizations, locations
    • Reranking - Cross-encoder models for improved RAG quality
    • Anomaly Detection - Isolation Forest, One-Class SVM, Local Outlier Factor, Autoencoders
    runtime:
      models:
        default:
          provider: universal
          model: Qwen/Qwen2.5-1.5B-Instruct
          base_url: http://127.0.0.1:11540/v1
    

    Ollama

    Simple setup for GGUF models with CPU/GPU acceleration:

    runtime:
      models:
        default:
          provider: ollama
          model: qwen3:8b
          base_url: http://localhost:11434/v1
    

    OpenAI-Compatible

    Works with vLLM, Together, Mistral API, or any OpenAI-compatible endpoint:

    runtime:
      models:
        default:
          provider: openai
          model: gpt-4o
          base_url: https://api.openai.com/v1
          api_key: ${OPENAI_API_KEY}
    

    Core Workflows

    CLI Commands

    TaskCommand
    Initialize projectlf init my-project
    Start serviceslf start
    Interactive chatlf chat
    One-off messagelf chat "Your question"
    List modelslf models list
    Use specific modellf chat --model powerful "Question"
    Create datasetlf datasets create -s pdf_ingest -b main_db research
    Upload files (auto-process by default)lf datasets upload research ./docs/*.pdf
    Process dataset (if you skipped auto-process)lf datasets process research
    Query RAGlf rag query --database main_db "Your query"
    Check RAG healthlf rag health

    RAG Pipeline

    1. Create a dataset linked to a processing strategy and database
    2. Upload files (PDF, DOCX, Markdown, TXT) — processing runs automatically unless you pass --no-process
    3. Process manually only when you intentionally skipped auto-processing (e.g., large batches)
    4. Query using semantic search with optional metadata filtering
    lf datasets create -s default -b main_db research
    lf datasets upload research ./papers/*.pdf                 # auto-processes by default
    # For large batches:
    # lf datasets upload research ./papers/*.pdf --no-process
    # lf datasets process research
    lf rag query --database main_db "What are the key findings?"
    

    Designer Web UI

    The Designer at http://localhost:14345 provides:

    • Project management with briefs and quick actions
    • Visual dataset management with drag-and-drop uploads
    • Database & RAG configuration with built-in query testing
    • Prompt engineering with template variables and testing
    • Interactive chat with RAG toggle and retrieved context display
    • Config editor with syntax highlighting, validation, and auto-completion
    • Switch between visual Designer and raw YAML modes in any section

    See the Designer Features Guide for details.


    Configuration

    llamafarm.yaml is the source of truth for each project:

    version: v1
    name: my-assistant
    namespace: default
    
    # Multi-model configuration
    runtime:
      default_model: fast
    
      models:
        fast:
          description: "Fast local model"
          provider: universal
          model: Qwen/Qwen2.5-1.5B-Instruct
          base_url: http://127.0.0.1:11540/v1
    
        powerful:
          description: "More capable model"
          provider: universal
          model: Qwen/Qwen2.5-7B-Instruct
          base_url: http://127.0.0.1:11540/v1
    
    # System prompts
    prompts:
      - name: default
        messages:
          - role: system
            content: You are a helpful assistant.
    
    # RAG configuration
    rag:
      databases:
        - name: main_db
          type: ChromaStore
          default_embedding_strategy: default_embeddings
          default_retrieval_strategy: semantic_search
          embedding_strategies:
            - name: default_embeddings
              type: UniversalEmbedder
              config:
                model: sentence-transformers/all-MiniLM-L6-v2
                base_url: http://127.0.0.1:11540/v1
          retrieval_strategies:
            - name: semantic_search
              type: BasicSimilarityStrategy
              config:
                top_k: 5
    
      data_processing_strategies:
        - name: default
          parsers:
            - type: PDFParser_LlamaIndex
              config:
                chunk_size: 1000
                chunk_overlap: 100
            - type: MarkdownParser_Python
              config:
                chunk_size: 1000
          extractors: []
    
    # Dataset definitions
    datasets:
      - name: research
        data_processing_strategy: default
        database: main_db
    

    Environment Variable Substitution

    Use ${VAR} syntax to inject secrets from .env files:

    runtime:
      models:
        openai:
          api_key: ${OPENAI_API_KEY}
          # With default: ${OPENAI_API_KEY:-sk-default}
          # From specific file: ${file:.env.production:API_KEY}
    

    See the Configuration Guide for complete reference.


    REST API

    LlamaFarm provides an OpenAI-compatible REST API:

    Chat Completions

    curl -X POST http://localhost:14345/v1/projects/default/my-project/chat/completions \
      -H "Content-Type: application/json" \
      -d '{
        "messages": [{"role": "user", "content": "Hello"}],
        "stream": false,
        "rag_enabled": true
      }'
    

    RAG Query

    curl -X POST http://localhost:14345/v1/projects/default/my-project/rag/query \
      -H "Content-Type: application/json" \
      -d '{
        "query": "What are the requirements?",
        "database": "main_db",
        "top_k": 5
      }'
    

    See the API Reference for all endpoints.


    Specialized ML Capabilities

    The Universal Runtime provides endpoints beyond chat:

    OCR & Document Extraction

    curl -X POST http://localhost:14345/v1/vision/ocr \
      -F "[email protected]" \
      -F "model=surya"
    

    Anomaly Detection

    LlamaFarm supports 12+ anomaly detection algorithms via PyOD, with both batch and streaming modes.

    # Train on normal data
    curl -X POST http://localhost:14345/v1/ml/anomaly/fit \
      -H "Content-Type: application/json" \
      -d '{"model": "sensor-detector", "backend": "ecod", "data": [[22.1], [23.5], ...]}'
    
    # Detect anomalies
    curl -X POST http://localhost:14345/v1/ml/anomaly/detect \
      -H "Content-Type: application/json" \
      -d '{"model": "sensor-detector", "data": [[22.0], [100.0], [23.0]], "threshold": 0.5}'
    
    # Streaming detection (handles cold start, auto-retraining, sliding windows)
    curl -X POST http://localhost:14345/v1/ml/anomaly/stream \
      -H "Content-Type: application/json" \
      -d '{"model": "live-sensor", "data": {"temperature": 72.5}, "backend": "ecod"}'
    

    Available backends: ecod (recommended), isolation_forest, one_class_svm, local_outlier_factor, autoencoder, hbos, copod, knn, mcd, cblof, suod, loda

    Text Classification & NER

    See the Models Guide for complete documentation.

    Tool Calling (MCP)

    Give models access to external tools via the Model Context Protocol:

    # In llamafarm.yaml
    mcp:
      servers:
        - name: filesystem
          transport: stdio
          command: npx
          args: ['-y', '@modelcontextprotocol/server-filesystem', '/data']
    
    runtime:
      models:
        - name: assistant
          provider: ollama
          model: llama3.1:8b
          mcp_servers: [filesystem]
    

    LlamaFarm also exposes its own API as MCP tools for use with Claude Desktop, Cursor, and other MCP clients. See the Tool Calling Guide.


    Examples

    ExampleDescriptionLocation
    RAG Examples
    Large Complex PDFsMulti-megabyte planning ordinancesexamples/large_complex_rag/
    Many Small FilesFDA correspondence lettersexamples/many_small_file_rag/
    Mixed FormatsPDF, Markdown, HTML, text, and codeexamples/mixed_format_rag/
    Quick NotesRapid smoke tests with small filesexamples/quick_rag/
    Anomaly Detection
    Quick StartSimplest anomaly detection exampleexamples/anomaly/01_quick_start.py
    Fraud DetectionTraining, saving, loading modelsexamples/anomaly/02_fraud_detection.py
    Streaming SensorsIoT monitoring with rolling featuresexamples/anomaly/03_streaming_sensors.py
    Backend ComparisonCompare all 12 algorithmsexamples/anomaly/04_backend_comparison.py
    Use Cases
    FDA Letters AssistantRegulatory document analysisexamples/fda_rag/
    Government PlanningLarge ordinance documentsexamples/gov_rag/

    See examples/README.md for setup instructions and the full list.


    Industry Use Cases

    LlamaFarm is used across industries for document analysis, monitoring, and fraud detection:


    Development & Testing

    # Python server tests
    cd server && uv sync && uv run --group test python -m pytest
    
    # CLI tests
    cd cli && go test ./...
    
    # RAG tests
    cd rag && uv sync && uv run pytest tests/
    
    # Universal Runtime tests
    cd runtimes/universal && uv sync && uv run pytest tests/
    
    # Build docs
    nx build docs
    

    Extensibility

    • Add runtimes by implementing provider support and updating schema
    • Add vector stores by implementing store backends (Chroma, Qdrant, etc.)
    • Add parsers for new file formats (PDF, DOCX, HTML, CSV, etc.)
    • Add extractors for custom metadata extraction
    • Add CLI commands under cli/cmd/

    See the Extending Guide for step-by-step instructions.


    Community & Support


    License

    Licensed under the Apache 2.0 License. See CREDITS for acknowledgments.


    Build locally. Deploy anywhere. Own your AI.