Conversation
…s lifetime Every 5 minutes the endpoint metadata refresh re-runs the full server-type waterfall (LM Studio -> Ollama -> llama.cpp -> vLLM), spraying 404s at endpoints the server never exposes (e.g. /api/v1/models and /api/tags on a vllm backend). Add _endpoint_probe_path_cache (base_url -> server type) so the first successful probe's result is reused for the lifetime of the process. Subsequent refreshes skip straight to the known-good path. Fixes NousResearch#29971.
uzaylisak
force-pushed
the
fix/endpoint-probe-path-cache
branch
from
May 21, 2026 19:30
29a402a to
869272c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every 5 minutes
fetch_endpoint_model_metadata()is called (TTL =_ENDPOINT_MODEL_CACHE_TTL = 300). Each time it callsdetect_local_server_type(), which blindly re-runs the full probe waterfall:GET /api/v1/models→ 404 (LM Studio check)GET /api/tags→ 404 (Ollama check)GET /v1/props→ 404 (llama.cpp check)GET /version→ 200 (vLLM — found)On a vllm backend the first three always 404, polluting server logs every 5 minutes. Reported in #29971.
Fix
Add
_endpoint_probe_path_cache: Dict[str, str] = {}at module level.detect_local_server_type()checks this cache on entry; on a hit it returns immediately without making any HTTP requests. On the first call the waterfall runs as before, and if a server type is identified it is stored for the lifetime of the process.The probe stages also use
if result is Noneguards so each step is skipped once an earlier one succeeds — reducing requests even on the very first call.Impact
Closes #29971.