Skip to content

thv llm: setup and teardown orchestration #5031

@yrobla

Description

@yrobla

Context

Part of #5016 (RFC: stacklok/toolhive-rfcs#70). Final subtask — depends on all previous subtasks.

Scope

thv llm setup:

  • Detects installed AI tools via the tool adapter registry
  • Configures each detected tool (Apply)
  • Starts the background proxy if any proxy-mode tool is detected
  • Triggers the OIDC browser login flow

thv llm teardown:

  • Removes gateway configuration from all tool config files (Revert)
  • Stops the background proxy
  • --purge-tokens flag to also delete cached OIDC tokens from the secrets provider
  • thv llm teardown <tool-name> — targets a single tool without affecting others

Acceptance Criteria

  • AT: thv llm setup --gateway-url <url> --issuer <issuer> --client-id <id> detects installed tools, configures each, starts the background proxy if any proxy-mode tool is present, and triggers OIDC browser login
  • AT: thv llm teardown removes gateway config from all tool config files, stops the proxy, and optionally purges cached tokens with --purge-tokens
  • AT: thv llm teardown <tool-name> targets a single tool without affecting others

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliChanges that impact CLI functionalityenhancementNew feature or requestgoPull requests that update go codellm gatewayLLM gateway authentication feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions