# Lightning-AI/LitServe

A minimal Python framework for building custom AI inference servers with full control over logic, batching, and scaling.

Repository: https://github.com/Lightning-AI/LitServe
Canonical: https://ross.abutalabs.com/products/litserve
Homepage: https://lightning.ai/litserve?utm_source=litserve_readme&utm_medium=referral&utm_campaign=litserve_readme
Language: Python
License: Apache-2.0
License Family: permissive
Topics: ai, api, serving, artificial-intelligence, deep-learning, developer-tools, fastapi, rest-api, web
Last push: 2026-08-17T21:04:38+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 97, longevity 71
- inputs: {"age_days": 995, "days_push": 16, "days_rel": 21, "gap_med": 26, "n_releases_24m": 16}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3930, forks 300 (observed 2026-08-28T04:08:29.956218+00:00)

## What it is
LitServe is a Python framework for building custom AI inference servers with full control over batching, routing, streaming, and scaling logic. It wraps FastAPI-based serving with performance optimizations for PyTorch models, LLMs, agents, and RAG pipelines.

## Use cases
- serve a pytorch model as a rest api
- deploy an llm inference server
- build a custom model serving endpoint with batching
- host an agent or rag pipeline behind an api
- self-host ai model inference with gpu autoscaling
- replace fastapi-based inference servers with something faster

## When to choose
- you need custom inference logic that rigid serving tools like vLLM can't express
- you want to serve multiple models, agents, or non-standard pipelines in Python
- you want batching, streaming, and scaling without writing MLOps glue code

## When to avoid
- you only need to serve a single standard LLM with maximum throughput - vLLM may be better
- you need a fully managed serverless platform rather than a self-hosted framework
- your workload is not AI inference at all

## Facets
- artifact type: framework
- maturity: active
- function: llm-inference, http-server, api-framework, machine-learning, rag, agent-framework, chatbot
- domain: machine-learning, deep-learning, large-language-models, artificial-intelligence, web-development, backend, apis
- platform: python, cloud, self-hosted
- tags: inference-server, model-serving, fastapi, batching, streaming, rest-api, pytorch, deployment, docker, gpu

## Member repositories
- Lightning-AI/LitServe (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:29.956218+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:24:41.529328+00:00, confidence not recorded.
  - readme: https://github.com/Lightning-AI/LitServe (fetched 2026-08-28T04:08:29.956218+00:00, sha ea45871f081a)
  - homepage: https://lightning.ai/litserve?utm_source=litserve_readme&utm_medium=referral&utm_campaign=litserve_readme (fetched 2026-08-29T09:18:27.970692+00:00, sha 21f0a0890a80)
  - registry_pypi: https://pypi.org/pypi/litserve/json (fetched 2026-08-29T09:18:27.974071+00:00, sha ee3c94c5cdc1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
