LitServe

(★ 3,929)

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

File Explorer

  • .codecov.yml
  • .gitignore
  • .pre-commit-config.yaml
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • GOVERNANCE.md
  • LICENSE
  • MANIFEST.in
  • pyproject.toml
  • pytest.ini
  • README.md

# Installation Guide

python
Prerequisites

Setup Steps

pip install litserve

Install the LitServe library.

python server.py

Run the defined LitServe server script.

curl -X POST http://127.0.0.1:8000/predict -H "Content-Type: application/json" -d '{"input": 4.0}'

Send a test request to the server prediction endpoint.

Key Commands

pip install litserve

Install LitServe using the Python package manager.

lightning deploy server.py

Deploy or run the server using the Lightning CLI.

python server.py

Directly execute the server script with the Python interpreter.

Some agent examples may require setting the OPENAI_API_KEY environment variable.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

pip install

View Details ▼

Install Python packages.

pip install {{package1 package2 ...}}

Install one or more packages:

pip install {{package1 package2 ...}} {{[-U|--upgrade]}}

Upgrade all specified packages to the latest version, installing any that are not already present:

pip install {{package}}=={{version}}

Install a specific version of a package:

// repository documentation