okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
8d6ae0cd8
main
1#!/usr/bin/env python3 2"""Repeat the benchmark request N times; print decode tok/s per request.""" 3import json ,sys ,requests 4port = int (sys .argv [1 ])if len (sys .argv )> 1 else 8082 5n = int (sys .argv [2 ])if len (sys .argv )> 2 else 10 6for i in range (n ): 7r = requests .post (f'http://127.0.0.1: { port } /v1/chat/completions' ,json = { 8'messages' : [{'role' :'user' ,'content' :'Name the capital of France in one word.' }], 9'max_tokens' :200 ,'temperature' :0 },timeout = 600 ) 10t = r .json ().get ('timings' , {}) 11f'req { i + 1 } : decode { t . get ( "predicted_per_second" ) } tok/s, ' 12f'prompt { t . get ( "prompt_per_second" ) } tok/s' ,flush = True )