RFC-0070: thv llm subcommand for LLM gateway authentication#70
RFC-0070: thv llm subcommand for LLM gateway authentication#70
Conversation
Adds RFC proposing a `thv llm` command group that bridges AI coding tools to OIDC-protected LLM gateways via a localhost reverse proxy and token helper, with auto-wiring of client applications. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix inconsistent teardown language (remove backup/restore references) - Remove mermaid diagram - Add Audit and Logging security subsection - Remove all ScopeLLM references (implementation detail) - Clarify token helper is preferred over background proxy - Clarify config set vs setup relationship - Add Documentation section (CLI help text only) - Fix nitpick on Revert description Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JAORMX
left a comment
There was a problem hiding this comment.
Would this be settable/usable via the HTTP API? That is, could the UI set this up?
|
This will need to be updated to explain how a single command can be used to login once to provide access to automatically wire MCP servers and LLM gateways, where both require the same oidc auth. |
|
Out of scope for this RFC. The OIDC flow for MCP tool authentication is fundamentally different from LLM gateway auth — unifying them into a single sign-on would add significant complexity. Two separate logins is acceptable for now; a unified login can be explored in a future RFC if there's demand. Added a non-goal entry to the RFC to make this explicit. |
|
@JAORMX Good question. This RFC is scoped to the CLI only — That said, the config model and core logic are designed to be reusable, so exposing LLM gateway configuration via the HTTP API (e.g., for UI-driven setup) is a natural follow-up. Added a non-goal entry to make this explicit. |
Address review feedback from @JAORMX and self-review: - Unified MCP/LLM single sign-on is out of scope due to flow differences - HTTP API exposure is future work; core logic designed to be reusable Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Proposes a
thv llmcommand group that bridges AI coding tools to OIDC-protected LLM gateways. Two authentication modes cover the full spectrum of tools:thv llm tokenprints a fresh JWT for OIDC-capable tools (Claude Code)A single
thv llm setupcommand detects installed tools, configures them, starts the proxy, and handles OIDC login — extending ToolHive's existing MCP auto-wiring to LLM gateway access.Key design decisions
UpdateConfig()), secrets provider (ScopeLLM), client config editing (pkg/client/config_editor.go), and OIDC infrastructurepkg/llm/config.go; implementation details inpkg/llm/internal/