#!/usr/bin/env python3
import argparse
SCENARIOS={
 'safe':(24,14,8,6,False),
 'long-context':(24,14,28,10,False),
 'high-concurrency':(24,14,12,28,False),
 'quantized':(24,14,12,20,True),
}
def calc(name):
    vram,weights,context_k,conc,quant=SCENARIOS[name]
    w=weights*(.55 if quant else 1); runtime=max(1.2,vram*.075); kv=conc*context_k*.045; used=w+runtime+kv; head=vram-used
    state='oom_pressure' if head<0 else 'low_headroom' if head<vram*.1 else 'headroom_available'
    print(f"scenario={name} vram={vram:.1f} weights={w:.1f} runtime={runtime:.1f} synthetic_kv={kv:.1f} headroom={head:.1f}")
    print(f"state={state}")
    if quant: print('warning=quantization_requires_quality_and_performance_revalidation')
    print('NOTE synthetic KV estimate; not hardware-sizing evidence')
def main():
    ap=argparse.ArgumentParser(); ap.add_argument('--scenario',choices=SCENARIOS,default='safe'); a=ap.parse_args(); calc(a.scenario)
if __name__=='__main__': main()
