feat: add Requesty as an OpenAI-compatible provider - #591
Open
Thibaultjaigu wants to merge 1 commit into
Open
Thibaultjaigu wants to merge 1 commit into
Thibaultjaigu wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:RequestyClienton top of adalflow'sOpenAIClient. UsesREQUESTY_API_KEY, defaults tohttps://router.requesty.ai/v1and honours an optionalREQUESTY_BASE_URL(for examplehttps://router.eu.requesty.ai/v1for the EU region). Sends the sameHTTP-Referer/X-Titleheaders 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:RequestyChatStreamerregistered asrequesty.api/clients/__init__.py,api/config.py: export, env var,CLIENT_CLASSESand default provider map entries.api/config/generator.jsonandgenerator.litellm.json:requestyprovider block with a few models (defaultopenai/gpt-4o-mini), custom models allowed. The default provider is unchanged.src/messages/*.json:providerRequestylabel for the provider selector.api/README.md: env vars, key link and provider list.requestyadded to the registry tests intests/unit/test_chat.py, plustests/unit/test_requesty_client.pyfor base URL handling and message conversion.How to test
Start the backend, pick "Requesty" in the model selector and use
openai/gpt-4o-mini(or any custom model id such asanthropic/claude-sonnet-4-5). Keys are at https://app.requesty.ai/api-keys.Validation
ruff checkandruff 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 cleanmainin my environment (missingGOOGLE_API_KEY/OPENAI_API_KEYandwatchfiles), and the new tests all pass.ChatStreamer.create(provider="requesty", ...)with the config fromget_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.Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.