Skip to main content

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 instance
  • path: The endpoint path (default: /llms.txt)

generate_llms_txt(openapi_schema)

Directly convert an OpenAPI schema dict to llms.txt markdown string.


Appendix: Release Procedure

Versioning

This project uses semantic versioning:

  • PATCH (0.1.x): Bug fixes, no API changes
  • MINOR (0.x.0): New features, backward compatible
  • MAJOR (x.0.0): Breaking API changes

Release Steps

Run the release script:

./scripts/release.sh 0.2.0

This will:

  1. Update version in pyproject.toml and fast_llms_txt/__init__.py
  2. Show diff and prompt for confirmation
  3. Commit and tag
  4. Optionally push (triggers PyPI publish via GitHub Actions)

Infrastructure

  • PyPI: pypi.org/project/fast-llms-txt
  • Trusted Publishing: No tokens required; GitHub Actions authenticates via OIDC
  • Environment: release environment in GitHub repo settings restricts publishing to v* tags

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_llms_txt-0.2.0.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_llms_txt-0.2.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file fast_llms_txt-0.2.0.tar.gz.

File metadata

  • Download URL: fast_llms_txt-0.2.0.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_llms_txt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fdc08f1fafc8da6e33999c023c89337471b73e6ff4508b4a0fc2aff89661516c
MD5 ca8c6006387607561f70f950caf79e6b
BLAKE2b-256 c0bb8848ff5e5cc0c01eceafeea623be1c3dada1f0e9dc0d90b80eb010c6a8a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_llms_txt-0.2.0.tar.gz:

Publisher: publish.yml on AlteredCraft/fast-llms-txt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_llms_txt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fast_llms_txt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fast_llms_txt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec26cb50c288b75628c4e1667e9a720aee3f23803d783a4c5bad366dce9d7f03
MD5 ad138a419a7efcf993b6b8b8c95d2b56
BLAKE2b-256 8e520bb3b1bcfcfb0f1d4a24d551dcfd1b424d0dc2c4f5dc9d4efd5dbf0df71c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_llms_txt-0.2.0-py3-none-any.whl:

Publisher: publish.yml on AlteredCraft/fast-llms-txt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page