# llms.py

> Self-hosted, open-source alternative to ChatGPT, OpenRouter and Open WebUI: one gateway with CLI, API and web UI for text, image and audio across 530+ models.

- **Category:** AI Chat
- **Licence:** BSD-3-Clause
- **Latest version:** v4.0.26
- **Open source:** oss
- **Languages:** JavaScript, Python
- **Platforms:** Docker, Docker Compose, pip
- **Tags:** Analytics, CLI, Mcp, Agents, Rag, Image Generation, Ollama, Text To Speech, Multi provider, Lm studio, Openai compatible api, Llm gateway, Local models, Chat Ui

## Description

llms.py is a lightweight LLM gateway you run on your own hardware: it acts as a command-line tool, an OpenAI-compatible HTTP server and a ChatGPT-style browser UI sitting in front of many model providers. Requests are routed to more than 530 models across 24 providers (definitions come from models.dev), with automatic failover and cost-ordered routing, while local back-ends such as Ollama and LM Studio work without keys. The web app adds project workspaces with a file explorer and Git diff review, agent profiles, outbound MCP tool connections, PDF Studio, Decision Studio, Gemini-powered RAG file stores, microphone voice input, image and speech generation, handcrafted themes with dark mode, and cost/token analytics. A credentials extension provides sign-in, registration, roles and account locking for multi-user installs, with GitHub OAuth as an alternative; data is kept locally. Operator options are the llms-py pip package, the ghcr.io container image via Docker or Compose, a one-line install script that wraps Docker, or native desktop builds for macOS, Windows and Linux.

## Links

- [Homepage](https://github.com/servicestack/llms)
- [Website](https://llmspy.org)
- [Docker](ghcr.io/servicestack/llms)
- [Documentation](https://llmspy.org/docs)
- [llms-py PyPI Package](https://pypi.org/project/llms-py/)
- [Public Gallery](https://ai.llmspy.org/m)

---
Source: https://selfhost.directory/project/llms