BerriAI/litellm · error · FileNotFoundError
Unable to locate profile config file at '{cfg_path}' in AICO
Error message
Unable to locate profile config file at '{cfg_path}' in AICORE_HOME '{home}' What it means
SAP AI Core config resolution failed: neither the file at the derived cfg_path (from AICORE_CONFIG_FILE env or AICORE_HOME plus profile-specific name) nor any other source yielded a config, so the loader cannot proceed and reports the missing profile path.
Source
Thrown at litellm/llms/sap/credentials.py:152
home: Final = Path(_get_home())
profile = profile or os.environ.get(PROFILE_ENV_VAR)
cfg_env: Final = os.getenv(CONFIG_FILE_ENV_VAR)
cfg_path: Final = (
Path(cfg_env)
if cfg_env
else (home / ("config.json" if profile in (None, "", "default") else f"config_{profile}.json"))
)
if cfg_path and cfg_path.exists():
try:
with cfg_path.open(encoding="utf-8") as f:
return json.load(f)
except json.JSONDecodeError:
raise KeyError(f"{cfg_path} is not valid JSON. Please fix or remove it!")
# If an explicit non-default profile was requested but not found, raise.
if cfg_env or (profile not in (None, "", "default")):
raise FileNotFoundError(f"Unable to locate profile config file at '{cfg_path}' in AICORE_HOME '{home}'")
return {}
def _env_name(name: str) -> str:
return f"AICORE_{name.upper()}"
def extract_credentials(source: Source) -> dict[str, str]:
"""Extract all credentials from a source."""
credentials: Final = {}
for cv in CREDENTIAL_VALUES:
value = source.get(cv)
if value is not None:
credentials[cv.name] = cv.transform_fn(value) if cv.transform_fn else value
return credentials
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Place the profile config file at the expected path or fix AICORE_HOME.
- Set AICORE_HOME to the directory containing the config file.
Example fix
export AICORE_HOME=/path/to/dir # containing the profile config JSON
Defensive patterns
Strategy: validation
When it happens
Trigger: Triggered when the SAP profile config file is not found at cfg_path under AICORE_HOME.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/396f3c9e2392a18b.
Report an issue: GitHub.