Skip to content

feat: add Requesty as an OpenAI-compatible provider - #591

Open
Thibaultjaigu wants to merge 1 commit into
AsyncFuncAI:mainfrom
Thibaultjaigu:add-requesty-provider
Open

Thibaultjaigu wants to merge 1 commit into
AsyncFuncAI:mainfrom
Thibaultjaigu:add-requesty-provider

Conversation

@Thibaultjaigu

Copy link
Copy Markdown

Summary

Adds Requesty as a named chat provider. Requesty is an OpenAI-compatible LLM gateway, so it is wired next to OpenRouter using the existing _OpenAICompatStreamer.

Changes

  • api/clients/requesty.py: RequestyClient on top of adalflow's OpenAIClient. Uses REQUESTY_API_KEY, defaults to https://router.requesty.ai/v1 and honours an optional REQUESTY_BASE_URL (for example https://router.eu.requesty.ai/v1 for the EU region). Sends the same HTTP-Referer / X-Title headers as the OpenRouter client, and sends a plain text prompt as a user message like the OpenRouter client does (a lone system message is rejected by Anthropic and Gemini models).
  • api/chat/_stream.py: RequestyChatStreamer registered as requesty.
  • api/clients/__init__.py, api/config.py: export, env var, CLIENT_CLASSES and default provider map entries.
  • api/config/generator.json and generator.litellm.json: requesty provider block with a few models (default openai/gpt-4o-mini), custom models allowed. The default provider is unchanged.
  • src/messages/*.json: providerRequesty label for the provider selector.
  • api/README.md: env vars, key link and provider list.
  • Tests: requesty added to the registry tests in tests/unit/test_chat.py, plus tests/unit/test_requesty_client.py for base URL handling and message conversion.

How to test

REQUESTY_API_KEY=rqsty-...

Start the backend, pick "Requesty" in the model selector and use openai/gpt-4o-mini (or any custom model id such as anthropic/claude-sonnet-4-5). Keys are at https://app.requesty.ai/api-keys.

Validation

  • ruff check and ruff format --check (v0.8.6, as pinned in pre-commit) pass on all touched Python files.
  • pytest tests/unit tests/backend tests/test_config.py: 81 passed, 10 failed. The same 10 fail on a clean main in my environment (missing GOOGLE_API_KEY / OPENAI_API_KEY and watchfiles), and the new tests all pass.
  • Ran the real stream through ChatStreamer.create(provider="requesty", ...) with the config from get_model_config, and every model in the new block replied: openai/gpt-4o-mini, openai/gpt-4.1, openai/gpt-5-mini, anthropic/claude-sonnet-4-5, google/gemini-2.5-flash, deepseek/deepseek-chat.
  • The frontend change only adds a translation key; JSON files validated, I did not run the Next.js build.

Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.

Adds a RequestyClient on top of OpenAIClient and a RequestyChatStreamer registered next to OpenRouter, with REQUESTY_API_KEY and an optional REQUESTY_BASE_URL (e.g. the EU router). Registers the provider in generator.json and generator.litellm.json, adds the provider label to the frontend translations, documents the env vars in api/README.md and covers it in the unit tests.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

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