Skip to content

feat: add Requesty as an OpenAI-compatible LLM provider#92

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

feat: add Requesty as an OpenAI-compatible LLM provider#92
Thibaultjaigu wants to merge 1 commit into
eren23:mainfrom
Thibaultjaigu:add-requesty-provider

Conversation

@Thibaultjaigu

Copy link
Copy Markdown

Add Requesty as an OpenAI-compatible LLM provider

Adds requesty as a selectable LLM_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 same provider/model slug naming (e.g. openai/gpt-4o-mini), and accepts the same optional HTTP-Referer / X-Title attribution headers. Because of that, this reuses the single AsyncOpenAI code path — no new client, no new behavior surface.

Default behavior is unchanged: leave LLM_PROVIDER unset and the OpenRouter path is byte-for-byte identical.

Files changed

  • apps/modal-backend/providers/llm.pyREQUESTY_BASE_URL constant; requesty entry in _LLM_BASE_URLS; a dedicated _resolve_provider branch using REQUESTY_API_KEY + the attribution headers (mirrors the openrouter branch); requesty added to the structured-output tier ladder (same provider/model slug routing as OpenRouter).
  • apps/modal-backend/obs.pystatus_payload probes router.requesty.ai/v1/models only when LLM_PROVIDER=requesty, so the default /status payload is unchanged for OpenRouter users.
  • apps/web/app/status/page.tsx — conditional requesty health row (only renders when the backend reports it).
  • .env.example and apps/modal-backend/.env.example — document LLM_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/completions with model: openai/gpt-4o-mini and the same HTTP-Referer/X-Title headers 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.

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.
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