A
15M parameter decoder-only transformer trained from scratch to handle OKR (Objectives and Key Results) management via tool calls to the
Keyflow MCP API.
1{"tool": "objective", "action": "list", "params": {"cycleId": "cyc_q2_2026", "ownerId": "usr_107"}}
2{"tool": "key_result", "action": "check_in", "params": {"keyResultId": "kr_102", "value": 1}}
3{"tool": "report", "action": "health_check", "params": {"cycleId": "cyc_q2_2026"}}
1import mlx.core as mx
2import mlx.nn as nn
3import sentencepiece as spm
4import json
5
6# Load model
7from architecture import OKRModelConfig, create_model
8
9with open("config.json") as f:
10 config_dict = json.load(f)
11config = OKRModelConfig(**{k: v for k, v in config_dict.items() if k in OKRModelConfig.__dataclass_fields__})
12model = create_model(config)
13weights = mx.load("model.safetensors")
14model.load_weights(list(weights.items()))
15mx.eval(model.parameters())
16
17# Load tokenizer
18sp = spm.SentencePieceProcessor()
19sp.Load("okr_tokenizer.model")
20
21# Inference
22query = "Show me my OKRs"
23context = json.dumps({"userId": "usr_001", "activeCycleId": "cyc_q2_2026"})
24text = f"QUERY: {query} CONTEXT: {context} "
25tokens = mx.array([[sp.bos_id()] + sp.Encode(text)])
26output = model.generate(tokens, max_new_tokens=256, temperature=0.0)
27print(sp.Decode(output[0].tolist()))
1git clone https://github.com/chan4lk/timm
2cd timm
3uv sync
4uv run deploy/server.py model/checkpoints/best
5# Open http://localhost:8800 for the chat UI
1@article{ranaweera2026asms,
2 title={Agent-Specific Model Synthesis: Compiling Task-Bounded Intelligence from Large Language Models into CPU-Deployable Micro-Models},
3 author={Ranaweera, Chandima},
4 year={2026},
5 note={Draft v0.2, Bistec Global}
6}