MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / get_llama_proxy

Function get_llama_proxy

llama_cpp/server/app.py:73–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72
73async def get_llama_proxy():
74 # NOTE: This double lock allows the currently streaming llama model to
75 # check if any other requests are pending in the same thread and cancel
76 # the stream if so.
77 await llama_outer_lock.acquire()
78 release_outer_lock = True
79 try:
80 await llama_inner_lock.acquire()
81 try:
82 llama_outer_lock.release()
83 release_outer_lock = False
84 yield _llama_proxy
85 finally:
86 llama_inner_lock.release()
87 finally:
88 if release_outer_lock:
89 llama_outer_lock.release()
90
91
92_ping_message_factory: typing.Optional[typing.Callable[[], bytes]] = None

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…