MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / start_server

Function start_server

subprojects/llama.cpp/tools/server/bench/bench.py:233–257  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

231
232
233def start_server(args):
234 server_process = start_server_background(args)
235
236 attempts = 0
237 max_attempts = 600
238 if 'GITHUB_ACTIONS' in os.environ:
239 max_attempts *= 2
240
241 while not is_server_listening(args.host, args.port):
242 attempts += 1
243 if attempts > max_attempts:
244 assert False, "server not started"
245 print(f"bench: waiting for server to start ...")
246 time.sleep(0.5)
247
248 attempts = 0
249 while not is_server_ready(args.host, args.port):
250 attempts += 1
251 if attempts > max_attempts:
252 assert False, "server not ready"
253 print(f"bench: waiting for server to be ready ...")
254 time.sleep(0.5)
255
256 print("bench: server started and ready.")
257 return server_process
258
259
260def start_server_background(args):

Callers 1

mainFunction · 0.70

Calls 3

start_server_backgroundFunction · 0.85
is_server_listeningFunction · 0.85
is_server_readyFunction · 0.85

Tested by

no test coverage detected