Skip to content

(feat): add routstr as a declarative provider - #9175

Merged
alexhancock merged 6 commits into
aaif-goose:mainfrom
9qeklajc:routstr-provider
May 13, 2026
Merged

(feat): add routstr as a declarative provider#9175
alexhancock merged 6 commits into
aaif-goose:mainfrom
9qeklajc:routstr-provider

Conversation

@9qeklajc

Copy link
Copy Markdown
Contributor

Summary

Add routstr a declarative provider for goose.

routstr is an opensource decentralized protocol and OpenAI-compatible API that provides access to models from Anthropic, Google, OpenAI, and DeepSeek.

Changes

  • crates/goose/src/providers/declarative/roustr.json — Declarative provider config following the existing pattern (groq.json, novita.json).
  • documentation/docs/getting-started/providers.md — Added routstr to the provider table

Configuration

Parameter Value
Engine openai
API Key Env ROUTSTR_API_KEY
Base URL ${ROUTSTR_HOST}/v1 (default ROUTSTR_HOST=https://api.routstr.com)

Related Issues

Relates to #3113
Discussion: #3113

@9qeklajc 9qeklajc mentioned this pull request May 12, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b431c3c783

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

],
"dynamic_models": true,
"models": [
"claude-opus-4.7",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix Routstr models so the provider loads

DeclarativeProviderConfig.models deserializes as Vec<ModelInfo>, so each entry must be an object with fields such as name and context_limit; these bare strings make serde_json::from_str fail. Since load_fixed_providers skips invalid fixed provider JSON, Routstr will not be registered or shown, and the added deserialize test will panic before its assertions. Encode the static models as ModelInfo objects, or remove the static defaults and align the test/docs with that choice.

Useful? React with 👍 / 👎.

@alexhancock

alexhancock commented May 12, 2026

Copy link
Copy Markdown
Collaborator

The format of using strings alone for the models isn't valid

thread 'config::declarative_providers::tests::test_routstr_json_deserializes' (5753) panicked at crates/goose/src/config/declarative_providers.rs:886:40:
routstr.json should parse: Error("invalid type: string \"claude-opus-4.7\", expected struct ModelInfo", line: 20, column: 21)
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result<T,E>::expect
   4: goose::config::declarative_providers::tests::test_routstr_json_deserializes
   5: goose::config::declarative_providers::tests::test_routstr_json_deserializes::{{closure}}
   6: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This will need to be resolved before the PR can progress

#9175 (comment)

@9qeklajc

Copy link
Copy Markdown
Contributor Author

@apetersson fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3279d0a689

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

],
"dynamic_models": true,
"models": [
{ "name": "claude-opus-4.7", "context_limit": 1000000 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Routstr model namespaces

When dynamic model fetching is unavailable or a user accepts the provider's default model, register_with_name uses these static models entries directly as the model IDs sent to the API. The Routstr docs added in this same commit show namespaced IDs such as anthropic/claude-opus-4.7 and deepseek/deepseek-v4-pro, but the static defaults drop those namespaces, so goose can send claude-opus-4.7 to Routstr and fail to route the model as documented. Keep the provider prefixes in the shipped model IDs so the fallback/default path matches Routstr's IDs.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df1b988f41

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"display_name": "Routstr",
"description": "OpenAI-compatible aggregator that fronts dozens of upstream providers (OpenAI, Anthropic, Google, DeepSeek, Llama, …) behind a single API. Authenticate with an sk-... bearer issued by a Routstr instance — payment (e.g. Cashu top-up) is handled outside goose.",
"api_key_env": "ROUTSTR_API_KEY",
"base_url": "${ROUTSTR_HOST}/v1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable Responses routing for Routstr

When Routstr's dynamic /v1/models list includes OpenAI o*/gpt-5* IDs, this base URL derives the default OpenAI v1/chat/completions path, and OpenAiProvider::should_use_responses_api routes those model names to /v1/responses instead. Routstr is being documented here as a chat-completions OpenAI-compatible router, so users who pick one of those dynamically fetched models will send requests to an endpoint the Routstr integration does not configure or document. Add a provider-level way to force chat completions for Routstr before enabling dynamic models for OpenAI-family IDs.

Useful? React with 👍 / 👎.

@alexhancock
alexhancock self-requested a review May 13, 2026 17:53
@alexhancock
alexhancock merged commit a14fcc6 into aaif-goose:main May 13, 2026
24 checks passed
lifeizhou-ap added a commit that referenced this pull request May 14, 2026
* main: (66 commits)
  Switch GH pages deploy to actions/artifact workflow (#9025)
  fix(summon): re-apply canonical limits when delegate overrides model (#9183)
  Split code signing from build (#8587)
  refactor(logging): consolidate logging setup into shared helper in goose crate (#8817)
  fix(cli): report cumulative total_tokens in stream-json/json output (#8910)
  plugins: add open plugins (just skills for now) (#9063)
  fix(providers): refresh GCP metadata server token on expiration (#8929)
  chore(deps): bump the cargo-minor-and-patch group across 1 directory with 14 updates (#9178)
  chore(deps): bump bzip2 from 0.5.2 to 0.6.1 (#8964)
  chore(deps): bump tauri from 2.10.3 to 2.11.1 in /ui/goose2/src-tauri (#9066)
  chore(deps): bump hono from 4.12.14 to 4.12.18 in /evals/open-model-gym/mcp-harness (#9073)
  localize hardcoded strings in provider settings UI (#8931)
  chore(deps): bump @babel/plugin-transform-modules-systemjs from 7.28.5 to 7.29.4 in /documentation (#9122)
  move settings into app shell (#9047)
  Add Location column to CLI skills table (#8785)
  (feat): add routstr as a declarative provider (#9175)
  Add FuturMix provider (#8840)
  fix: convert quoted numeric config values to numbers if needed (#8844)
  fix(ui): keep SSE reconnect loop alive on long disconnects (#8717) (#8846)
  fix(openai): apply request_params to outgoing API payload (#9151)
  ...
shafqatevo pushed a commit to shafqatevo/goose that referenced this pull request Aug 7, 2026
Signed-off-by: 9qeklajc <9qeklajc>
Co-authored-by: 9qeklajc <9qeklajc>
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.

2 participants