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