feat: add Together AI as a supported model provider#3376
Merged
Conversation
Add together as a built-in OpenAI-compatible alias provider, following the fireworks/cerebras pattern. Registers the alias (base URL https://api.together.xyz/v1, token TOGETHER_API_KEY), auto-detection in cloudProviders, default model meta-llama/Llama-3.3-70B-Instruct-Turbo, schema and docs updates, an example config, and tests. Together AI fronts open-weight models (Llama, Qwen, DeepSeek, Kimi) whose chat templates may reject more than one leading system message, so it is added to openModelHostProviders to coalesce consecutive system messages (#2327/#3145/#3344). It is validated end-to-end by the shared openAIAliasProviders table test. models.dev catalogs Together AI under the "togetherai" id rather than "together", so it is exempted in modelsDevAbsentProviders like fireworks. Also removes the openai/repro_issue3344_test.go scratch file, moving its reusable shouldMergeConsecutiveMessages gating test and preserving the openai+base_url (vLLM) merge regression in system_message_merge_test.go. Closes #3348
1f50f1a to
120529b
Compare
feat: add Hugging Face Inference Providers as a supported model provider
dgageot
approved these changes
Jul 1, 2026
ronan-thibaut-glitch
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class support for Together AI as an OpenAI-compatible model provider via the alias map, following the existing fireworks/cerebras pattern.
Closes #3348
Definition of Done
together(openai,https://api.together.xyz/v1,TOGETHER_API_KEY)pkg/model/provider/aliases.goIsCatalogProvider("together")is trueTestCatalogAliases(togetherrow),pkg/model/provider/aliases_test.goCatalogProviders()BaseURL)aliases.gotask testandtask lintpassexamples/together.yamlBeyond the stated DoD, this also wires auto-detection, a default model, the JSON schema, and the provider docs, mirroring how Fireworks/Cerebras/DeepSeek were added.
Design decisions
openModelHostProviders(system-message coalescing)modelsDevAbsentProviders(example test)togetherai, nottogether, so the example-validation lookup is skipped — the same treatment asfireworks. No custom catalog-name mapping was added, keeping Together consistent with its sibling providers.cerebras, beforeamazon-bedrockmeta-llama/Llama-3.3-70B-Instruct-Turbotogetheraicatalog.pkg/model/provider/openai/repro_issue3344_test.go(scratch repro file)TestShouldMergeConsecutiveMessages_Gatingand an equivalent openai+base_url (vLLM) merge regression were moved into the properly-namedsystem_message_merge_test.go, so no coverage is lost.Tests
TestCatalogAliases(together)TestOpenAIAliasProvider_EndToEndRequest(together)Bearer TOGETHER_API_KEY,/chat/completionsroute, verbatim model, stream reassembly, and that consecutive system messages are coalesced into one.TestOpenAIAliasProvider_LiveAPI(together)TOGETHER_API_KEYis set, so the default run stays hermetic.TestShouldMergeConsecutiveMessages_Gating(together)together.auto_test.gocasesDefaultModels.TestParseExamplesexamples/together.yaml.Validation
task buildtask lint(golangci-lint + custom cops)go test ./...