skillfed

fastapi-offline

FastAPI without reliance on CDNs for docs

fastapi-offline v1.7.7 309.4K downloads/30d#7,755 on PyPI53
Permissive license MIT Active released

What it is and what it does

FastAPI-offline is a drop-in replacement for FastAPI that bundles Swagger UI and Redoc documentation assets locally instead of fetching them from external CDNs. This solves the problem of API documentation becoming inaccessible in disconnected networks, air-gapped environments, or situations where external CDN access is restricted or unreliable.

The package automates what the official FastAPI documentation describes as a manual process: it includes the necessary JavaScript and CSS files for both Swagger and Redoc, serves them locally, and configures a FastAPI instance to use them. You instantiate FastAPIOffline instead of FastAPI, optionally customize the static asset path or favicon, and everything else works as normal—all FastAPI options pass through unchanged.

Use it for:

  • Running FastAPI services in air-gapped or disconnected networks where external CDN access is unavailable or forbidden.
  • Deploying API documentation in environments with strict network policies or firewall rules that block CDN domains.
  • Ensuring API docs remain accessible even if external CDN services experience outages or performance degradation.
  • Building self-contained Docker images or offline-first deployments where all dependencies must be bundled locally.
  • Customizing documentation UI appearance by serving your own favicon alongside the standard Swagger and Redoc interfaces.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Replaces FastAPI's CDN-dependent documentation UI with locally-served Swagger and Redoc assets, enabling API docs to work on disconnected or air-gapped networks.

Yes. If you need FastAPI documentation to work without CDN access, this package solves that problem with minimal friction—a single dependency, permissive licensing, active maintenance, and a straightforward API. Install it when disconnected networks, air-gapped deployments, or strict network policies make CDN-dependent docs impractical.

Install

fastapi-offline on PyPI

pip

pip install fastapi-offline

uv

uv add fastapi-offline

poetry

poetry add fastapi-offline

Installing fastapi-offline

Before you install

Low friction: single runtime dependency (fastapi), pure Python wheel distribution. Active maintenance with a recent release (56 days ago) and an archived repository status of false.

License in practice

MIT-licensed code with permissive terms; includes Apache 2.0 Swagger and MIT-licensed Redoc and favicon assets bundled in the package. All original licenses and copyrights are preserved.

Quickstart

pip install fastapi-offline

from fastapi_offline import FastAPIOffline

app = FastAPIOffline()

@app.get("/")
async def root():
    return {"message": "Hello World"}

Requires Python 3.8 or later.

Verify before relying

  • Whether static asset serving works correctly behind reverse proxies or non-root paths beyond the documented static_url parameter.
  • Performance impact of serving bundled documentation assets compared to CDN delivery in typical deployments.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — fastapi
Maintenance actively maintained — 56 days since the last release
Last repo commit
First released
Downloads 309,355/month — #7,755 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fastapi_offline-1.7.7-py3-none-any.whl

Programming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Tags

fastapi offline documentationself-hosted swagger uilocal api docs without cdnair-gapped fastapi docsfastapi disconnected networkredoc local servingfastapi docs no internet
offline-firstair-gappeddocumentation-serving

More Dynamic Content packages