Skip to content

feat: make every adapter reproducible from a PEFT or Unsloth recipe - #40

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/27-adapter-tooling
Oct 4, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/27-adapter-tooling

Conversation

@Yash-Chindam

Copy link
Copy Markdown
Owner

What

Closes the adapter half of the model lifecycle in the spec (§6, §7.5): "PEFT/Unsloth creates LoRA or QLoRA adapters" from "immutable base-model revisions".

How

  • config/adapters/<id>.yaml: one reviewed recipe per catalog adapter, holding the base commit, dataset version and LoRA hyperparameters.
  • llm_router.adapters:
    • check fails when a catalog adapter has no recipe, or a recipe names a different base, dataset, domain or quantization than its catalog entry. CD runs it.
    • plan prints the exact arguments PEFT (LoraConfig, BitsAndBytesConfig) or Unsloth (from_pretrained, get_peft_model) would be given.
    • train runs the job with whichever framework the recipe selects.
    • register runs the artifact scan on a finished adapter and prints its catalog entry: stage development, no measured gain, revision equal to the artifact's digest.
  • A recipe is rejected if its base revision is a branch or tag rather than a commit, or if its rank is above what the serving configuration loads.
  • Training never writes checkpoints into the artifact, since they carry pickled optimizer state the scanner would refuse.

Tests

tests/unit/test_adapters.py (22 tests): committed recipes agree with the catalog; each kind of disagreement is reported; unreproducible or unservable recipes are rejected; PEFT and Unsloth arguments; scan-gated registration; CLI. 100% coverage of everything except train.

Limits

  • train has never been executed. It needs a GPU and the training extra; it is written against the documented PEFT, Transformers and Unsloth interfaces and excluded from coverage.
  • hf_repo and hf_revision in the committed recipes are placeholders, because the catalog's base models are mocks.
  • The training datasets the recipes point at are not in this repository.

🤖 Generated with Claude Code

Yash-Chindam and others added 2 commits October 4, 2026 11:54
Add a reviewed recipe per catalog adapter, check recipes against the
catalog in CD, render the PEFT and Unsloth arguments a run would get, and
register a finished adapter only after it passes the artifact scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot merged commit 3faf01c into main Oct 4, 2026
6 checks passed
@github-actions
github-actions Bot deleted the feat/27-adapter-tooling branch October 4, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant