feat: add Requesty as an OpenAI-compatible binding#701
Open
Thibaultjaigu wants to merge 1 commit into
Open
Conversation
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.
Add Requesty as an OpenAI-compatible binding
This PR adds a new
requestybinding tozoos/bindings_zoo/, mirroring the existingopen_routerbinding as closely as possible. Requesty is an OpenAI-compatible LLM gateway/router, so the request/response shapes and the binding logic are identical to OpenRouter.What it does
https://router.requesty.ai/v1(chat at/v1/chat/completions, model list at/v1/models)Authorization: Bearer <key>via arequesty_keyconfig field (or theREQUESTY_API_KEYenvironment variable)provider/model(e.g.openai/gpt-4o-mini)/v1/modelsendpoint is OpenAI-shaped (adataarray), consumed by the models scraperNew files (
zoos/bindings_zoo/requesty/)__init__.py—class Requesty(LLMBinding),binding_name = "Requesty",binding_folder_name = "requesty",DEFAULT_CONFIGwithrequesty_key,override_api_url = "https://router.requesty.ai/v1",API_URL = "https://router.requesty.ai/v1/models". All LLMBinding method logic is identical to the OpenRouter binding (OpenAI-compatible).models_scraper.py—class RequestyModelFetcher,API_URL = "https://router.requesty.ai/v1/models". Same OpenAI-shapeddata-array parsing as the OpenRouter scraper. Requesty's model objects exposecontext_windowand capability flags (supports_vision, etc.) instead of OpenRouter'sarchitecture/pricingobjects, so the field reads are guarded defensively with.get()and sensible fallbacks (mirroring the OpenRouter scraper's defensive style). The output YAML structure is preserved field-for-field.binding_card.yaml— Requesty metadata.models.yaml— generated by running the new scraper against the live/v1/modelsendpoint (550 models).requirements.txt,.gitignore— copied unchanged from the OpenRouter binding.Discovery / registry
Bindings in
zoos/bindings_zoo/are auto-discovered by directory scan — there is no central binding registry/list to edit. A grep foropen_router/openrouteracross*.py/*.yaml/*.json(excluding the binding dir and tests) found only scraped model artifacts, no code-level registry. So the new directory is sufficient.Logo
The OpenRouter binding ships
logo.png/logo2.png. I intentionally omitted these rather than ship the OpenRouter-branded image under a Requesty binding; the binding falls back to the default icon. Happy to add a proper Requesty logo if you'd like one included.Verification
ast.parseon both__init__.pyandmodels_scraper.py— OK.yaml.safe_loadonbinding_card.yamlandmodels.yaml— OK.requesty/directory mirrorsopen_router/file-for-file (minus the omitted logos), with all OpenRouter identifiers/URLs/keys renamed.POST https://router.requesty.ai/v1/chat/completions(modelopenai/gpt-4o-mini) → HTTP 200, real completion returned.GET https://router.requesty.ai/v1/models→ HTTP 200,dataarray with 572 models (proves the scraper path works end-to-end).Docs: https://requesty.ai , https://docs.requesty.ai
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.