feat: add Requesty as an OpenAI-compatible LLM provider#92
Open
Thibaultjaigu wants to merge 1 commit into
Open
feat: add Requesty as an OpenAI-compatible LLM provider#92Thibaultjaigu wants to merge 1 commit into
Thibaultjaigu wants to merge 1 commit into
Conversation
Mirror the existing OpenRouter wiring so the planner + click VLM can route through Requesty (https://router.requesty.ai/v1), an OpenRouter-shaped aggregator that uses the same provider/model slug naming and the same HTTP-Referer / X-Title attribution headers. - providers/llm.py: REQUESTY_BASE_URL constant, requesty entry in _LLM_BASE_URLS, a dedicated _resolve_provider branch (REQUESTY_API_KEY + attribution headers), and requesty in the structured-output tier ladder. - obs.py: status_payload probes router.requesty.ai/v1/models only when LLM_PROVIDER=requesty, leaving the default OpenRouter payload unchanged. - apps/web/app/status/page.tsx: conditional requesty health row. - .env.example (root + modal-backend) and docs/BYO-KEYS.md: document LLM_PROVIDER=requesty + REQUESTY_API_KEY. - tests/test_llm_provider.py: cover requesty key/base-url resolution and tier.
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 LLM provider
Adds
requestyas a selectableLLM_PROVIDER, mirroring the existing OpenRouter wiring. Requesty (https://router.requesty.ai/v1) is an OpenRouter-shaped aggregator: it speaks the OpenAI wire protocol, uses the sameprovider/modelslug naming (e.g.openai/gpt-4o-mini), and accepts the same optionalHTTP-Referer/X-Titleattribution headers. Because of that, this reuses the singleAsyncOpenAIcode path — no new client, no new behavior surface.Default behavior is unchanged: leave
LLM_PROVIDERunset and the OpenRouter path is byte-for-byte identical.Files changed
apps/modal-backend/providers/llm.py—REQUESTY_BASE_URLconstant;requestyentry in_LLM_BASE_URLS; a dedicated_resolve_providerbranch usingREQUESTY_API_KEY+ the attribution headers (mirrors theopenrouterbranch);requestyadded to the structured-output tier ladder (same provider/model slug routing as OpenRouter).apps/modal-backend/obs.py—status_payloadprobesrouter.requesty.ai/v1/modelsonly whenLLM_PROVIDER=requesty, so the default/statuspayload is unchanged for OpenRouter users.apps/web/app/status/page.tsx— conditionalrequestyhealth row (only renders when the backend reports it)..env.exampleandapps/modal-backend/.env.example— documentLLM_PROVIDER=requesty+REQUESTY_API_KEY.docs/BYO-KEYS.md— provider table row for Requesty.apps/modal-backend/tests/test_llm_provider.py— tests for requesty key/base-URL resolution, the missing-key error, and the structured-output tier.Live test
Verified against the live API before opening this PR:
POST https://router.requesty.ai/v1/chat/completionswithmodel: openai/gpt-4o-miniand the sameHTTP-Referer/X-Titleheaders the code sends → HTTP 200, real completion returned (gpt-4o-mini-2024-07-18).GET https://router.requesty.ai/v1/models(the health-check endpoint) → HTTP 200.Edited Python files pass
py_compile.I work at Requesty. This mirrors the existing OpenRouter wiring. Happy to adjust or close it if it's not a fit.