Skip to content

Document routing API-key providers through a custom base URL #156

Description

@PhilDL

Problem

Users behind a corporate proxy or an LLM gateway (Cloudflare AI Gateway, LiteLLM, Portkey, …) need generate and the live Q&A to reach their provider through a custom base URL instead of the vendor's default endpoint. Today nothing in balade's docs says whether that is possible, and the only known workaround is a network-level rewrite.

What likely already works

Balade's Pi state directory (~/.balade/pi/) includes models.json, and Pi's ModelConfig schema (@earendil-works/pi-coding-agent, core/model-config) accepts an optional baseUrl on both provider configs and model overrides. If that path works end to end with an API-key provider, the feature exists and is merely undocumented.

Proposal

  1. Verify: point an Anthropic or OpenAI API-key provider at a proxy via ~/.balade/pi/models.json baseUrl and run generate.
  2. Document the working shape in the README (or docs/), including where the file lives and that OAuth subscription providers are out of scope for rerouting.
  3. If per-invocation override matters in practice (CI), consider surfacing it without editing the state file — an env var or a library generate option — as a follow-up decision, not part of this issue.

Out of scope

  • Any change to provider auth flows.
  • Rerouting subscription OAuth providers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCLI commands and terminal UXenhancementNew feature or requesttriageLogged from usage feedback, awaiting technical triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions