Skip to content

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

Open
Thibaultjaigu wants to merge 1 commit into
dtyq:masterfrom
Thibaultjaigu:add-requesty-provider
Open

feat: add Requesty as an OpenAI-compatible LLM provider#83
Thibaultjaigu wants to merge 1 commit into
dtyq:masterfrom
Thibaultjaigu:add-requesty-provider

Conversation

@Thibaultjaigu

Copy link
Copy Markdown

Summary

Adds Requesty as an OpenAI-compatible LLM provider, mirroring the existing OpenRouter provider as closely as possible.

Requesty (https://requesty.ai) is an OpenAI-compatible LLM gateway. It exposes the standard /v1/chat/completions endpoint, uses Authorization: Bearer <key> auth, and provider/model naming (e.g. openai/gpt-4o-mini), so it slots into the existing OpenAI-compatible provider plumbing with no special-casing.

  • OpenAI-compatible base URL: https://router.requesty.ai/v1
  • Chat completions: https://router.requesty.ai/v1/chat/completions

Wiring sites (each mirrors the OpenRouter entry exactly)

Frontend (frontend/magic-web):

  • packages/magic-admin/src/const/aiModel.ts — added Requesty to the ServiceProvider enum and https://router.requesty.ai/v1/chat/completions to the ServiceProviderUrl base-URL map.
  • packages/magic-admin/src/pages/PlatformPackage/components/ServiceIcon/index.tsx — added Requesty to the service-icon map (reuses the existing default icon; no new binary asset).
  • src/pages/superMagic/.../AddModel/providerFieldConfigs.ts — added requesty to the provider-code map, the URL-placeholder override map (https://router.requesty.ai/v1), and the API-key-placeholder map.
  • src/pages/initialization/components/Step2Provider.tsx — added the Requesty provider config (defaultUrl: https://router.requesty.ai/v1) and the dropdown entry.
  • src/assets/locales/en_US/initialization.json and zh_CN/initialization.json — added the Requesty label.

Backend (backend/magic-service):

  • app/Domain/Provider/Entity/ValueObject/ProviderCode.php — added the Requesty enum case. It falls through the existing default arms (implementation → OpenAIModel, sort order → 999), i.e. it is handled as a generic OpenAI-compatible provider, exactly like the non-special-cased providers. No new backend class is required since Requesty is OpenAI-compatible passthrough.

Intentionally not touched (would be heavier / provider-specific and out of scope for a generic OpenAI-compatible LLM provider): the image-generation factory/model classes and the DB-seed ServiceProviderInitializer + related migration. Happy to add those too if desired.

Verification

  • Typecheck: ran tsc --noEmit -p tsconfig.app.json in frontend/magic-web/packages/magic-admin. The added enum member, base-URL map entry, icon-map entry, and all mirrored map/config entries compile with zero new errors (verified by diffing the typecheck output against the unmodified baseline — the remaining errors pre-exist in unrelated files and are unaffected by this change).
  • Live API check: a real chat completion against https://router.requesty.ai/v1/chat/completions with model openai/gpt-4o-mini returned HTTP 200 with a valid completion (gpt-4o-mini-2024-07-18), confirming the base URL, provider/model naming, and Bearer auth are correct.

Links

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.

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