Use — self-learning (recommended)
As a Strands Agents model provider — every agent turn can change the weights:
from strands import Agent
from strands_tools import shell
from slm import SLM
model = SLM("cagataydev/strands-qwen3-vl-2b")
agent = Agent(tools=[shell], model=model)
agent("use the shell tool to run: echo hello")
Or drive the learning loop directly:
from slm import StrandsPlasticQwen
m = StrandsPlasticQwen.from_pretrained("cagataydev/strands-qwen3-vl-2b", device="cuda")
print(m.chat("How do I create a custom tool in Strands Agents?"))
for doc in your_stream:
m.observe(doc, learn=True)
m.reset()
from transformers import AutoModelForImageTextToText, AutoProcessor
model = AutoModelForImageTextToText.from_pretrained("cagataydev/strands-qwen3-vl-2b", dtype="bfloat16", device_map="cuda")
proc = AutoProcessor.from_pretrained("cagataydev/strands-qwen3-vl-2b")
Results
Measured on a single L40S, seed-replicated. The base is never updated by the plastic layer.
Table with columns: claim, evidence| claim | evidence |
|---|
| Domain expert | strands probe NLL 4.85 → 2.22, 8/8 probes improved; corpus holdout NLL 1.848 → 1.239 |
| Learns while running | continual OOD stream NLL 6.18 → 5.37, pure inference |
| Does not forget | strands expertise after OOD learning: Δ −0.01 |
| Agent competence grows | held-out tasks 0/4 → 4/4 after 18 curated lessons, 5/5 seeds |
| Fact memory | 15/15 facts at 100% verbatim recall |
| Provable off-switch | reset() is bit-identical to this base, Δlogits = 0 |
| Cost | +0.11–0.25 s/turn learning overhead |
Full results, honest limitations, and the demo notebook:
github.com/cagataycali/slm
License: Apache-2.0 (inherits Qwen3-VL license terms).