Adapt a large language model to answer math questions in a specific style by training a controller on a few examples, no GPU cluster needed.
Combine a code-generation controller with a concise-writing controller to nudge a model toward both behaviors at the same time.
Store multiple trained task controllers as named memory items and retrieve the right one at generation time based on a text query.
Fine-tune a frozen model for a client-specific task and ship only the tiny controller file instead of a full model copy.
Installable via pip, training runs on consumer hardware in minutes with a simple text file of prompt-completion pairs.
NTK-Mirror is a Python tool for adapting AI language models to specific tasks without modifying the model itself. Most fine-tuning approaches require either rewriting the model's internal weights or attaching extra modules called LoRA adapters. This library takes a different approach: it learns a small set of scaling values, called a controller, that sit on top of the frozen model and adjust how it processes information during a forward pass. The model file stays unchanged, only the controller is saved and loaded. The practical workflow is straightforward. You prepare a set of training examples in a simple text file, each with a prompt and the expected completion. You then run a command to fit a controller on those examples. Once trained, you can attach the controller when generating text, and the model will behave differently than it would without it. The entire adaptation can run in minutes on consumer hardware rather than requiring the large compute budgets that full fine-tuning typically needs. One notable feature is controller composition. Because the scaling values are stored as signed numbers in a particular mathematical coordinate system, you can add two controllers together to combine their effects. For example, if you trained one controller on math problems and another on code generation, you can merge them into a single controller that nudges the model toward both behaviors at once. The library also includes a persistent memory system. You can store individual controllers as named memory items, tag them, and then retrieve the most relevant ones at generation time based on a text query. This lets the model draw on stored task knowledge without needing to put that knowledge into the prompt text. NTK-Mirror is released under the MIT license and is available as a standard Python package installable with pip.
← leochlon on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.