[model_routes] 1466-line route file exceeds AGENTS.md ~400 line limit #701
Labels
No labels
area:chat
area:core
area:llm
area:routes
area:tools
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sleepy/odysseus#701
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File:
routes/model_routes.py(1466 lines)AGENTS.md rule: Split files that exceed ~400 lines or contain multiple concerns.
This file mixes:
_anthropic_api_root,_ollama_api_root,_models_url,_provider_headers(lines 25–70, duplicates fromllm_core.pyandendpoint_resolver.py)_PROVIDER_CURATED,_curate_models,_is_chat_model,_NON_CHAT_*constants (lines 73–214)_probe_endpoint,_ping_endpoint,_probe_single_model,_classify_endpoint(lines 217–425)_refresh_caches_bg,_fetch_models(lines 427–586)/api/models(lines 588–629)/api/model-endpoints/probe-local(lines 638–687)_settings_using_endpoint,_clear_settings_for_endpoint,_clear_sessions_for_endpoint(lines 1328–1408)/api/tools(lines 1441–1464)Suggested split:
routes/model_routes.py— thin router, setup function, route handlers onlysrc/model_probing.py—_probe_endpoint,_ping_endpoint,_probe_single_modelsrc/model_curation.py— curated lists, filtering, classificationsrc/model_cache.py— background refresh, per-user cache managementThe duplicated helpers (
_anthropic_api_root,_ollama_api_root,_provider_headers) should be removed in favor of the originals inendpoint_resolver.py.