fix(proxy): expose /props with vision modality and architecture meta in /v1/models for Maki local discovery
This commit is contained in:
@@ -1295,6 +1295,14 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
||||
"max_context_length": CTX_SIZE,
|
||||
"max_tokens": MAX_OUTPUT,
|
||||
"max_output_tokens": MAX_OUTPUT,
|
||||
"max_model_len": CTX_SIZE,
|
||||
"architecture": {
|
||||
"input_modalities": ["text", "image"],
|
||||
"output_modalities": ["text"],
|
||||
},
|
||||
"meta": {
|
||||
"n_ctx": CTX_SIZE,
|
||||
},
|
||||
"input_modalities": ["text", "image"],
|
||||
"modalities": ["text", "image"],
|
||||
"supports_vision": True,
|
||||
@@ -1303,6 +1311,17 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
||||
for tag in MODEL_TAGS
|
||||
],
|
||||
})
|
||||
elif path == "/props":
|
||||
try:
|
||||
with urllib.request.urlopen(f"{LLAMA_BASE}/props", timeout=5) as r:
|
||||
props = json.loads(r.read().decode())
|
||||
except Exception:
|
||||
props = {"n_ctx": CTX_SIZE}
|
||||
props.setdefault("modalities", {})
|
||||
if isinstance(props["modalities"], dict):
|
||||
props["modalities"]["vision"] = True
|
||||
props["modalities"]["input"] = ["text", "image"]
|
||||
self._send(200, props)
|
||||
elif path == "/health":
|
||||
self._send(200, {"status": "ok"})
|
||||
elif path == "/api/status":
|
||||
|
||||
Reference in New Issue
Block a user