https://github.com/togethercomputer/together-cookbook
A collection of notebooks/recipes showcasing usecases of open-source models with Together AI.
https://github.com/togethercomputer/together-cookbook
Last synced: 26 days ago
JSON representation
A collection of notebooks/recipes showcasing usecases of open-source models with Together AI.
- Host: GitHub
- URL: https://github.com/togethercomputer/together-cookbook
- Owner: togethercomputer
- License: mit
- Created: 2024-10-07T16:28:33.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-07T18:43:10.000Z (28 days ago)
- Last Synced: 2025-04-09T21:14:30.404Z (26 days ago)
- Language: Jupyter Notebook
- Size: 101 MB
- Stars: 830
- Watchers: 17
- Forks: 132
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hacking-lists - togethercomputer/together-cookbook - A collection of notebooks/recipes showcasing usecases of open-source models with Together AI. (Jupyter Notebook)
README
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](https://www.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](https://discord.gg/9Rk6sSeWEG) 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](https://api.together.ai/signin)).
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 ](https://github.com/togethercomputer/together-cookbook/blob/main/Agents/Serial_Chain_Agent_Workflow.ipynb) | Chain multiple LLM calls sequentially to process complex tasks. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Agents/Serial_Chain_Agent_Workflow.ipynb) |
| [Conditional Router Agent Workflow ](https://github.com/togethercomputer/together-cookbook/blob/main/Agents/Conditional_Router_Agent_Workflow.ipynb) | Create an agent that routes tasks to specialized models. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Agents/Conditional_Router_Agent_Workflow.ipynb) |
| [Parallel Agent Workflow ](https://github.com/togethercomputer/together-cookbook/blob/main/Agents/Parallel_Agent_Workflow.ipynb) | Run multiple LLMs in parallel and aggregate their solutions. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Agents/Parallel_Agent_Workflow.ipynb) |
| [Orchestrator Subtask Agent Workflow ](https://github.com/togethercomputer/together-cookbook/blob/main/Agents/Parallel_Subtask_Agent_Workflow.ipynb) | Break down tasks into parallel subtasks to be executed by LLMs. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Agents/Parallel_Subtask_Agent_Workflow.ipynb) |
| [Looping Agent Workflow](https://github.com/togethercomputer/together-cookbook/blob/main/Agents/Looping_Agent_Workflow.ipynb) | Build an agent that iteratively improves responses | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Agents/Looping_Agent_Workflow.ipynb) |
| [Together Open Deep Research](https://github.com/togethercomputer/together-cookbook/blob/main/Agents/Together_Open_Deep_Research_CookBook.ipynb) | An Open Source Deep-Research Implementation with Multi-Step Web Search | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Agents/Together_Open_Deep_Research_CookBook.ipynb) |
| Fine-tuning | | |
| [LoRA Inference and Fine-tuning](https://github.com/togethercomputer/together-cookbook/blob/main/LoRA_Finetuning%26Inference.ipynb) | Perform LoRA fine-tuning and inference on Together AI. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/LoRA_Finetuning%26Inference.ipynb) [](https://youtu.be/AKO7YDcwhiQ?si=ZcOGdDeTRelwIqXd) |
| [Long Context Finetuning For Repetition](https://github.com/togethercomputer/together-cookbook/blob/main/LongContext_Finetuning_RepetitionTask.ipynb) | Fine-tuning LLMs to repeat back words in long sequences. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/LongContext_Finetuning_RepetitionTask.ipynb) |
| [Summarization Long Context Finetuning](https://github.com/togethercomputer/together-cookbook/blob/main/Summarization_LongContext_Finetuning.ipynb) | Long context fine-tuning to improve summarization capabilities. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Summarization_LongContext_Finetuning) |
| [Conversation Finetuning](https://github.com/togethercomputer/together-cookbook/blob/main/Multiturn_Conversation_Finetuning.ipynb) | Fine-tuning LLMs on multi-step conversations. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Multiturn_Conversation_Finetuning.ipynb) |
| Retrieval-augmented generation | | |
| [RAG_with_Reasoning_Models](https://github.com/togethercomputer/together-cookbook/blob/main/RAG_with_Reasoning_Models.ipynb) | RAG + source citations with DeepSeek R1. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/RAG_with_Reasoning_Models.ipynb) |
| [MultiModal_RAG_with_Nvidia_Deck](https://github.com/togethercomputer/together-cookbook/blob/main/MultiModal_RAG_with_Nvidia_Investor_Slide_Deck.ipynb) | Multimodal RAG using Nvidia investor slides | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/MultiModal_RAG_with_Nvidia_Investor_Slide_Deck.ipynb) [](https://youtu.be/IluARWPYAUc?si=gG90hqpboQgNOAYG)|
| [Open_Contextual_RAG](https://github.com/togethercomputer/together-cookbook/blob/main/Open_Contextual_RAG.ipynb) | An implementation of Contextual Retrieval using open models. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Open_Contextual_RAG.ipynb) |
| [Text_RAG](https://github.com/togethercomputer/together-cookbook/blob/main/Text_RAG.ipynb) | Implement text-based Retrieval-Augmented Generation | [](https://colab.research.google/github.com/togethercomputer/together-cookbook/blob/main/Text_RAG.ipynb) |
| Search | | |
| [Multimodal Search and Conditional Image Generation](https://github.com/togethercomputer/together-cookbook/blob/main/Multimodal_Search_and_Conditional_Image_Generation.ipynb) | Text-to-image and image-to-image search and condtional image generation. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Multimodal_Search_and_Conditional_Image_Generation.ipynb) |
| [Embedding_Visualization](https://github.com/togethercomputer/together-cookbook/blob/main/Embedding_Visualization.ipynb) | Visualize vector embeddings | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Embedding_Visualization.ipynb) |
| [Search_with_Reranking](https://github.com/togethercomputer/together-cookbook/blob/main/Search_with_Reranking.ipynb) | Improve search results with rerankers | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Search_with_Reranking.ipynb) |
| [Semantic_Search](https://github.com/togethercomputer/together-cookbook/blob/main/Semantic_Search.ipynb) | Implement vector search with embedding models | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Semantic_Search.ipynb) |
| Miscellaneous | | |
| [Thinking_Augmented_Generation](https://github.com/togethercomputer/together-cookbook/blob/main/Thinking_Augmented_Generation.ipynb) | Give R1 thinking tokens to small models | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Thinking_Augmented_Generation.ipynb) |
| [Flux LoRA Inference](https://github.com/togethercomputer/together-cookbook/blob/main/Flux_LoRA_Inference.ipynb) | Generate images with fine-tuned Flux LoRA's | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Flux_LoRA_Inference.ipynb) |
| [Structured_Text_Extraction_from_Images](https://github.com/togethercomputer/together-cookbook/blob/main/Structured_Text_Extraction_from_Images.ipynb) | Extract structured text from images | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Structured_Text_Extraction_from_Images.ipynb) |
| [Summarization Evaluation](https://github.com/togethercomputer/together-cookbook/blob/main/Summarization_Evaluation.ipynb) | Summarizing and evaluating outputs with LLMs. | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Summarization_Evaluation.ipynb) |
| [PDF_to_Podcast](https://github.com/togethercomputer/together-cookbook/blob/main/PDF_to_Podcast.ipynb) | Generate a podcast from PDF content NotebookLM style! | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/PDF_to_Podcast.ipynb) |
| [Knowledge_Graphs_with_Structured_Outputs](https://github.com/togethercomputer/together-cookbook/blob/main/Knowledge_Graphs_with_Structured_Outputs.ipynb) | Get LLMs to generate knowledge graphs | [](https://colab.research.google.com/github/togethercomputer/together-cookbook/blob/main/Knowledge_Graphs_with_Structured_Outputs.ipynb) |## Explore Further
Looking for more resources to enhance your experience with open source models? Check out these helpful links:
- [Together AI developer documentation](https://docs.together.ai/docs/introduction)
- [Together AI API support docs](https://docs.together.ai/reference/chat-completions-1)
- [Together AI Discord community](https://discord.gg/9Rk6sSeWEG)## Additional Resources
- [Together AI Research](https://www.together.ai/research): Explore papers and technical blog posts from our research team.
- [Together AI Blog](https://www.together.ai/blog): Explore technical blogs, product announcements and more on our blog.