add endpoint to fetch true max context

This commit is contained in:
Concedo 2023-09-14 23:27:12 +08:00
parent 3d50c6fe0b
commit 4d3a64fbb2

View file

@ -530,6 +530,9 @@ class ServerRequestHandler(http.server.SimpleHTTPRequestHandler):
elif self.path.endswith(('/api/v1/info/version', '/api/latest/info/version')): elif self.path.endswith(('/api/v1/info/version', '/api/latest/info/version')):
response_body = (json.dumps({"result":"1.2.4"}).encode()) response_body = (json.dumps({"result":"1.2.4"}).encode())
elif self.path.endswith(('/api/extra/true_max_context_length')): #do not advertise this to horde
response_body = (json.dumps({"value": maxctx}).encode())
elif self.path.endswith(('/api/extra/version')): elif self.path.endswith(('/api/extra/version')):
response_body = (json.dumps({"result":"KoboldCpp","version":KcppVersion}).encode()) response_body = (json.dumps({"result":"KoboldCpp","version":KcppVersion}).encode())