ruvnet/ruflo · error
[router] failed to load models for candidate lookup
Error message
[router] failed to load models for candidate lookup
What it means
Log warning in createCandidateEndpoint: fetching the model list to resolve a candidate model id for router fallback failed, so candidate-based aliasing cannot proceed and the caller must use the default model path.
Source
Thrown at ruflo/src/ruvocal/src/lib/server/router/endpoint.ts:142
(config.LLM_ROUTER_ENABLE_MULTIMODAL || "").toLowerCase() === "true";
const routerToolsEnabled = isRouterToolsBypassEnabled();
const hasImageInput = sanitizedMessages.some((message) =>
(message.files ?? []).some(
(file) => typeof file?.mime === "string" && file.mime.startsWith("image/")
)
);
// Tools are considered "active" if the client indicated any enabled MCP server
const hasToolsActive = hasActiveToolsSelection(params.locals);
// Helper to create an OpenAI endpoint for a specific candidate model id
async function createCandidateEndpoint(candidateModelId: string): Promise<Endpoint> {
// Try to use the real candidate model config if present in chat-ui's model list
let modelForCall: ProcessedModel | undefined;
try {
const all = await getModels();
modelForCall = all?.find((m) => m.id === candidateModelId || m.name === candidateModelId);
} catch (e) {
logger.warn({ err: String(e) }, "[router] failed to load models for candidate lookup");
}
if (!modelForCall) {
// Fallback: clone router model with candidate id
modelForCall = {
...routerModel,
id: candidateModelId,
name: candidateModelId,
displayName: candidateModelId,
} as ProcessedModel;
}
return endpoints.openai({
type: "openai",
baseURL: (config.OPENAI_BASE_URL || "https://router.huggingface.co/v1").replace(/\/$/, ""),
apiKey: getApiToken(params.locals),
model: modelForCall,
// Ensure streaming path is usedView on GitHub (pinned to fa13ee4ad6)
Solutions
- Check the router's upstream model catalog is reachable and loaded; retry after the model list loads successfully.
- Inspect router logs for the underlying selection error and fix the failing candidate/endpoint.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at ruflo/src/ruvocal/src/lib/server/router/endpoint.ts:142 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18).
Data as JSON: /api/errors/d69f127b5f6e0202.
Report an issue: GitHub.