[llm_core] Eliminate private-import coupling from model_routes and endpoint_resolver #874

Closed
sleepy wants to merge 0 commits from fix/llm-core-private-imports-704-703 into dev
Owner
No description provided.
Issues fixed:
- #704: endpoint_resolver imported _detect_provider (already public as
  detect_provider via PR #830). No remaining underscore imports.
- #703: model_routes imported 6 private functions from llm_core AND
  duplicated 4 helper functions that already existed in endpoint_resolver.

Changes:
- Promote 5 functions to public API in llm_core.py:
  normalize_anthropic_url, build_anthropic_headers,
  build_anthropic_payload, build_ollama_payload,
  uses_max_completion_tokens
- Promote 2 functions to public API in endpoint_resolver.py:
  anthropic_api_root, ollama_api_root
- Remove 4 duplicated helpers from model_routes.py and use
  endpoint_resolver imports instead (anthropic_api_root,
  ollama_api_root, build_models_url, build_headers)
- Fix gallery_routes.py: _detect_provider -> detect_provider
- Fix email_routes.py, email_pollers.py:
  _uses_max_completion_tokens -> uses_max_completion_tokens

Tests: 552 passed, 9 failed (same pre-existing failures).
sleepy closed this pull request 2026-06-04 00:29:19 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.