Skip to content

feat(ai,coding-agent): add Requesty as a built-in provider - #2

Closed
devin-ai-integration[bot] wants to merge 1 commit into
upstream-mainfrom
devin/1789658005-requesty-provider
Closed

devin-ai-integration[bot] wants to merge 1 commit into
upstream-mainfrom
devin/1789658005-requesty-provider

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Adds requesty as a built-in provider in @earendil-works/pi-ai and wires it into the coding agent (REQUESTY_API_KEY, default model, docs). Prepared against current upstream badlogic/pi-mono main (upstream-main branch here) so it can be submitted upstream once a maintainer has granted lgtm per pi's CONTRIBUTING.md.

Model catalog is generated, not hand-written: fetchRequestyModels() in scripts/generate-models.ts reads https://router.requesty.ai/v1/models (no auth), keeps api === "chat" && supports_tool_calling, and maps:

anthropic/*  -> api: "anthropic-messages", baseUrl: "https://router.requesty.ai"     (native /v1/messages: thinking, cache_control pass through)
everything else -> api: "openai-completions", baseUrl: "https://router.requesty.ai/v1"
input_price/output_price/cached_price/caching_price ($/token) * 1e6 -> cost.{input,output,cacheRead,cacheWrite}
supports_role_developer === false -> compat.supportsDeveloperRole: false

Yields 660 models (11 Anthropic Messages, 649 OpenAI completions). Provider factory requestyProvider() uses envApiKeyAuth + the existing lazy anthropicMessagesApi/openAICompletionsApi; no new API implementation. Coding-agent default is anthropic/claude-sonnet-4-6.

Verification

  • npm run check clean; test/providers.test.ts (new Requesty auth/routing test) and test/env-api-keys.test.ts pass.
  • Live smoke test with a real key: anthropic/claude-sonnet-4-6, openai/gpt-5.4-mini, moonshot/kimi-k2.6 all stream, call tools (stopReason: toolUse), and report usage/cost through the router.

Notes

  • packages/ai/src/providers/data/requesty.json is gitignored like the other provider JSON; CI regenerates it. requesty.models.ts and models.generated.ts are included as generated output.
  • Model name is the id (Requesty's description field is a paragraph, not a display name).
  • This supersedes the earlier reverted feat(ai,coding-agent): add Requesty as native provider #1 approach; it follows the current upstream provider architecture (per-provider factory + providers/all.ts) that did not exist then.

Link to Devin session: https://app.devin.ai/sessions/e7290f77ce644b3f849f89535915f2d8
Open in Devin Desktop: https://app.devin.ai/desktop/session/e7290f77ce644b3f849f89535915f2d8?variant=devin
Requested by: @requesty-JohnCosta27

Models are generated from https://router.requesty.ai/v1/models.
anthropic/* models use the router's Anthropic Messages endpoint;
all other models use OpenAI chat completions.

Co-Authored-By: john <john@requesty.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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