Repository navigation
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 109 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 |
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
Changes default routing for
together/models from LiteLLM to the native client (opt-out viais_litellm=True), which affects credentials, endpoints, and runtime behavior for existing Together users.Overview
Adds native Together AI support so
LLM(model="together/<org>/<model>")(orprovider="together") routes toOpenAICompatibleCompletioninstead of LiteLLM. Configuration useshttps://api.together.ai/v1,TOGETHER_API_KEY, and optionalTOGETHER_BASE_URL; only thetogether/prefix is stripped soorg/modelids reach the API unchanged.is_litellm=Truestill forces the LiteLLM path.OpenAICompatibleCompletiongains catalog-awareget_context_window_size()(Together maps totogether_ai/in the context window catalog). Docs add a Together AI section in en, ar, ko, and pt-BRllms.mdx.Tests add parametrized
TestHostedProviders(routing, env isolation fromOPENAI_*, sync/async HTTP mocks) and catalog context-window checks; the LiteLLM-only routing example switches fromtogether/tosambanova/.Reviewed by Cursor Bugbot for commit 84b9d9d. Bugbot is set up for automated code reviews on this repo. Configure here.