AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing thinking-machines-lab/tinker-cookbook in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewTinker Cookbook We provide two libraries for the broader community to customize their language models: and . • is a training SDK for researchers and developers to fine-tune language models. You send API requests to us and we handle the complexities of distributed training. • includes realistic examples of fine-tuning language models. It builds on the Tinker API and provides common abstractions to fine-tune language models. Installation • Sign up for Tinker here. • Once you have access, create an API key from the console and export it as environment variable . • Install (includes the SDK as a dependency): Tinker Refer to the docs to start from basics. Here we introduce a few Tinker primitives - the basic components to fine-tune LLMs: See tinker_cookbook/recipes/sl_loop.py and tinker_cookbook/recipes/rl_loop.py for minimal examples of using these primitives to fine-tune LLMs. To download the weights of any model: Tinker Cookbook Besides these primitives, we also offer **Tinker Cookbook** (a.k.a. this repo), a library of a wide range of abstractions to help you customize training environments. and contain minimal examples to configure supervised learning and reinforcement learning. We also include a wide range of more sophisticated examples in the folder: • **Chat supervised learning**: supervised fine-tuning on conversational datasets like Tulu3. • **Math reasoning**: improve LLM reasoning capability by rewarding it for answering math questions correctly. • **Preference learning**: showcase a three-stage RLHF pipeline: 1) supervised fine-tuning, 2) learning a reward model, 3) RL against the reward model. • **Tool use**: train LLMs to better use retrieval tools to answer questions more accurately. • **Prompt distillation**: internalize long and complex instructions into LLMs. • **Multi-Agent**: optimize LLMs to play against another LLM or themselves. These examples are located in each subfolder, and their files will walk you through the key implementation details, the commands to run them, and the expected performance. Documentation The directory contains a mirror of the Tinker documentation. These files are synced from our internal documentation site. **Note:** The documentation files use MDX format (Markdown with JSX), which includes some syntax that isn't standard Markdown. You may see things like statements, components, or curly-brace expressions. These are artifacts of our documentation framework - the actual content should still be readable as Markdown. If you find errors or want to improve the documentation, feel free to submit a PR editing files in . We'll sync the changes back to our documentation site. For the rendered documentation, visit tinker-docs.thinkingmachines.ai. Import our utilities Tinker cookbook includes several utilities. Here's a quick overview: • converts tokens from/to structured chat message objects • helps calculate hyperparameters suitable for LoRAs • provides abstractions for evaluating Tinker models and shows how to integrate with InspectAI to make evaluating on standard benchmarks easy. Development Setup This installs dev dependencies and registers pre-commit hooks that run formatting and linting on every commit. CI enforces these checks on all pull requests. Contributing This project is built in the spirit of open science and collaborative development. We believe that the best tools emerge through community involvement and shared learning. We welcome PR contributions after our private beta is over. If you have any feedback, please email us at tinker@thinkingmachines.ai. Citation If you use Tinker for your research, please cite it as: Or use this BibTeX citation: