new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

togetherai/models

17 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Together.ai language model instantiation

Language models are created by calling the provider instance with a model ID as a string, for example `togetherai('google/gemma-2-9b-it')`.

Together.ai supports 200+ open-source models

The Together.ai provider contains support for 200+ open-source models through the Together.ai API.

Together.ai completion and embedding model methods

Together.ai provider supports completion models via `togetherai.completionModel()` and embedding models via `togetherai.embeddingModel()`.

Together.ai image model creation

Image models are created using the `.image()` factory method on the provider instance, for example `togetherai.image('black-forest-labs/FLUX.1-dev')`.

Together.ai image editing models

Supported image editing models: black-forest-labs/FLUX.1-kontext-pro (Production quality, balanced speed), black-forest-labs/FLUX.1-kontext-max (Maximum image fidelity), black-forest-labs/FLUX.1-kontext-dev (Development and experimentation).

Together.ai image generation models

Available image generation models: stabilityai/stable-diffusion-xl-base-1.0, black-forest-labs/FLUX.1-dev, black-forest-labs/FLUX.1-dev-lora, black-forest-labs/FLUX.1-schnell, black-forest-labs/FLUX.1-canny, black-forest-labs/FLUX.1-depth, black-forest-labs/FLUX.1-redux, black-forest-labs/FLUX.1.1-pro, black-forest-labs/FLUX.1-pro, black-forest-labs/FLUX.1-schnell-Free, black-forest-labs/FLUX.1-kontext-pro, black-forest-labs/FLUX.1-kontext-max, black-forest-labs/FLUX.1-kontext-dev.

Together.ai embedding model creation

Embedding models are created using the `.embeddingModel()` factory method on the provider instance, for example `togetherai.embeddingModel('togethercomputer/m2-bert-80M-2k-retrieval')`.

Together.ai reranking model creation

Reranking models are created using the `.reranking()` factory method on the provider instance, for example `togetherai.reranking('mixedbread-ai/Mxbai-Rerank-Large-V2')`.

Together.ai reranking model capabilities

Available reranking model: mixedbread-ai/Mxbai-Rerank-Large-V2.

Together.ai generateText example with language model

Example showing how to use Together.ai language models with `generateText`: imports `togetherai` from `@ai-sdk/togetherai` and `generateText` from `ai`, then calls `generateText` with model `togetherai('meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo')` and prompt 'Write a vegetarian lasagna recipe for 4 people.' to generate text.

Together.ai generateImage example with image model

Example showing how to use Together.ai image models with `generateImage`: imports `togetherai` from `@ai-sdk/togetherai` and `generateImage` from `ai`, then calls `generateImage` with model `togetherai.image('black-forest-labs/FLUX.1-dev')` and prompt 'A delighted resplendent quetzal mid flight amidst raindrops' to generate images.

Together.ai generateImage with provider options example

Example showing how to use `providerOptions` with Together.ai image generation: calls `generateImage` with model `togetherai.image('black-forest-labs/FLUX.1-dev')`, and includes `providerOptions` with `togetherai: { steps: 40 }` where the type is `TogetherAIImageModelOptions`.

Together.ai image editing example with buffer

Example showing image editing with Together.ai FLUX Kontext: uses `readFileSync` to load an image, then calls `generateImage` with model `togetherai.image('black-forest-labs/FLUX.1-kontext-pro')`, prompt object with text 'Turn the cat into a golden retriever dog' and images array containing the image buffer, size '1024x1024', and providerOptions with steps: 28.

Together.ai image editing example with URL

Example showing image editing with Together.ai FLUX Kontext using URL: calls `generateImage` with model `togetherai.image('black-forest-labs/FLUX.1-kontext-pro')`, prompt object with text 'Make the background a lush rainforest' and images array containing URL string 'https://example.com/photo.png', size '1024x1024', and providerOptions with steps: 28.

Together.ai embed example

Example showing how to use Together.ai embedding models with `embed`: imports `togetherai` from `@ai-sdk/togetherai` and `embed` from `ai`, then calls `embed` with model `togetherai.embeddingModel('togethercomputer/m2-bert-80M-2k-retrieval')` and value 'sunny day at the beach' to generate embeddings.

Together.ai rerank example with string documents

Example showing how to use Together.ai reranking models with `rerank`: imports `togetherai` from `@ai-sdk/togetherai` and `rerank` from `ai`, then calls `rerank` with model `togetherai.reranking('mixedbread-ai/Mxbai-Rerank-Large-V2')`, documents array of three strings, query 'talk about rain', and topN: 2 to rerank documents.

Together.ai rerank example with object documents and rankFields

Example showing Together.ai reranking with JSON object documents: calls `rerank` with model `togetherai.reranking('mixedbread-ai/Mxbai-Rerank-Large-V2')`, documents array of objects with fields 'from', 'subject', and 'text', query 'Which pricing did we get from Oracle?', and providerOptions with `togetherai: { rankFields: ['from', 'subject', 'text'] }` of type `TogetherAIRerankingModelOptions` to specify which fields to rank by.

Give your agent this brain