Repository navigation
feat(llms): add together as an openai-compatible provider - #8015
Nagizaaz Shaik (shaikn6) wants to merge 11 commits into
Conversation
Register together in the OpenAI-compatible provider registry so LLM(model="together/<org>/<model>") and provider="together" route natively through OpenAICompatibleCompletion with TOGETHER_API_KEY and no LiteLLM install. TOGETHER_BASE_URL overrides the endpoint, explicit api_key/base_url win over both env vars, and OPENAI_* settings are never used. Only the together/ prefix is removed, so org/model ids reach the API intact; no model catalog is hard-coded. is_litellm=True keeps the LiteLLM path. The test that used together/ as a LiteLLM-only prefix now uses sambanova/. A Together AI docs accordion is added in en, ar, ko and pt-BR. Fixes crewAIInc#8011
Strix Security ReviewWarning This pull request has 238 commits after the last Strix review ( No security issues found. Review summaryPR #8015 registers Updated for Reviewed by Strix |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
Routing together natively sent its models through the OpenAI-only lookup, which resolves 72 of the 79 together_ai ids in the catalog to a different limit than the catalog lists. The lookup now uses the catalog's name for the provider with the model id first and the id as given second.
|
Merged main and added a context-window lookup that follows #8077. Once |
|
Brought the branch up to date with |
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b358dfb. Configure here.
Signed-off-by: Nagizaaz Shaik <176337212+shaikn6@users.noreply.github.com> # Conflicts: # lib/crewai/tests/llms/openai_compatible/test_openai_compatible.py
Signed-off-by: Nagizaaz Shaik <176337212+shaikn6@users.noreply.github.com>
…xtra Signed-off-by: Nagizaaz Shaik <176337212+shaikn6@users.noreply.github.com>

Related issue
Fixes #8011
Summary
Registers
togetherinOPENAI_COMPATIBLE_PROVIDERSand the factory routing tables (SUPPORTED_NATIVE_PROVIDERS,PROVIDER_ALIASES,_matches_provider_pattern,_get_native_provider), following the DeepInfra change in #7459.LLM(model="together/<org>/<model>")andprovider="together"now buildOpenAICompatibleCompletionwithout LiteLLM.https://api.together.ai/v1, key fromTOGETHER_API_KEY, optionalTOGETHER_BASE_URLoverride.api_key/base_urltake precedence over the env vars;OPENAI_API_KEY/OPENAI_BASE_URLare never used, and a missing key raises an error namingTOGETHER_API_KEY.together/prefix is removed, soorg/modelids reach the SDK intact. No model catalog is hard-coded.is_litellm=Truestill selects the LiteLLM path.Verification
New
TestHostedProvidersintests/llms/openai_compatible/test_openai_compatible.py, parametrized by provider. It covers config, prefixed and explicit-provider routing (org/modelpreserved), OpenAI env isolation, missing-key error,TOGETHER_BASE_URL, explicit precedence, theis_litellm=Truepath, and sync and async calls through anhttpx.MockTransportthat checks the URL,Authorizationheader and model id sent. No network or paid calls.test_prefixed_models_with_non_native_providers_use_litellmusedtogether/as a LiteLLM-only example; it now usessambanova/.With the source change reverted, 7 of the new tests fail.
ruff checkon the changed source files is clean.Additional context
The same test class is introduced by #8013 (Groq) and #8014 (Fireworks AI); whichever merges later needs a one-row rebase of
HOSTED_PROVIDER_CASES, which I'll handle.Docs: there was no Together AI section, so this adds one after Fireworks AI in
docs/edge/{en,ar,ko,pt-BR}/concepts/llms.mdx, with the native-client note, both env vars, an example and a link to Together's model list. Frozendocs/v*/snapshots are unchanged.Prepared with AI assistance (Claude Code), per CONTRIBUTING. I don't have permission to apply the
llm-generatedlabel, so could a maintainer add it?Note
Medium Risk
Touches core LLM factory routing and credentials for a new native provider; risk is moderate but mitigated by broad new tests and no changes to existing provider defaults.
Overview
Adds Together AI as a first-class native OpenAI-compatible LLM provider so
together/<org>/<model>routes toOpenAICompatibleCompletionwithout LiteLLM (whileis_litellm=Truestill uses LiteLLM).Wiring includes
TOGETHER_API_KEY/ optionalTOGETHER_BASE_URL, CLI native-provider registration, and context-window resolution via thetogether_ai/catalog names. Docs gain a Together AI accordion inllms.mdx(en, ar, ko, pt-BR).Tests add hosted-provider coverage (routing, env isolation, sync/async request shape) and Together context-window checks; the LiteLLM-only prefix example switches from
together/tosambanova/.Reviewed by Cursor Bugbot for commit 5f4ce4a. Bugbot is set up for automated code reviews on this repo. Configure here.