oobabooga/textgen
Local LLM desktop app with switchable inference backends and compatible APIs
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
TextGen brings a desktop chat client, browser UI, and API together around a Python application launched through server.py. Portable releases bundle Electron for the desktop window; their inference path uses llama.cpp with GGUF weights discovered in user_data/models. The full installation adds loader choices such as Transformers and ExLlamaV3; the manual full-install path uses Conda and hardware-specific PyTorch and loader dependencies. Models and loaders can be switched without restarting the application.
The conversation layer formats prompts with Jinja2 templates for instruction-following or character chat. With --api enabled, external clients can use OpenAI-compatible Chat and Completions endpoints or an Anthropic-compatible Messages endpoint against local inference. Tool calling can invoke built-in tools, custom functions packaged as individual Python files, or MCP servers, making tool execution a separate trust decision from loading model weights.
Key Capabilities & Differentiators
TextGen supports instruction and character chat, editable messages with version navigation, conversation branching, and a free-form Notebook. Compatible vision models can interpret attached images, while text, PDF, and DOCX attachments let users discuss document contents. Chat and API workflows can use tool calling; available tools include web search, page fetching, and math.
The loader lineup includes llama.cpp, ik_llama.cpp, Transformers, ExLlamaV3, and TensorRT-LLM. GGUF models can be placed directly in user_data/models; multi-file Transformers and EXL3 models go in individual subdirectories and require the full installation. The full path also supports resumable LoRA fine-tuning on multi-turn chats or raw text and a separate diffusers image-generation tab with 4-bit and 8-bit quantization and a persistent gallery.
Trade-offs & Limitations
Compared with ChatGPT and the OpenAI API, TextGen gives operators control over weights, quantization, context, and where inference runs, but shifts capacity planning and maintenance onto the host. Size against the selected quantization, target context and concurrency, not just the weight file. KV cache and runtime overhead need headroom; GPU offload and cache quantization can change the fit, but their performance impact should be tested on the intended hardware.
The portable GGUF path is the simplest to maintain; the full install adds training, image generation, and loaders at the cost of PyTorch and more hardware-specific dependencies. Local inference can run offline without telemetry, but web search and page fetching make outbound requests, and MCP servers and extensions should be reviewed before use. API compatibility helps with client migration but does not guarantee hosted-service feature parity. AGPL-3.0 obligations also matter when modifying or redistributing the application.
Hardware & Deployment Guide
For desktop use, pick a portable build for Linux, Windows, or macOS and the appropriate hardware option: CUDA, Vulkan, ROCm, or CPU-only, as available for the platform. Unpack it, put a GGUF in user_data/models, and launch textgen or textgen.bat. Add --model to user_data/CMD_FLAGS.txt to load a model at startup. The full one-click installer uses Miniforge and Conda under installer_files/ and serves the browser UI at http://127.0.0.1:7860.
For service deployments, --listen or --nowebui skips the Electron window in portable releases, and --api enables API access. Docker Compose 2.17+ configurations are provided under docker/ for NVIDIA, AMD, Intel, and CPU-only targets. Keep local use on loopback and control access before exposing the service. Release v4.7.3 introduced bundled Electron, v4.8 revised the chat composer, and v4.9 introduced draft-mtp, automatically enabled for MTP GGUFs.
server.py is the direct server entry point.draft-mtp and enables it automatically for MTP GGUFs.Individuals and teams that want local chat or API inference, control over model weights, and the option to start with GGUF before adding other loaders or training.
You want managed inference without maintaining hardware or model files, require exact hosted-API parity, or cannot meet AGPL-3.0 obligations for your deployment.
Quick Start & Installation
# Clone repository git clone https://github.com/oobabooga/textgen cd textgen # Create virtual environment python -m venv venv # Activate virtual environment # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate # Install dependencies (choose appropriate file under requirements/portable for your hardware) pip install -r requirements/portable/requirements.txt --upgrade # Launch server (basic command) python server.py --portable --api --auto-launch # When done working, deactivate deactivate
Comparison vs. Top Chat UI & AI Apps Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| textgen ★ | 47.8k | +22 | Python | AGPL-3.0 | Local LLM desktop app with switchable inference backends and compatible APIs |
| ODS | 8k | +88 | Python | Apache-2.0 | A Docker Compose stack for private AI chat and inference on your own hardware |
| cherry-studio | 54.1k | +204 | TypeScript | AGPL-3.0 | Electron AI workspace for comparing cloud and local models, running agents, and |
| jan | 46.4k | +139 | Rust | — | Tauri desktop chat with local LLM inference and an OpenAI-compatible API |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/oobabooga/textgen.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about textgen
How do I connect an existing OpenAI or Anthropic client?
--api and point the client at your TextGen instance. Chat, Completions, and Messages are supported, including tool calling. Check that your client can override its base URL, and test the endpoint and tool-call format you actually use. Compatibility does not mean that every hosted SDK feature or model behavior carries over.How should I size VRAM, RAM, and disk for a local deployment?
--gpu-layers, --ctx-size, and --cache-type expose the main placement and cache decisions. A 16 GB GPU is a sizing constraint, not a blanket compatibility guarantee; the full PyTorch installation also needs roughly 10 GB of disk before budgeting for model files.Can a company use TextGen internally or expose it as a service?
When is TextGen a better fit than ChatGPT or the OpenAI API?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy