Skip to content

chore(k8s): stop LiteLLM publishing its API docs - #94

Merged
jcschaff merged 1 commit into
mainfrom
chore/litellm-disable-docs
Aug 12, 2026
Merged

chore(k8s): stop LiteLLM publishing its API docs#94
jcschaff merged 1 commit into
mainfrom
chore/litellm-disable-docs

Conversation

@jcschaff

Copy link
Copy Markdown
Member

Follow-up to #93. Now that the LiteLLM proxy is internet-reachable at /kartik on dev, it was serving its API docs to anonymous visitors:

URL Before
/kartik/redoc 200, fully rendered (CDN assets, so prefix-stripping doesn't break it)
/kartik/openapi.json 200, 1.1 MB, 504 documented paths
/kartik/ (Swagger) 200 HTML but blank — assets are absolute /swagger/* and 404 through the prefix

No data or admin action was reachable without LITELLM_MASTER_KEY (those all 401), but the full API surface was public.

Why three flags, not just NO_DOCS: LiteLLM reads them independently — _get_docs_url / _get_redoc_url / _get_openapi_url in litellm/proxy/utils.py. NO_DOCS alone would only hide Swagger, which was already the broken one, and leave ReDoc and the schema up.

Why "True" and not 1: these go through str_to_bool (litellm/secret_managers/main.py:115), which recognizes only "true"/"false" case-insensitively and returns None for anything else — so "1" would silently leave docs enabled.

Set in base/, so prod (vcell-ai-rke) picks it up on its next apply as well. Config-only, no image bump.

🤖 Generated with Claude Code

https://claude.ai/code/session_0174W6CHp7FMt7c9sKdBhbp1

The proxy is now reachable from the internet at /kartik on dev, where it was
serving ReDoc and a 1.1MB openapi.json documenting 504 routes to anonymous
visitors. No data was reachable without the master key, but the API surface
was fully published.

NO_DOCS alone is not enough: LiteLLM reads three independent switches
(_get_docs_url/_get_redoc_url/_get_openapi_url in litellm/proxy/utils.py), so
Swagger, ReDoc and the schema each need their own flag. Values must be
"true"/"false" -- str_to_bool() recognizes nothing else, so "1" would silently
leave the docs enabled.

Set in base/, so prod (vcell-ai-rke) picks it up on its next apply too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174W6CHp7FMt7c9sKdBhbp1
@jcschaff
jcschaff merged commit 3ce1e3b into main Aug 12, 2026
1 check passed
@jcschaff
jcschaff deleted the chore/litellm-disable-docs branch August 12, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant