Try it
Copy the code ↓- Data source
- Decision schema
- Model inference
- Structured result
2 Decision schema 4 typed questions
micro_actionchoiceheal_allynuke_enemystunattackfall_backfocus_targetchoicetank_attackercasterlowest_hpnonedangerscoresafecontesteddangerouslethalmacro_overridenoulprobability 0–1
3 Model inference typesafe/jev-1.13
Waiting for a run.
4 Structured result
Raw JSON
Run the demo to see the JSON answers, the highlighted pick and the final action.
FLATKEY_API_KEY and run.curl -sS https://router.flatkey.ai/api/alpha/decisions \
-H "Authorization: Bearer $FLATKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "typesafe/jev-1.13",
"state": "Your caster: HP 60%, heal/damage coil ready, stun on cooldown. Allied tank at 15% HP in melee, hit by two enemy melee units; an enemy healer stands behind them. Macro order: hold the ramp until reinforcements arrive in 20 seconds.",
"questions": {
"micro_action": {
"type": "choice",
"instructions": "What should this unit do right now?",
"criteria": {
"heal_ally": "Use a healing ability on a wounded ally",
"nuke_enemy": "Use a damage ability on an enemy",
"stun": "Use a crowd-control ability to stop an enemy",
"attack": "Basic attack on the focus target",
"fall_back": "Move away to safety"
}
},
"focus_target": {
"type": "choice",
"instructions": "Which enemy should this unit prioritize?",
"criteria": {
"tank_attacker": "The enemy attacking our most wounded unit",
"caster": "An enemy spellcaster or healer",
"lowest_hp": "The enemy closest to dying",
"none": "No enemy should be targeted this tick"
}
},
"danger": {
"type": "score",
"instructions": "How dangerous is this unit'\''s position?",
"criteria": [
"safe",
"contested",
"dangerous",
"lethal"
]
},
"macro_override": {
"type": "noul",
"instructions": "The fight is going badly enough that the macro planner should change the army'\''s orders."
}
}
}'// Node.js 18+ (built-in fetch). Run: FLATKEY_API_KEY=... node jev.mjs
const body = {
"model": "typesafe/jev-1.13",
"state": "Your caster: HP 60%, heal/damage coil ready, stun on cooldown. Allied tank at 15% HP in melee, hit by two enemy melee units; an enemy healer stands behind them. Macro order: hold the ramp until reinforcements arrive in 20 seconds.",
"questions": {
"micro_action": {
"type": "choice",
"instructions": "What should this unit do right now?",
"criteria": {
"heal_ally": "Use a healing ability on a wounded ally",
"nuke_enemy": "Use a damage ability on an enemy",
"stun": "Use a crowd-control ability to stop an enemy",
"attack": "Basic attack on the focus target",
"fall_back": "Move away to safety"
}
},
"focus_target": {
"type": "choice",
"instructions": "Which enemy should this unit prioritize?",
"criteria": {
"tank_attacker": "The enemy attacking our most wounded unit",
"caster": "An enemy spellcaster or healer",
"lowest_hp": "The enemy closest to dying",
"none": "No enemy should be targeted this tick"
}
},
"danger": {
"type": "score",
"instructions": "How dangerous is this unit's position?",
"criteria": [
"safe",
"contested",
"dangerous",
"lethal"
]
},
"macro_override": {
"type": "noul",
"instructions": "The fight is going badly enough that the macro planner should change the army's orders."
}
}
};
const res = await fetch("https://router.flatkey.ai/api/alpha/decisions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FLATKEY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!res.ok) throw new Error(`Jev request failed: ${res.status} ${await res.text()}`);
const { answers, usage } = await res.json();
console.log(JSON.stringify(answers, null, 2), usage);# Python 3.8+ (pip install requests). Run: FLATKEY_API_KEY=... python jev.py
import json, os, requests
body = json.loads(r"""{
"model": "typesafe/jev-1.13",
"state": "Your caster: HP 60%, heal/damage coil ready, stun on cooldown. Allied tank at 15% HP in melee, hit by two enemy melee units; an enemy healer stands behind them. Macro order: hold the ramp until reinforcements arrive in 20 seconds.",
"questions": {
"micro_action": {
"type": "choice",
"instructions": "What should this unit do right now?",
"criteria": {
"heal_ally": "Use a healing ability on a wounded ally",
"nuke_enemy": "Use a damage ability on an enemy",
"stun": "Use a crowd-control ability to stop an enemy",
"attack": "Basic attack on the focus target",
"fall_back": "Move away to safety"
}
},
"focus_target": {
"type": "choice",
"instructions": "Which enemy should this unit prioritize?",
"criteria": {
"tank_attacker": "The enemy attacking our most wounded unit",
"caster": "An enemy spellcaster or healer",
"lowest_hp": "The enemy closest to dying",
"none": "No enemy should be targeted this tick"
}
},
"danger": {
"type": "score",
"instructions": "How dangerous is this unit's position?",
"criteria": [
"safe",
"contested",
"dangerous",
"lethal"
]
},
"macro_override": {
"type": "noul",
"instructions": "The fight is going badly enough that the macro planner should change the army's orders."
}
}
}""")
res = requests.post(
"https://router.flatkey.ai/api/alpha/decisions",
headers={"Authorization": f"Bearer {os.environ['FLATKEY_API_KEY']}"},
json=body,
timeout=60,
)
res.raise_for_status()
data = res.json()
print(json.dumps(data["answers"], indent=2), data.get("usage"))
No Flatkey key yet? Get one for Jev 1.13 →
About this use case

Who / when
Audience
- researchers building RTS agents on StarCraft-style environments
- game-AI developers testing LLM macro plus fast micro harnesses
- anyone probing where a System One model breaks under real-time pressure
Triggers
- unit micro needs a decision many times per second, too fast for an LLM
- the macro plan changes rarely but fights change every moment
- you want per-unit targeting and ability use as typed, loggable decisions
- you need to know when micro is failing and macro should intervene
The workflow
- 01Unit stateHP, cooldowns, nearby units, macro orderInput
- 02ChoiceMicro action and focus targetJev
- 03Score + NoulDanger level, macro-override flagJev
- 04Code gateIssue command or defer to macroYour code
Question shape
{
"micro_action": {
"type": "choice",
"instructions": "What should this unit do right now?",
"criteria": {
"heal_ally": "Use a healing ability on a wounded ally",
"nuke_enemy": "Use a damage ability on an enemy",
"stun": "Use a crowd-control ability to stop an enemy",
"attack": "Basic attack on the focus target",
"fall_back": "Move away to safety"
}
},
"focus_target": {
"type": "choice",
"instructions": "Which enemy should this unit prioritize?",
"criteria": {
"tank_attacker": "The enemy attacking our most wounded unit",
"caster": "An enemy spellcaster or healer",
"lowest_hp": "The enemy closest to dying",
"none": "No enemy should be targeted this tick"
}
},
"danger": {
"type": "score",
"instructions": "How dangerous is this unit's position?",
"criteria": [
"safe",
"contested",
"dangerous",
"lethal"
]
},
"macro_override": {
"type": "noul",
"instructions": "The fight is going badly enough that the macro planner should change the army's orders."
}
}Gate policy
≥ 0.90
Issue the micro command this tick.
0.65–0.90
Issue it only if danger is safe or contested; otherwise fall back.
< 0.65
Keep the default attack-move and flag the macro planner.
Failure modes
Pre-launch checks before you trust auto-routing:
- Spatial reasoning: text-only state loses positions, ranges and terrain;
- Speed: per-unit calls add up across a large army every tick;
- Multimodality: the model cannot see the minimap or the screen;
- Hard intelligence limits in long 1v1 games against strong opponents;
- Macro plans that go stale while micro keeps executing them;
FAQ
How well does this actually work?
Peter (@BrainsAndTennis) tested a macro/micro harness in an RTS environment he found often much more performant than pySC2 (post below). Jev was "not bad at micro", with good targeting and spell use at times, but an Opus 5.5 macro plus Jev micro harness blundered quite badly in real 1v1 matchups, which he put down to spatial reasoning, speed, multimodality and intelligence limits.
So why build it this way?
Because the split is still the right shape: micro needs answers faster than an LLM can give, and typed decisions are easy to log, replay and gate. Put spatial logic in code, give Jev bounded choices, and let the planner step in when macro_override fires.
How is this different from the hybrid game agent page?
That page is one fighter with one action per tick and a clean cost story. This one is many units, each with its own targeting and abilities, and a candid list of where it breaks.
Can I bring my own API key?
Yes. Try the free demo above without signing in. To run it live on your own text, sign in with Google and connect a Flatkey or OpenRouter key (a quick test call runs when you save it). Manage or delete it anytime under Dashboard → BYOK. Keys are stored encrypted on the server, used only for runs you trigger, and never sent back to the browser. Need a Flatkey key? Get one for Jev 1.13 on Flatkey.
Is this the official TypeSafe Jev product page?
No. jev-llm.com is an independent research and practice site. Verify pricing, models and terms at the original TypeSafe sources.
Sources
the tldr: - env is quite performant, often much more so than pySC2 - jev is not bad at micro, sometimes displaying delightful flourishes on targeting and spell use (see DK mortal coils, TC hoof stomps, etc) - in real 1v1 matchups, an Opus5.5 macro/Jev micro (system2/system1) harness blunders quite badly due to limitations in spatial reasoning, speed, multimodality, and intelligence - i had fun and reconnected with my childhood
— @BrainsAndTennis View the post on X →
Wire this gate with your own key
Bring your own key through Flatkey / OpenRouter. Keep exact checks in code.