Skip to content

feat: add Requesty as an OpenAI-compatible provider#6273

Open
Thibaultjaigu wants to merge 2 commits into
crewAIInc:mainfrom
Thibaultjaigu:add-requesty-provider
Open

feat: add Requesty as an OpenAI-compatible provider#6273
Thibaultjaigu wants to merge 2 commits into
crewAIInc:mainfrom
Thibaultjaigu:add-requesty-provider

Conversation

@Thibaultjaigu

@Thibaultjaigu Thibaultjaigu commented Jun 21, 2026

Copy link
Copy Markdown

Adds Requesty (an OpenAI-compatible LLM gateway) as a supported provider, mirroring the existing OpenRouter routing.

Requesty uses the same provider/model naming as OpenRouter (e.g. requesty/openai/gpt-4o-mini), so it routes through the existing OpenAI-compatible path rather than needing litellm-native support. requesty is registered in llm.py (supported-providers list, prefix map, the pattern-match passthrough branch, and the openai_compatible provider set) and gets a ProviderConfig in the openai_compatible completion module (base_url https://router.requesty.ai/v1, REQUESTY_API_KEY). A model string like requesty/openai/gpt-4o-mini has its requesty/ prefix stripped before the upstream call — identical mechanics to openrouter.

Changes:

  • lib/crewai/src/crewai/llm.py — add requesty to SUPPORTED_NATIVE_PROVIDERS, the provider mapping, the pattern-match branch, and the openai_compatible provider set.
  • lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py — add the Requesty ProviderConfig.
  • lib/crewai/tests/llms/openai_compatible/test_openai_compatible.py — add config + factory-routing tests mirroring the OpenRouter cases.
  • docs/edge/en/concepts/llms.mdx — Requesty accordion mirroring OpenRouter, linking requesty.ai / docs.requesty.ai / app.requesty.ai/router/list.
  • .env.test — add REQUESTY_API_KEY placeholder.

Verification: uv run ruff check clean on changed files; uv run pytest tests/llms/openai_compatible/test_openai_compatible.py → 37 passed (including the 2 new requesty tests). A live call to https://router.requesty.ai/v1/chat/completions with model: openai/gpt-4o-mini returned HTTP 200 with a completion.

Disclosure: I work at Requesty. This mirrors the existing OpenRouter provider routing; happy to adjust wording/placement or close if it's not a fit.

Summary by CodeRabbit

  • New Features

    • Added Requesty as a supported LLM provider option (OpenAI-compatible gateway), including correct routing for requesty/... model strings.
  • Documentation

    • Documented Requesty configuration, including the required REQUESTY_API_KEY, example model usage, and base URL (https://router.requesty.ai/v1).
  • Tests

    • Added test coverage validating Requesty provider configuration and that LLM creation returns the OpenAI-compatible completion path for requesty/... models.

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary: This PR adds Requesty as an OpenAI-compatible LLM provider with API key configuration sourced from environment variables and model prefix routing.

Risk: Medium risk. It introduces a new external LLM gateway that may receive prompts and outputs when explicitly configured, but no exploitable authentication, authorization, injection, SSRF, secret-handling, or supply-chain vulnerabilities were identified in the added code.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7864cc87-aa90-4b0b-8a8f-aee43bdc0daf

📥 Commits

Reviewing files that changed from the base of the PR and between 0988a0c and 2856745.

📒 Files selected for processing (1)
  • docs/edge/en/concepts/llms.mdx
✅ Files skipped from review due to trivial changes (1)
  • docs/edge/en/concepts/llms.mdx

📝 Walkthrough

Walkthrough

Requesty is added as a new OpenAI-compatible LLM provider. The provider is registered in OPENAI_COMPATIBLE_PROVIDERS with its base URL and API key config, wired through llm.py routing (provider list, mapping, pattern match, and native-provider dispatch), covered by two new test methods, and documented with a usage example.

Changes

Requesty Provider Integration

Layer / File(s) Summary
Provider registry entry and LLM routing wiring
lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py, lib/crewai/src/crewai/llm.py
OPENAI_COMPATIBLE_PROVIDERS gains a "requesty" entry with base_url, api_key_env, and base_url_env. Module docstring is updated with a requesty usage example. In llm.py, requesty is added to SUPPORTED_NATIVE_PROVIDERS, provider_mapping, _matches_provider_pattern (unconditional branch), and the openai_compatible_providers set in _get_native_provider. The supported providers list in OpenAICompatibleCompletion docstring is updated to include requesty.
Provider registry and LLM integration tests
lib/crewai/tests/llms/openai_compatible/test_openai_compatible.py, .env.test
test_requesty_config asserts all registry fields; test_llm_creates_openai_compatible_for_requesty asserts that LLM(model="requesty/...") returns OpenAICompatibleCompletion with correct provider, model prefix, and base URL. REQUESTY_API_KEY=fake-requesty-key is added to .env.test.
User-facing provider documentation
docs/edge/en/concepts/llms.mdx
Adds a Requesty accordion block with the required environment variable, an example LLM configuration, and an info note explaining the requesty/<provider>/<model> naming pattern.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding Requesty as a new OpenAI-compatible provider to crewAI.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/edge/en/concepts/llms.mdx`:
- Around line 1272-1281: Fix the malformed code fence formatting for the TOML
example by properly opening the code block with triple backticks before "toml
Code", then in the Python code block add the missing import statement for os at
the beginning, and replace the undefined variable reference REQUESTY_API_KEY
with os.getenv("REQUESTY_API_KEY") to ensure the code is valid Python that can
be properly copy-pasted by users.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 18ba2349-ebfc-4569-802a-e87d26e191b5

📥 Commits

Reviewing files that changed from the base of the PR and between 9db2d44 and 0988a0c.

📒 Files selected for processing (5)
  • .env.test
  • docs/edge/en/concepts/llms.mdx
  • lib/crewai/src/crewai/llm.py
  • lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py
  • lib/crewai/tests/llms/openai_compatible/test_openai_compatible.py

Comment thread docs/edge/en/concepts/llms.mdx
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