Jupyter Notebook MIT

together-cookbook

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

T

togethercomputer

Dernière activité 25 sept. 2026
togethercomputer/together-cookbook

1,2 k

étoiles

220

forks

6

issues ouvertes

Ce README est souvent en anglais.

Platform • Docs • Blog • Discord

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
Inference: chat and text
Thinking Augmented Generation Give R1 thinking tokens to small models. Colab
Summarization Evaluation Summarize and evaluate outputs with LLMs. Colab
Inference: vision
Multimodal RAG with Nvidia Slide Deck Multimodal RAG using Nvidia investor slides. Colab
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
Structured Text Extraction from Images Extract structured text from images. Colab
Inference: image generation
Multimodal Search and Conditional Image Generation Text-to-image and image-to-image search and conditional image generation. Colab
Inference: structured outputs
Knowledge Graphs with Structured Outputs Get LLMs to generate knowledge graphs. Colab
Inference: batch
Batch Inference & Evals Batch inference and evaluation workflows. Colab
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
Cross-Provider Advisor Agent Workflow A cheap Together executor does the work and only consults a frontier Claude advisor when it gets stuck. Colab
Together Open Deep Research An open source deep-research implementation with multi-step web search. 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
Tool Use with Toolhouse Use Toolhouse tools with Together's function-calling models. Colab
Apps
PDF to Podcast Generate a podcast from PDF content (NotebookLM-style). Colab
Fine-tuning
End-to-end Fine-tuning Guide Fine-tuning basics and best practices. 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
Evaluations
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
Dedicated endpoints
Grafana Dashboard for Dedicated Endpoints Monitor dedicated endpoints in Grafana with an importable example dashboard.
OpenEnv
OpenEnv GRPO BlackJack Train Blackjack policies via GRPO using OpenEnv on Together. —

Repository layout

Folders mirror the product areas in the Together AI docs. New notebooks go in the folder for the product they demonstrate:

  • inference/: examples that call the inference APIs, grouped by capability (chat/, vision/, image-generation/, structured-outputs/, batch/). These run on serverless models or on dedicated model inference by swapping the model parameter.
  • agents/: agent workflow patterns and framework integrations (LangGraph, DSPy, PydanticAI, Agno, tool providers such as Arcade, Composio, Klavis, and Toolhouse).
  • apps/: end-to-end demo apps that back the Build apps guides.
  • fine-tuning/: fine-tuning jobs, from the end-to-end guide to DPO, continual, long-context, and vision-language runs.
  • evaluations/: the Evaluations API (classification, comparison, prompt, and judge-tuning evals).
  • dedicated-endpoints/: operating dedicated endpoints (monitoring, dashboards, deploys), as opposed to calling a model.
  • openenv/: OpenEnv reinforcement-learning environments.
  • archived/: notebooks that no longer run on the platform (see below).
  • images/ and datasets/: shared assets referenced by notebooks across folders.

Folders with runnable scripts rather than notebooks carry a ci.yaml manifest for execution CI (see .ci/run_examples.py).

Docs-backed demos

Several code demos in the Together AI documentation are backed folders or notebooks in this repo. The docs page is the source of truth for the explanation, and the cookbook holds the full runnable code.

Archived notebooks

Notebooks that depend on models no longer available on the platform, or that have been superseded, move to archived/ instead of rotting in place. Archived notebooks are excluded from execution CI and from the table above. See archived/README.md for what was archived and why. Don't link to archived notebooks from the docs.

Explore Further

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

Additional Resources

Projets similaires

Open-source AI cookbook

Jupyter Notebook
Hhuggingface
2,7 k étoiles418

A collection of notebooks/recipes showcasing some fun and effective ways of using Claude.

Jupyter Notebook
Aanthropics
53,1 k étoiles6,4 k

Examples and guides for using the OpenAI API

Jupyter Notebookchatgptgpt-4openai
Oopenai
76,3 k étoiles12,9 k