feat: tools bei Modellen ohne Werkzeug-Vorlage klar ablehnen, nicht bestandenen Werkzeug-Test anzeigen (#1268)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 12:28:21 +01:00
parent 21d419aab1
commit 2ad3121c7c
9 changed files with 168 additions and 3 deletions

View File

@ -65,6 +65,12 @@ class Handler(BaseHTTPRequestHandler):
self._send_json(200, {"status": "ok"})
else:
self._send_json(503, {"error": {"message": "Loading model"}})
elif self.path == "/props":
kann = os.environ.get("FAKE_LLAMA_TOOLS")
if kann is None:
self._send_json(404, {})
else:
self._send_json(200, {"chat_template_caps": {"supports_tools": kann == "1"}})
elif self.path == "/v1/models":
alias = opt("--alias") or "modell"
self._send_json(200, {"object": "list", "data": [{"id": alias, "object": "model", "created": 0, "owned_by": "fake"}]})