Labsco
vortico logo

Flama

โ˜… 290

from vortico

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.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

Light up your models ๐Ÿ”ฅ

Flama

The production framework for Predictive and Generative AI.

Turn any model into a production API in a single line of code. Serve predictive and generative models on a Rust-powered core, and expose your tools to AI agents over the Model Context Protocol (MCP).

Flama is the Framework for Lightweight Applications, artificial intelligence Models, and Automation. It packages a model from any of the mainstream frameworks into a single portable format (the .flm file), so every model looks the same to your API no matter where it came from, and serves it over HTTP in seconds.

  • ๐Ÿ“ฆ Any framework, one format. Package scikit-learn, TensorFlow, PyTorch, or an LLM into a single portable .flm artifact.

  • โฌ‡๏ธ Models on demand. Download and package any model from the HuggingFace Hub with one command.

  • ๐Ÿค– Generative AI serving. Serve LLMs with OpenAI-, Anthropic-, and Ollama-compatible endpoints, side by side.

  • ๐Ÿ’ฌ Chatbot out of the box. Every served model ships a polished streaming chat UI at /chat/, with Markdown, LaTeX, and Mermaid.

  • ๐Ÿ”Œ Native MCP. Expose tools, resources, and prompts to AI agents with a single decorator, schemas derived from your type hints.

  • โšก Rust-powered core. Routing, JSON encoding, request parsing, and compression compiled to native code, shipped as plain wheels.

  • ๐Ÿš€ Production-ready first. Go from a packaged model to a running service over the CLI, in Python, with a spec file, or inside a container.

Expose tools to AI agents with MCP

Flama ships native, first-class support for the Model Context Protocol. Declare a capability with a single decorator, mount the server, and Flama derives the JSON Schema from your type hints and serves it over a stateless protocol:

Copy & paste โ€” that's it
from flama import Flama

app = Flama()
app.mcp.add_server("/mcp/tools/", "tools")

@app.mcp.tool("add", description="Add two integers", mcp="tools")
def add(a: int, b: int) -> int:
 return a + b

Any MCP-capable client (Claude, Cursor, VS Code Copilot, or a custom agent) can discover and invoke it. Tasks, Elicitation, and MCP Apps are included. Learn more in the MCP docs.

And a full-featured API framework

Flama is also a complete toolkit for building production APIs:

  • Resources with standard CRUD methods over SQLAlchemy tables.

  • Dependency injection via Components, the base of the plugin ecosystem.

  • Adaptable schemas with Pydantic, Typesystem, or Marshmallow, all optional extras.

  • Auto-generated OpenAPI schema plus Swagger UI and ReDoc.

  • Pagination, background tasks, lifespan events, and JWT authentication.

  • Streaming-first HTTP with Server-Sent Events and NDJSON responses.

  • Domain-Driven Design patterns: repositories, workers, and domain models.

  • flama upgrade codemods that rewrite imports and renamed symbols across major versions.

Examples

A curated, documentation-aligned set of runnable examples lives in vortico/flama-examples, covering fundamentals, the CLI, advanced topics, predictive AI, generative AI, and domain-driven design.

Documentation

Visit https://flama.dev/docs/ for the full documentation, including the quickstart and the CLI guide.

Use Flama with your AI assistant

Drop skill.md into your AI coding assistant and let it build Flama apps with full framework knowledge.

Authors

  • Josรฉ Antonio Perdiguero Lรณpez (@perdy)

  • Miguel Durรกn-Olivencia (@migduroli)

Contributing

This project is absolutely open to contributions, so if you have a nice idea, please read our contributing docs before submitting a pull request. Questions and ideas are welcome in GitHub Discussions.

Support

If you find Flama useful for building robust Machine Learning and Generative AI APIs, the best way to support our work is to give us a โญ on GitHub, it is the best fuel for our development efforts. You can also follow Vortico for updates.

Star History

License

Flama is released under the Apache 2.0 license.