MCPcopy
hub / github.com/tinygrad/tinygrad / do_GET

Method do_GET

tinygrad/llm/cli.py:113–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

111 server: LLMServer
112 def log_request(self, code='-', size='-'): pass
113 def do_GET(self):
114 if self.path == "/v1/models": self.send_data(json.dumps({"object":"list","data":[{"id":self.server.model_name,"object":"model"}]}).encode())
115 else: self.send_data((pathlib.Path(__file__).parent / "chat.html").read_bytes(), content_type="text/html")
116 def run_model(self, ids:list[int], model_name:str, include_usage=False, max_tokens:int|None=None, temperature:float=0.0):
117 model, tok = self.server.model, self.server.tok
118 cache_start_pos = model.get_start_pos(ids)

Callers

nothing calls this directly

Calls 3

send_dataMethod · 0.80
read_bytesMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected