Generate llms.txt markdown from FastAPI OpenAPI schema for AI agents
Project description
fast-llms-txt
Generate an llms.txt markdown manifest from your FastAPI OpenAPI schema for AI agents.
Inspired by the llms.txt specification for LLM-friendly documentation.
Installation
uv add fast-llms-txt
Usage
from fastapi import FastAPI
from fast_llms_txt import create_llms_txt_router
app = FastAPI(title="My API", description="A sample API")
@app.get("/users")
def list_users(limit: int = 10):
"""List all users."""
return []
# Mount the llms.txt endpoint
app.include_router(create_llms_txt_router(app), prefix="/docs")
Now GET /docs/llms.txt returns:
# My API
> A sample API
## Endpoints
- **GET /users** - List all users.
- `limit` (integer, optional):
- **Response** (200): Successful Response
API
create_llms_txt_router(app, path="/llms.txt")
Creates a FastAPI router that serves the llms.txt endpoint.
app: Your FastAPI application instancepath: The endpoint path (default:/llms.txt)
generate_llms_txt(openapi_schema)
Directly convert an OpenAPI schema dict to llms.txt markdown string.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_llms_txt-0.1.0.tar.gz.
File metadata
- Download URL: fast_llms_txt-0.1.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c782f22bcbfe68c22c93403bc4305baef110a15b6e772c204173225c0a1fa07
|
|
| MD5 |
ff9ea093a290a424086c853e24b386ff
|
|
| BLAKE2b-256 |
43e5f41321ee503998112b6e29268b111ce46e7a02781c273e898f1ea02d5727
|
File details
Details for the file fast_llms_txt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fast_llms_txt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79894a1cb59be2d975e8d7e1eef93fa5a2c9f392d2706557638f2c75205101e2
|
|
| MD5 |
ea7bde99f947759fd7d8badf0f929c22
|
|
| BLAKE2b-256 |
0d7f639e0c4a643f40bad130e77c0c82020f605461dba1fff82ccb8f5a4b8520
|