Together AI supports the OpenAI client, allowing you to use the openai-generic provider with an overridden base_url.

See https://docs.together.ai/docs/openai-api-compatibility for more information.

BAML
1client<llm> MyClient {
2 provider "openai-generic"
3 options {
4 base_url "https://api.together.ai/v1"
5 api_key env.TOGETHER_API_KEY
6 model "meta-llama/Llama-3-70b-chat-hf"
7 }
8}