Skip to content

feat(providers): add Requesty as an OpenAI-compatible provider - #138

Closed
Thibaultjaigu wants to merge 1 commit into
HKUDS:mainfrom
Thibaultjaigu:feat/requesty-provider
Closed

feat(providers): add Requesty as an OpenAI-compatible provider#138
Thibaultjaigu wants to merge 1 commit into
HKUDS:mainfrom
Thibaultjaigu:feat/requesty-provider

Conversation

@Thibaultjaigu

Copy link
Copy Markdown
Contributor

Adds Requesty as an OpenAI-compatible provider, mirroring the existing OpenRouter provider. Requesty is an LLM gateway that uses the same provider/model naming convention as OpenRouter (e.g. openai/gpt-4o-mini, anthropic/claude-sonnet-4-5).

Changes:

  • core/providers/registry.py — a requesty ProviderSpec after openrouter: openai_compat backend, is_gateway, default base URL https://router.requesty.ai/v1, env REQUESTY_API_KEY.
  • core/providers/openai_compat.py — forwards HTTP-Referer / X-Title attribution headers for Requesty (parallel to the OpenRouter path).
  • new_ui/backend/services/requesty_models.py — models catalog service mirroring openrouter_models.py, mapping Requesty's context_window, supports_tool_calling / supports_reasoning booleans, and flat input_price / output_price to the internal model shape.
  • new_ui/backend/api/routes/config.pyGET /config/requesty/models.
  • core/config.py, deepcode_config.json.example, README.md — provider config + docs.
  • tests/test_requesty_provider.py — mirrors the OpenRouter provider tests plus the models normalization.

Testing: ruff check clean; 8 new tests pass and the existing model-compat tests still pass. Live-verified: a chat completion through the actual DeepCode provider path (make_llm_provider("requesty") -> OpenAICompatProvider) returned successfully against https://router.requesty.ai/v1, and the models service normalized the live /v1/models payload (605 models).

Note: the React model-selector UI (new_ui/frontend) was left untouched to avoid shipping a partial frontend change; the backend /config/requesty/models route is in place for a follow-up to wire the selector.

Docs: https://requesty.ai · https://docs.requesty.ai · https://app.requesty.ai/api-keys · https://app.requesty.ai/router/list

I work at Requesty. This mirrors the existing OpenRouter provider as closely as possible. Happy to adjust or close it if it's not a fit.

Requesty is an OpenAI-compatible LLM gateway using the same provider/model
naming as OpenRouter, so this mirrors the existing OpenRouter provider on the
generic openai_compat path.

- core/providers/registry.py: requesty ProviderSpec (base URL
  https://router.requesty.ai/v1, REQUESTY_API_KEY, is_gateway)
- core/providers/openai_compat.py: HTTP-Referer/X-Title attribution headers
- new_ui/backend/services/requesty_models.py: models catalog service mapping
  Requesty's context_window / supports_* / flat price fields to the internal shape
- new_ui/backend/api/routes/config.py: GET /config/requesty/models
- core/config.py + deepcode_config.json.example + README provider list
- tests mirroring the openrouter provider + models normalization

Verified: ruff clean, 8 new tests pass; live completion through the provider code
path and /v1/models both succeed against router.requesty.ai.

Signed-off-by: Thibault Jaigu <thibault.jaigu@gmail.com>
Zongwei9888 added a commit that referenced this pull request Aug 6, 2026
Ports three provider contributions that could not merge as submitted: #138
and #130 also touched new_ui/ and nanobot/, and #116 targeted nanobot/ only.
Those trees were removed in the v2.0 refactor. The provider work itself
applies unchanged to core/providers.

ProvidersConfig reads each provider via getattr(providers, spec.name), so a
ProviderSpec without a matching field is silently skipped — all three get both
halves, as the ProvidersConfig docstring requires.

Endpoints verified reachable: router.requesty.ai (200), api.minimax.io (401),
api.forge.tensorblock.co (401).

Also fixes a gateway bug #116 found in nanobot's provider that core had only
half-fixed: spec.env_key was forced for gateways, but env_extras still used
setdefault, so a stale ambient variable outranked the gateway the user picked.

Dropped from the originals: the tests covering new_ui's requesty_models
service and nanobot's registry. One of those imported "nanobot.config.schema",
which now resolves to an unrelated PyPI package (nanobot-ai) when installed —
it fails locally and skips in CI, testing nothing either way.

Co-authored-by: Thibault Jaigu <thibault.jaigu@gmail.com>
Co-authored-by: Yiiii0 <yiqiaozhou@outlook.com>
Co-authored-by: octo-patch <octo-patch@github.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Zongwei9888

Copy link
Copy Markdown
Collaborator

Ported to core/providers in b737060 (via #159), with a Co-authored-by: trailer for you.

Closing this branch rather than merging it because it also touched new_ui/, which the v2.0 refactor removed. Everything under core/ came across unchanged — the ProviderSpec, the ProvidersConfig field, the attribution headers in openai_compat.py, and your tests/test_requesty_provider.py. Only the three cases importing services.requesty_models were dropped, since that module no longer exists.

router.requesty.ai/v1/models verified reachable while porting (200).

Worth noting what sold this one: supports_prompt_caching=True. Configured through the generic custom provider, Requesty would get no cache_control injection for Claude models — a real cost difference for an agent replaying long contexts. That is the part a dedicated spec buys.

@Zongwei9888 Zongwei9888 closed this Aug 6, 2026
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