Skip to content

✨ feat(tasks): add LlamaFarm to local-apps#1950

Open
rgthelen wants to merge 4 commits intohuggingface:mainfrom
rgthelen:chore/add-llamafarm
Open

✨ feat(tasks): add LlamaFarm to local-apps#1950
rgthelen wants to merge 4 commits intohuggingface:mainfrom
rgthelen:chore/add-llamafarm

Conversation

@rgthelen
Copy link
Contributor

@rgthelen rgthelen commented Jan 30, 2026

PR Description

Summary

Adds LlamaFarm to the local apps list, enabling HuggingFace users to run models locally with LlamaFarm's config-based ML workflows.

What is LlamaFarm?

LlamaFarm is an open-source AI platform that runs entirely on local hardware. It combines model inference with specialized ML capabilities — all in one local runtime.

Supported Model Categories

Category Examples
Text Generation Llama3, Mistral, Qwen3 Phi, GPT-OSS
Embeddings sentence-transformers, BGE, nomic-embed
Audio Whisper, Wav2Vec2
Document/OCR LayoutLM, Donut, Surya

Built-in ML Capabilities (beyond model inference)

Capability Description
Text Classification Train custom classifiers with 8-16 examples (SetFit)
Anomaly Detection Isolation Forest, One-Class SVM, LOF, Autoencoders
Named Entity Recognition Extract people, organizations, locations
OCR & Document Extraction Surya, EasyOCR, PaddleOCR, Tesseract
Reranking Cross-encoder models for improved RAG quality
RAG Pipeline Full ingestion, chunking, retrieval, and querying

Key features:

  • 🔒 Complete privacy — data never leaves the device
  • 💰 No API costs — uses open-source models
  • 🌐 Offline capable — works without internet after model download
  • ⚡ Hardware optimized — automatic GPU/NPU acceleration (Apple Silicon, NVIDIA, AMD)
  • 📦 GGUF support — runs quantized models via llama.cpp
  • 🧠 Built-in ML — anomaly detection, classifiers, NER without external services

Installation Methods

  • CLI: curl -fsSL https://raw.githubusercontent.com/llama-farm/llamafarm/main/install.sh | bash
  • Desktop App: Available for macOS, Windows, and Linux

Links


Code Changes

File: packages/tasks/src/local-apps.ts

1. Add snippet function (after snippetLemonade):

const snippetLlamaFarm = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
	const modelId = model.id;
	const isGguf = isLlamaCppGgufModel(model);
	const tagName = isGguf ? getQuantTag(filepath) : "";

	// Determine model type hint for better UX
	const getModelTypeHint = (): string => {
		if (model.pipeline_tag === "automatic-speech-recognition") {
			return "# Transcribe audio:";
		}
		if (model.pipeline_tag === "feature-extraction" || model.pipeline_tag === "sentence-similarity") {
			return "# Generate embeddings:";
		}
		return "# Chat with this model:";
	};

	return [
		{
			title: "Install LlamaFarm CLI (config-based ML workflows)",
			setup: [
				"# 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",
			].join("\n"),
			content: [
				"# Initialize a project:",
				"lf init my-project",
				"lf start",
				"",
				getModelTypeHint(),
				`lf chat --model ${modelId}${tagName} "Hello!"`,
				"",
				"# Or open the visual designer:",
				"# http://localhost:8000",
			].join("\n"),
		},
		{
			title: "Or download the Desktop App (no CLI required)",
			setup: "# Download from GitHub releases:",
			content: [
				"# macOS (Universal):",
				"# https://github.com/llama-farm/llamafarm/releases/latest/download/LlamaFarm-desktop-app-mac-universal.dmg",
				"#",
				"# Windows:",
				"# https://github.com/llama-farm/llamafarm/releases/latest/download/LlamaFarm-desktop-app-windows.exe",
				"#",
				"# Linux (x86_64):",
				"# https://github.com/llama-farm/llamafarm/releases/latest/download/LlamaFarm-desktop-app-linux-x86_64.AppImage",
				"#",
				"# Linux (ARM64):",
				"# https://github.com/llama-farm/llamafarm/releases/latest/download/LlamaFarm-desktop-app-linux-arm64.AppImage",
			].join("\n"),
		},
		{
			title: "Built-in ML capabilities (beyond model inference)",
			content: [
				"# In addition to inference, LlamaFarm includes specialized ML features:",
				"#",
				"# • Text Classification — Train classifiers with 8-16 examples (SetFit)",
				"# • Anomaly Detection — Isolation Forest, One-Class SVM, LOF, Autoencoders",
				"# • Named Entity Recognition — Extract people, orgs, locations",
				"# • OCR & Document Extraction — Surya, EasyOCR, PaddleOCR",
				"# • Reranking — Cross-encoders for better RAG retrieval",
				"# • Full RAG Pipeline — Ingest PDFs/docs, chunk, embed, query",
				"#",
				"# See: https://docs.llamafarm.dev/docs/models",
			].join("\n"),
		},
	];
};

2. Add to LOCAL_APPS object (alphabetically, after lemonade):

llamafarm: {
	prettyLabel: "LlamaFarm",
	docsUrl: "https://llamafarm.dev",
	mainTask: "text-generation",
	displayOnModelPage: (model) =>
		// Text generation (GGUF, Transformers, TGI)
		isLlamaCppGgufModel(model) ||
		isTransformersModel(model) ||
		model.pipeline_tag === "text-generation" ||
		// Embeddings
		model.pipeline_tag === "feature-extraction" ||
		model.pipeline_tag === "sentence-similarity" ||
		// Audio models
		model.pipeline_tag === "automatic-speech-recognition" ||
		model.pipeline_tag === "audio-classification" ||
		// NLP tasks (NER, classification)
		model.pipeline_tag === "token-classification" ||
		model.pipeline_tag === "text-classification" ||
		// Document understanding
		model.pipeline_tag === "document-question-answering",
	snippet: snippetLlamaFarm,
},

Testing

Tested snippet generation for various model types:

  • GGUF models (e.g., qwen/qwen3-8b-gguf)
  • Transformers text models (e.g., microsoft/phi-2)
  • Embedding models (e.g., sentence-transformers/all-MiniLM-L6-v2)
  • ASR models (e.g., openai/whisper-large-v3)

Checklist

  • Code follows the existing patterns in local-apps.ts
  • Snippet function returns LocalAppSnippet[]
  • displayOnModelPage covers all supported model types
  • Documentation links are valid
  • No breaking changes to existing apps

@rgthelen
Copy link
Contributor Author

rgthelen commented Feb 2, 2026

The test failures are due to test issues, not this PR. Please review #1955; it fixes the test failures (the failures were due to a vLLM task update, but the tests were not updated, and some stale API specs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants