Skip to content

togethercomputer/together-cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

320 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlatformDocsBlogDiscord

Together Cookbook

The Together Cookbook is a collection of code and guides designed to help developers build with open source models using Together AI. The best way to use the recipes is to copy code snippets and integrate them into your own projects!

Contributing

We welcome contributions to this repository! If you have a cookbook you'd like to add, please reach out to use the Discord or open a pull request!

Prerequisites

To make the most of the examples in this cookbook, you'll need a Together AI API key (sign up for free here).

While the code examples are primarily written in Python/JS, the concepts can be adapted to any programming language that supports interaction with the Together API.

Cookbooks

Cookbook Description Open
Agents
Serial Chain Agent Workflow Chain multiple LLM calls sequentially to process complex tasks. Colab
Conditional Router Agent Workflow Create an agent that routes tasks to specialized models. Colab
Parallel Agent Workflow Run multiple LLMs in parallel and aggregate their solutions. Colab
Orchestrator Subtask Agent Workflow Break down tasks into parallel subtasks executed by LLMs. Colab
Looping Agent Workflow Build an agent that iteratively improves responses. Colab
Together Open Deep Research An open source deep-research implementation with multi-step web search. Colab
Together Open Data Science Agent An open data-science agent that analyzes datasets end-to-end. Colab
Agno Agents Build agents with the Agno framework on Together. Colab
Arcade Agents Build agents with Arcade.dev tool integrations. Colab
Composio Agents Use Composio tools to build production-grade agents. Colab
DSPy Agents Build optimized agents with DSPy and Together models. Colab
Klavis AI Agents Use Klavis AI to give agents access to MCP-based tools. Colab
Agentic RAG with LangGraph Build an agentic RAG pipeline with LangGraph. Colab
LangGraph Planning Agent Build a plan-and-execute agent with LangGraph. Colab
PydanticAI Agents Build type-safe agents with PydanticAI and Together. Colab
Evals
Classification Evals LLM-as-a-Judge for safety evaluation and classification tasks. Colab
Compare Evals Head-to-head model comparison on summarization tasks. Colab
Prompt Evals Prompt optimization through A/B testing and comparison. Colab
Optimizing LLM Judges Tune LLM-as-judge configurations for better alignment with humans. Colab
GEPA Optimization Optimize prompts via genetic prompt evolution (GEPA) on Together. Colab
Fine-tuning
End-to-end Fine-tuning Guide Fine-tuning basics and best practices. Colab
LoRA Inference and Fine-tuning Perform LoRA fine-tuning and inference on Together AI. Colab
Preference Tuning - DPO Fine-tuning LLMs with preference data using DPO. Colab
Continual Fine-tuning Continuously fine-tune model checkpoints on new data. Colab
Function Calling Fine-tuning Fine-tune LLMs for tool/function-calling use cases. Colab
Reasoning Fine-tuning Fine-tune LLMs with reasoning traces. Colab
Vision-Language Fine-tuning Fine-tune VLMs on image+text data. Colab
Long Context Fine-tuning for Repetition Fine-tune LLMs to repeat back words in long sequences. Colab
Summarization Long Context Fine-tuning Long context fine-tuning to improve summarization. Colab
Multi-turn Conversation Fine-tuning Fine-tune LLMs on multi-step conversations. Colab
Retrieval-augmented generation
RAG with Reasoning Models RAG + source citations with DeepSeek R1. Colab
Multimodal RAG with Nvidia Slide Deck Multimodal RAG using Nvidia investor slides. Colab
Open Contextual RAG An implementation of Contextual Retrieval using open models. Colab
Contextual RAG on Union Deploy a contextual RAG service end-to-end on Union.ai. Colab
Text RAG Text-based Retrieval-Augmented Generation. Colab
Search
Multimodal Search and Conditional Image Generation Text-to-image and image-to-image search and conditional image generation. Colab
Embedding Visualization Visualize vector embeddings. Colab
Search with Reranking Improve search results with rerankers. Colab
Semantic Search Vector search with embedding models. Colab
Multimodal — Vision
OCR Text extraction, multilingual OCR, and text spotting with Qwen3-VL. Colab
2D Grounding Object detection with 2D bounding boxes and point grounding. Colab
3D Grounding 3D bounding boxes, camera parameters, depth perception. Colab
Spatial Understanding Object relationships, affordances, embodied reasoning. Colab
Video Understanding Video description, temporal localization, video Q&A. Colab
Omni Recognition Universal recognition for celebrities, anime, food, landmarks. Colab
Document Parsing Convert documents to HTML/Markdown with coordinates. Colab
Image to Code Screenshot to HTML, chart to matplotlib code. Colab
Long Document Understanding Multi-page PDF analysis and Q&A. Colab
Examples
Together Code Interpreter Execute code with Together Code Interpreter (TCI). Colab
Thinking Augmented Generation Give R1 thinking tokens to small models. Colab
Flux LoRA Inference Generate images with fine-tuned Flux LoRAs. Colab
Structured Text Extraction from Images Extract structured text from images. Colab
Summarization Evaluation Summarize and evaluate outputs with LLMs. Colab
PDF to Podcast Generate a podcast from PDF content (NotebookLM-style). Colab
Knowledge Graphs with Structured Outputs Get LLMs to generate knowledge graphs. Colab
Getting Started with Llama 4 Get started with Llama 4 models. Colab
Batch Inference & Evals Batch inference and evaluation workflows. Colab
Third-Party Integrations
Tool Use with Toolhouse Use Toolhouse tools with Together's function-calling models. Colab
OpenEnv
OpenEnv Code Interpreter An OpenEnv environment that wraps the Together Code Interpreter.
OpenEnv GRPO BlackJack Train Blackjack policies via GRPO using OpenEnv on Together.

Explore Further

Looking for more resources to enhance your experience with open source models? Check out these helpful links:

Additional Resources

About

A collection of notebooks/recipes showcasing usecases of open-source models with Together AI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages