Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

feat: APR export serialization — real LoRA adapter files (Fixes #60)#64

Open
noahgift wants to merge 1 commit into
banco-real-trainingfrom
banco-apr-export-v2
Open

feat: APR export serialization — real LoRA adapter files (Fixes #60)#64
noahgift wants to merge 1 commit into
banco-real-trainingfrom
banco-apr-export-v2

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Summary

  • Training now returns AdapterWeights (LoRA A/B tensors from real AdamW steps)
  • Export handler writes real APR files via aprender::serialization::apr::AprWriter
  • Files written to ~/.banco/exports/ with correct tensor shapes and metadata
  • size_bytes populated with actual file size (was hardcoded 0)

Five-Whys

  1. Why size_bytes=0? — No file written
  2. Why no file? — No weights to serialize
  3. Why no weights? — Training was simulated (PR feat: real AdamW optimizer steps in training — no more simulated decay (Fixes #59) #63 fixed this)
  4. Why not serialized? — AprWriter never called
  5. Fix: Store adapter weights in TrainingRun, write APR on export

Dependencies

Test plan

  • All 356 L1 tests pass
  • Clippy clean

🤖 Generated with Claude Code

…les (Fixes #60)

Five-whys: export returned path with size_bytes=0 because no weights
existed. Now training returns AdapterWeights (LoRA A/B tensors) and
export writes real APR files via aprender::serialization::apr::AprWriter.

- AdapterWeights struct stores trained LoRA A/B matrices
- TrainingResult bundles metrics + optional weights
- write_apr_adapter() serializes to ~/.banco/exports/*.apr
- APR metadata includes format="lora-adapter" and lora_rank

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant