Skip to content

Flama: a Python framework for development and deployment of production-ready APIs, machine learning, and LLM services

Aug 2026 · 0 citations
Computer Science

TL;DR

Flama is presented, an open-source Python framework for developing and deploying production-ready web APIs, machine learning services, and large-language-model (LLM) applications that unifies REST API development, predictive model serving, and generative AI inference in one architecture.

Abstract

We present Flama, an open-source Python framework for developing and deploying production-ready web APIs, machine learning services, and large-language-model (LLM) applications. Built on the Asynchronous Server Gateway Interface (ASGI), Flama offers a type-driven, async-first programming model that unifies REST API development, predictive model serving, and generative AI inference in one architecture. It is organised around seven subsystems: a component-based dependency injection system resolving handler parameters from type annotations at startup; a pluggable schema layer supporting Pydantic, Marshmallow and Typesystem behind a single adapter; an automatic CRUD generator turning a SQLAlchemy table and a schema class into REST endpoints backed by the Repository and Unit of Work patterns; a portable binary format (.flm) packaging models from scikit-learn, TensorFlow, PyTorch and Hugging Face Transformers with their metadata for zero-code deployment; a multi-backend LLM server running vLLM (Linux/CUDA) or MLX (Apple Silicon) and exposing four wire protocols (OpenAI, Anthropic, Ollama, and a native streaming dialect) through a shared codec; a Rust-accelerated core compiled via Maturin for routing, JSON encoding, compression and parsing; and a Model Context Protocol module turning any application into an MCP server over JSON-RPC 2.0. Built-in capabilities include JWT authentication, two pagination strategies, background tasks in threads or processes, WebSocket endpoints, Server-Sent Event and NDJSON streaming, OpenAPI 3.2.0 generation from handler signatures, and a command-line interface for running applications and for serving, packaging and inspecting models. We describe the architecture, present the programming model through worked examples, and compare Flama with existing frameworks, model serving platforms and LLM inference engines.

View source

Similar papers

Preprint Aug 2026

Evolving Executable Pipeline Programs for AutoML with Language Models

This work presents LACE, an AutoML framework that instead searches over complete executable pipeline programs: an evolutionary loop maintains a population of scikit-learn-compatible Python classes, and a large language model acts as the variation operator.

Sofoklis Kitharidis, C. Veenman, J. V. van Rijn et al. · 0 citations
Open access Mar 2026

UVLM: A Universal Vision-Language Model Loader for Reproducible Multimodal Benchmarking

UVLM (Unified Vision–Language Model), a pip-installable Python package that provides a unified interface for loading, configuring, and running multiple VLM architectures on custom image analysis tasks, is introduced.

Joan Perez, Giovanni Fusco · 0 citations
Preprint Jul 2026

An MLIR-Based Compilation Method for Large Language Models

An MLIR (Multi-Level Intermediate Representation) based compilation method for large language models, illustrated using two dialects of operators, TopOp and TpuOp, supporting a variety of generative models including the Qwen, Llama, InternVL, and MiniCPM-V series.

Pengchao Hu, Zhibin Xin, Yifan Chen et al. · 0 citations
Preprint Aug 2026

Conjunctive Poisoning in AI Supply-Chain Applications

This work shows that a malicious developer can pair a benign-looking wrapper with crafted metadata to deterministically alter post-generation behavior without modifying model weights, training data, or inference backend, and introduces TIF-BAH, a lightweight middleware defense that verifies wrapper integrity and record...

Nokimul Hasan Arif, Qian Lou, Meng Zheng · 0 citations
Preprint Aug 2026

Write Once, Run Everywhere: The Axon DSL for Shape-Safe and Framework-Agnostic LLM Architectures

A strongly typed domain-specific language with Haskell-like syntax, that enables a write-once, run everywhere paradigm for LLM architectures, Axon fosters open cooperation and empowers researchers to implement highly specialized architectures without giving up optimization infrastructure or accepting deployment lock-in...

Jacob Nielsen, Danial Namazifard, Lukas Galke Poech et al. · 0 citations

Related blog posts

MIT News · Artificial Intelligence Sep 29, 2026

Who we become when we talk to machines

Professor Sherry Turkle’s new book, “Artificial Intimacy,” offers a withering critique of chatbots and the antisocial dynamics she believes they encourage.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.