{"record":{"id":"37134aa88626f595","repo":"BerriAI/litellm","slug":"no-config-path-set-please-set-a-config-path-using","errorCode":null,"errorMessage":"No config path set, please set a config path using `litellm.config_path = 'path/to/config.json'`","messagePattern":"No config path set, please set a config path using `litellm\\.config_path = 'path/to/config\\.json'`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/main.py","lineNumber":8461,"sourceCode":"\n####### HELPER FUNCTIONS ################\n## Set verbose to true -> ```litellm.set_verbose = True```\ndef print_verbose(print_statement):\n    try:\n        verbose_logger.debug(print_statement)\n        if litellm.set_verbose:\n            print(print_statement)  # noqa: T201\n    except Exception:\n        pass\n\n\ndef config_completion(**kwargs):\n    if litellm.config_path is not None:\n        config_args: Final = read_config_args(litellm.config_path)\n        # overwrite any args passed in with config args\n        return completion(**kwargs, **config_args)\n    else:\n        raise ValueError(\n            \"No config path set, please set a config path using `litellm.config_path = 'path/to/config.json'`\"\n        )\n\n\ndef stream_chunk_builder_text_completion(chunks: list, messages: list | None = None) -> TextCompletionResponse:\n    id: Final = chunks[0][\"id\"]\n    object: Final = chunks[0][\"object\"]\n    created: Final = chunks[0][\"created\"]\n    model: Final = chunks[0][\"model\"]\n    system_fingerprint: Final = chunks[0].get(\"system_fingerprint\", None)\n    finish_reason: Final = chunks[-1][\"choices\"][0][\"finish_reason\"]\n    logprobs: Final = chunks[-1][\"choices\"][0][\"logprobs\"]\n\n    content_list: Final = []\n    for chunk in chunks:\n        choices = chunk[\"choices\"]\n        for choice in choices:\n            if choice is not None and hasattr(choice, \"text\") and choice.get(\"text\") is not None:","sourceCodeStart":8443,"sourceCodeEnd":8479,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/main.py#L8443-L8479","documentation":"config_completion() reads default arguments from a JSON config file whose path must be assigned to litellm.config_path first. When litellm.config_path is None it raises ValueError instead of invoking completion().","triggerScenarios":"litellm.config_completion(prompt='hi', model=...) without ever setting litellm.config_path = 'path/to/config.json' in the process.","commonSituations":"Trying the config-based API for the first time; the path being set in a different module or process than the one calling; the config file moved or deleted after initial setup.","solutions":["Set the path before calling: litellm.config_path = 'config.json'; then litellm.config_completion(...)","Confirm the path exists and the file is valid JSON — read_config_args reads it on the next line","If you don't need config defaults, call litellm.completion(...) directly instead"],"exampleFix":"# before\nresp = litellm.config_completion(prompt=\"hi\")\n\n# after\nlitellm.config_path = \"path/to/config.json\"\nresp = litellm.config_completion(prompt=\"hi\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\nimport litellm\n\nif litellm.config_path is None:\n    raise ValueError(\"litellm.config_path is not set\")\nif not Path(litellm.config_path).is_file():\n    raise ValueError(f\"config file missing: {litellm.config_path}\")","typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.config_completion(prompt=\"hi\")\nexcept ValueError as e:\n    if \"No config path set\" in str(e):\n        raise RuntimeError(\"config_completion used without litellm.config_path\") from e\n    raise","preventionTips":["Set and validate litellm.config_path during app bootstrap","Fail fast if the config file is missing or unparseable"],"tags":["litellm","config","config-completion","setup"],"backgroundTag":"missing-config-path","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}