Skip to main content

Installation

Install

lihil(currently) requires python>=3.12

pip

pip install lihil

uv

if you want to install lihil using uv

uv install guide

  1. init your web project with project_name
uv init project_name
  1. install lihil via uv, this will solve all dependencies for your in a dedicated virtual environment.
uv add lihil

Serve

Serve with lihil

app.py

from lihil import Lihil

# your application code

lhl = Lihil()

if __name__ == "__main__":
lhl.run(__file__)

then in command line

uv run python -m myproject.app --server.port=8080

This allows you to override configurations using command-line arguments.

If your app is deployed in a containerized environment, such as Kubernetes, providing secrets this way is usually safer than storing them in files.

use --help to see available configs.

Serve with uvicorn

lihil is ASGI compatible, you can run it with an ASGI server, such as uvicorn start a server with app.py, default to port 8000