Views
No views yet
{"tool": "gt_nudge", "args": {"target": "gastown/furiosa", "message": "No progress detected."}}| Spec | Value |
|---|---|
| Base model | ibm-granite/granite-4.0-h-350m |
| Parameters | 350M |
| Architecture | Hybrid Mamba2/Transformer (4 attention + 28 Mamba2 layers) |
| Context window | 128K tokens |
| Training | Full fine-tune, 3 epochs, bf16 |
| Training loss | 0.346 |
| Eval token accuracy | 91.0% |
| Tool selection accuracy | 16/16 (100%) |
| Avg inference latency | ~4.5s (RTX 3060, PyTorch) |
gt_polecat_list, gt_polecat_nuke, gt_peek, gt_session_status,
gt_nudge, gt_mail_inbox, gt_mail_read, gt_mail_send,
gt_patrol_report, gt_handoff, gt_escalate,
bd_show, bd_list, bd_close, bd_children,
check_git_state, check_tmux_session, bash, none1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model = AutoModelForCausalLM.from_pretrained(
5 "dunks/granite-350m-witness",
6 dtype=torch.bfloat16,
7 trust_remote_code=True,
8).to("cuda").eval()
9
10tokenizer = AutoTokenizer.from_pretrained("dunks/granite-350m-witness", trust_remote_code=True)
11
12messages = [
13 {"role": "system", "content": 'You are a Witness agent. Respond ONLY with JSON: {"tool": "<name>", "args": {}}'},
14 {"role": "user", "content": "Polecats\n\n ● gastown/furiosa working\n\nLast activity: 45 minutes ago. No progress."},
15]
16
17prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
18inputs = tokenizer(prompt, return_tensors="pt")
19inputs = {k: v.to("cuda") for k, v in inputs.items()}
20
21with torch.no_grad():
22 out = model.generate(**inputs, max_new_tokens=100, do_sample=False)
23
24print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
25# {"tool": "gt_nudge", "args": {"target": "gastown/furiosa", "message": "Are you still working? No progress detected."}}1# Serve locally
2python api_server.py --config serve.yaml
3
4# Query
5curl http://127.0.0.1:8081/v1/chat/completions \
6 -H "Content-Type: application/json" \
7 -d '{"model": "witness", "messages": [...]}'| Scenario | Tool Selected | Correct |
|---|---|---|
| Idle patrol | gt_patrol_report | Yes |
| Healthy polecat | gt_patrol_report | Yes |
| Stuck polecat (45min) | gt_nudge | Yes |
| Completed polecat | gt_mail_send | Yes |
| Crash loop (4 restarts) | gt_mail_send | Yes |
| Unpushed work | gt_mail_send | Yes |
| Infrastructure down | gt_mail_send | Yes |
| Idle with mail | gt_mail_send | Yes |
| Polecat done notification | gt_mail_send | Yes |
| Lifecycle shutdown | gt_polecat_nuke | Yes |
| Merged notification | bd_close | Yes |
| Help request | gt_mail_send | Yes |
| Zombie polecat | gt_mail_send | Yes |
| Stale spawn (20min) | gt_escalate | Yes |
| Orphaned bead | gt_mail_send | Yes |
| Full infra down | gt_mail_send | Yes |
mamba-ssm and causal-conv1d for efficient Mamba2 CUDA kernels during trainingtrust_remote_code=True required for Granite hybrid architecture