Skip to content

AI-Maker-Space/Tinker-AIM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Makerspace - Tinker API Workshop

What is Tinker?

Tinker is an API from Thinking Machines Lab that provides direct access to LLM training primitives. Unlike inference-only APIs, Tinker lets you fine-tune and train language models programmatically.

Tinker enables you to:

  • Access low-level training operations (forward_backward(), optim_step(), sample(), save_state())
  • Fine-tune models using LoRA without managing infrastructure
  • Experiment with custom training loops and reward functions
  • Build and iterate on ML research ideas quickly

About This Workshop

This hands-on workshop introduces the Tinker API through a practical demo. You'll learn how to use Tinker's training primitives to improve a language model's capabilities in real-time.

What You'll Learn

Through practical examples in the guess_number_demo.ipynb, you'll explore:

  1. Tinker's Core API - Understanding the training primitives
  2. Sampling - Generating outputs from your model
  3. Training Steps - Running forward/backward passes and optimizer steps
  4. Custom Training Loops - Building your own training logic

Why This Matters

Tinker democratizes access to LLM training by providing:

  • Accessibility - Train models without managing GPU clusters
  • Flexibility - Full control over the training process
  • Experimentation - Rapid iteration on training ideas
  • Education - Learn how LLM training actually works

Whether you're a researcher, hobbyist, or developer, Tinker opens up LLM training in a way that wasn't previously accessible.

Setup Instructions

1. Install Dependencies

uv sync

2. Get Your Tinker API Key

  1. Sign up at auth.thinkingmachines.ai/sign-up
  2. Verify your email - Check your inbox for a verification link
  3. Log in to the Tinker Console
  4. Create an API key - Navigate to the API Keys section and generate a new key
  5. Save your key - Copy the key immediately (you won't be able to see it again)

3. Configure Your Environment

Create a .env file in the project root:

echo "TINKER_API_KEY=your_key_here" > .env

Or manually create .env with:

TINKER_API_KEY=your_api_key_here

4. Run the Demo

uv run jupyter lab guess_number_demo.ipynb

Workshop Structure

The notebook is organized into focused sections:

  • Setup & Configuration - API keys and environment preparation
  • Understanding Tinker - Overview of the API and its primitives
  • Sampling - Generating model outputs
  • Training - Running training steps with custom rewards
  • Evaluation - Measuring model improvement

Key Takeaways

By completing this workshop, you'll understand how to:

  • Connect to and authenticate with Tinker's API
  • Use sample() to generate model outputs
  • Run forward_backward() and optim_step() for training
  • Build custom training loops for your own use cases
  • Apply Tinker to your own ML projects

Resources

Files

  • guess_number_demo.ipynb - Main demo notebook
  • main.py - Supporting Python code
  • .env - Your API key (not tracked in git)

Start exploring Tinker by opening the notebook and running through the examples!

About

Tinker API workshop demo for AI Makerspace

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors