{"record":{"id":"b2159af293fc623a","repo":"HKUDS/DeepTutor","slug":"no-effective-llm-endpoint-resolved-please-configu","errorCode":null,"errorMessage":"No effective LLM endpoint resolved. Please configure base_url or provider defaults.","messagePattern":"No effective LLM endpoint resolved\\. Please configure base_url or provider defaults\\.","errorType":"validation","errorClass":"LLMConfigError","httpStatus":null,"severity":"critical","filePath":"deeptutor/services/llm/config.py","lineNumber":178,"sourceCode":"    \"\"\"\n    resolved = resolve_llm_runtime_config()\n    if _is_openai_compatible_binding(resolved.binding):\n        _set_openai_env_vars(\n            resolved.api_key,\n            resolved.effective_url,\n            source=\"initialize_environment\",\n        )\n\n\ndef _get_llm_config_from_resolver() -> LLMConfig:\n    \"\"\"Resolve LLM config from the TutorBot-style runtime adapter.\"\"\"\n    resolved = resolve_llm_runtime_config()\n    if not resolved.model:\n        raise LLMConfigError(\n            \"No active LLM model is configured. Please set it in Settings > Catalog.\"\n        )\n    if not resolved.effective_url and resolved.provider_mode != \"oauth\":\n        raise LLMConfigError(\n            \"No effective LLM endpoint resolved. Please configure base_url or provider defaults.\"\n        )\n    is_placeholder_key = resolved.api_key in {\"\", \"no-key\", \"sk-no-key-required\"}\n    if (\n        resolved.provider_name == \"openai\"\n        and resolved.provider_mode == \"standard\"\n        and is_placeholder_key\n    ):\n        raise LLMConfigError(\n            \"OpenAI API key is not configured. Set it in Settings > Catalog, \"\n            \"or select a local provider such as Ollama.\"\n        )\n    return LLMConfig(\n        model=resolved.model,\n        api_key=resolved.api_key,\n        base_url=resolved.base_url,\n        effective_url=resolved.effective_url,\n        binding=resolved.binding,","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/llm/config.py#L160-L196","documentation":"The resolver produced a model but no effective endpoint URL, and the provider is not in oauth mode (oauth users authenticate via tokens, so no base URL is needed). Since every other mode issues HTTP calls against effective_url, an empty one is fatal and LLMConfigError is raised with guidance to configure base_url or rely on provider defaults.","triggerScenarios":"A custom/local provider whose base_url was never set; a provider entry missing from the defaults table so no fallback URL applies; base_url saved as an empty string overriding a default; whitespace-only URL treated as falsy downstream.","commonSituations":"Adding a new or self-hosted provider without specifying its endpoint; settings field renamed from url to base_url during migration; pointing at an internal gateway whose address lives in an env var that is unset.","solutions":["Set base_url for the provider in Settings (e.g. http://localhost:11434/v1 for Ollama).","If the provider is standard, ensure its name matches a known default so effective_url can be derived.","Check the profile JSON for an empty base_url overriding a default and remove the empty key.","For OAuth-based access, set provider_mode to 'oauth' so the URL requirement is skipped."],"exampleFix":"// before\n# profile: {\"provider\": \"local\", \"model\": \"llama3\"}\n\n# after\n# profile: {\"provider\": \"local\", \"model\": \"llama3\", \"base_url\": \"http://localhost:11434/v1\"}","handlingStrategy":"validation","validationCode":"resolved = resolve_llm_runtime_config()\nif not resolved.effective_url and resolved.provider_mode != \"oauth\":\n    raise RuntimeError(\n        f\"Provider '{resolved.provider_name}' needs a base_url (e.g. http://localhost:11434/v1)\"\n    )\ncfg = get_llm_config()","typeGuard":"def has_effective_url(resolved) -> bool:\n    return bool(getattr(resolved, \"effective_url\", None)) or resolved.provider_mode == \"oauth\"","tryCatchPattern":"try:\n    cfg = get_llm_config()\nexcept LLMConfigError as e:\n    if \"No effective LLM endpoint\" in str(e):\n        set_provider_base_url(default_local_url)\n    raise","preventionTips":["Require base_url in provider-creation forms for custom providers.","Remove empty-string base_url keys from migrated settings rather than keeping them.","Use OAuth mode only when the flow genuinely supplies auth without a URL."],"tags":["llm","configuration","base-url","endpoint"],"backgroundTag":"missing-configuration-value","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}