Core Concept: Git History = Model Evolution
In bgit, your git repository doesn’t just track configuration files—it tracks the evolution of your model’s weights. Each commit represents a point in your model’s development journey.Key insight: Commits incrementally grow your model. Branches let you experiment with different evolutionary paths.
Commits = Incremental Model Growth
Every commit in bgit represents a step in your model’s evolution:- You commit configuration changes → This defines what you want to bake
- You run
bgit run→ This executes the baking operations - bgit creates a new commit → This records the resulting model weights
- The cycle repeats → Each bake builds on the previous one
Sequential Bakes
When you run multiple bakes sequentially, each bake automatically uses the previous bake’s model as the parent:PARENT_MODEL is stored in .bread and automatically used. This creates a chain of model evolution tracked in your git history.
Branches = Experiments
Branches in bgit represent parallel evolutionary paths for your model. Each branch can develop independently:- Test different approaches: Try formal vs casual tone on separate branches
- Compare results: Switch between branches to test different models
- Safe experimentation: Experiment without affecting your main model
- Choose the winner: Adopt the best branch’s evolution to main
Branch Merging
When you merge a branch, the incoming branch’s.bread and recipe.yml overwrite the current branch’s versions. This ensures main reflects the complete model state from the merged branch.
Important: You can’t merge model weights like code. You choose one evolutionary path or the other.
Git History = Complete Audit Trail
Your git history provides a complete audit trail of your model’s development:recipe.yml: The Model History File
recipe.yml tracks the history of your model up to the current commit:
- Per-commit: Each commit has its own
recipe.ymlreflecting bakes up to that point - Auto-updated: Automatically updated after each successful bake
- Read-only: Never edit manually—bgit maintains it
- Cross-branch: Use
bgit treeto see bakes across all branches
.bread: Current State Metadata
.bread maintains the mapping between your YAML configuration and Bread SDK resources:
- Tracks prompts, targets, bakes, and their names/IDs
- Stores
PARENT_MODELfor sequential bakes - Auto-generated—never edit manually
- Updated by pre-commit hook when YAML files change
The Three Files
input.yml
You EditYour configuration file. Define prompts, targets, and bake settings here.After successful bakes, this file is cleared (keeping headings) to prepare for the next iteration.
recipe.yml
Auto-generatedComplete history log tracking all bakes and model lineage.Each commit has its own version showing the evolution up to that point.
.bread
Auto-generatedCurrent state metadata mapping YAML to Bread SDK resources.Tracks the parent model for sequential bakes.
The Complete Flow
Time Travel with Git
Git’s history features work perfectly with bgit. You can inspect and test previous model versions:- Compare current vs previous performance
- Understand when behavior changed
- Reproduce specific model states
- Inspect historical configurations
Visualizing Model Lineage
Usebgit tree to visualize your model’s evolution across all branches:
- Reads
recipe.ymlfrom all git branches - Builds a tree showing parent-child relationships
- Displays branch information for each bake
- Shows model names in a hierarchical structure
Key Behaviors
Staging Requirement
bgit run (especially bake) requires changes to be staged. This ensures you’re working with committed configurations:
Automatic Clearing
input.yml is cleared after successful bakes, keeping only section headings and documentation comments. This prepares it for your next iteration.
Model Lineage
Each bake automatically uses the previous bake’s model as the parent (stored in.bread as PARENT_MODEL). This creates a sequential chain of model evolution.
Merge Behavior
When merging branches,.bread and recipe.yml from the incoming branch overwrite the current branch’s versions. This ensures the merged branch reflects the complete model state.
Benefits of Git-Based Model Evolution
- Full History: Every bake is a git commit, providing complete audit trail
- Branch Isolation: Each branch can develop models independently
- Easy Rollback: Use
git revertorgit checkoutto go back to any model state - Collaboration: Standard git workflows (pull requests, code review) work seamlessly
- Lineage Tracking: Each commit’s
recipe.ymlmaintains model relationships