LitServe is a lightweight, fast AI inference server from Lightning AI. It wraps PyTorch models (and others) into a performant API endpoint with auto-batching, GPU support, and a simple API. Current version 0.2.17, requires Python >=3.10. Released under Apache 2.0, active development with frequent updates.
pip install litserveNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic LitServe app with a SimpleLitAPI subclass and server instantiation.
Always specify 'devices' explicitly, e.g., devices=1 for a single GPU or CPU.
Convert outputs to Python lists, dicts, or strings before returning.
Use 'SimpleLitAPI' subclass instead of implementing LitAPI from scratch, unless you need custom batch logic.
For GPU-only deployment, set accelerator='gpu' and devices=num_gpus. For CPU, accelerator='cpu' and devices=1.
Set 'workers_per_device=0' to disable multiprocessing, or use WSL/Linux.
Use 'from litserve import LitServer' or 'import litserve as ls' and then 'ls.LitServer'.
Convert to list: result.tolist().
Set devices to the number of GPUs available (e.g., devices=4) or use accelerator='cpu'.
Wrap the server.run() call inside if __name__ == '__main__': block.
No dependency data recorded yet.