vortico/flama
The production framework for Predictive and Generative AI. Serve any model as an API in one line, with OpenAI/Anthropic/Ollama-compatible endpoints, a built-in chat UI, and native MCP.
296 ★17 forksPythonUpdated 6d ago
What you need to know
Production framework for Predictive and Generative AI that packages a model from any mainstream framework (scikit-learn, TensorFlow, PyTorch, LLMs) into a single portable .flm artifact and serves it over HTTP in seconds, with first-class native MCP support for exposing tools to AI agents.
Install
pip install flama pip install "flama[pydantic]" pip install "flama[database]" pip install "flama[llm]" pip install "flama[full]"
Usage
- •flama get --family llm --source huggingface mlx-community/gemma-4-E2B-it-qat-4bit # download & package a HuggingFace model
- •echo "What is Flama?" | flama model mlx-community_gemma-4-E2B-it-qat-4bit.flm stream --system "Be concise."
- •flama serve --model file=model.flm,url=/,name=gemma # serves HTTP API + streaming chat UI at /chat/
- •Serve multiple wire protocols simultaneously: native (/query/, /stream/, /chat/), OpenAI (/openai/v1/chat/completions), Anthropic (/anthropic/v1/messages), Ollama (/ollama/api/chat)
- •@app.mcp.tool decorator exposes a Python function as an MCP tool; JSON Schema derived from type hints
Key features
- ✓Any framework, one format: package scikit-learn, TensorFlow, PyTorch, or an LLM into a portable .flm artifact
- ✓Models on demand: download and package any model from HuggingFace Hub with one command
- ✓Every served model ships a streaming chat UI at /chat/ with Markdown, LaTeX, and Mermaid
- ✓Native first-class MCP: tools, resources, and prompts exposed via a single decorator, schemas derived from type hints
- ✓Same .flm file runs on vLLM (Linux with CUDA) or MLX (Apple Silicon), backend selected at load time
- ✓Full-featured API framework: CRUD resources over SQLAlchemy, dependency injection, auto OpenAPI/Swagger/ReDoc, SSE and NDJSON streaming, JWT auth
Best for
Turning any ML/LLM model into a production HTTP API with a built-in chat UI and MCP tools in a few commands.
Platforms: Linux · macOS · WindowsClients: Claude · Cursor · VS Code Copilot
Documentation ↗Reviewed 2026-08-07
Topics
anthropicasgichatbotdomain-driven-designgenerative-aiinferencellmllm-servingmachine-learningmcpmlopsmlxmodel-context-protocolmodel-servingollamaopenai-apipythonrustvllmweb-framework
- Stars
- 296★
- Forks
- 17
- Language
- Python
- License
- Apache-2.0
- Created
- 2018-09-27
- Last push
- 2026-08-01