BerriAI/litellm · error · ValueError
Gitlab configuration not found. Please set litellm.global_gi
Error message
Gitlab configuration not found. Please set litellm.global_gitlab_config first.
What it means
Same pattern as the BitBucket integration: the 'gitlab' logging integration constructs a GitLabPromptManager from the module-level litellm.global_gitlab_config. If that global was never assigned, LiteLLM refuses with this ValueError. GitLab prompt-management settings are not read from env vars, so the global must be set explicitly (or via proxy prompt-management config).
Source
Thrown at litellm/litellm_core_utils/litellm_logging.py:4344
if bitbucket_config is None:
raise ValueError("BitBucket configuration not found. Please set litellm.global_bitbucket_config first.")
bitbucket_logger: Final = BitBucketPromptManager(bitbucket_config=bitbucket_config)
_in_memory_loggers.append(bitbucket_logger)
return bitbucket_logger
elif logging_integration == "gitlab":
from litellm.integrations.gitlab.gitlab_prompt_manager import (
GitLabPromptManager,
)
for callback in _in_memory_loggers:
if isinstance(callback, GitLabPromptManager):
return callback
# Get global BitBucket config
gitlab_config: Final = getattr(litellm, "global_gitlab_config", None)
if gitlab_config is None:
raise ValueError("Gitlab configuration not found. Please set litellm.global_gitlab_config first.")
gitlab_logger: Final = GitLabPromptManager(gitlab_config=gitlab_config)
_in_memory_loggers.append(gitlab_logger)
return gitlab_logger
elif logging_integration == "newrelic":
for callback in _in_memory_loggers:
if isinstance(callback, NewRelicLogger):
return callback
newrelic_logger: Final = NewRelicLogger()
_in_memory_loggers.append(newrelic_logger)
return newrelic_logger
return None
except Exception as e:
verbose_logger.exception("[Non-Blocking Error] Error initializing custom logger: %s", e)
return None
return None
View on GitHub (pinned to 6c2dcb801b)
Solutions
- Assign litellm.global_gitlab_config = GitLabPromptManagementConfig(gitlab_base_url=..., gitlab_access_token=..., project_id=..., prompt_prefix=...) before the first request
- Or configure GitLab prompt management in the proxy config.yaml so startup initializes the global
- Verify the assignment happened early (e.g. print litellm.global_gitlab_config in a startup hook)
- Drop 'gitlab' from callbacks if prompt management via GitLab is unwanted
Example fix
# before
litellm.callbacks = ["gitlab"] # ValueError: configuration not found
# after
import litellm
from litellm.integrations.gitlab import GitLabPromptManagementConfig
litellm.global_gitlab_config = GitLabPromptManagementConfig(
gitlab_base_url="https://gitlab.com/api/v4",
gitlab_access_token="...",
project_id="12345",
)
litellm.callbacks = ["gitlab"] Defensive patterns
Strategy: validation
Validate before calling
import litellm
from litellm.integrations.gitlab import GitLabPromptManagementConfig
if 'gitlab' in litellm.callbacks and getattr(litellm, 'global_gitlab_config', None) is None:
litellm.global_gitlab_config = GitLabPromptManagementConfig(
gitlab_base_url=..., gitlab_access_token=..., project_id=...
) Type guard
def gitlab_ready() -> bool:
return getattr(litellm, 'global_gitlab_config', None) is not None Prevention
- Set litellm.global_gitlab_config before any request when callbacks include 'gitlab'
- Re-check the assignment after upgrading litellm (class import paths move)
- Initialize globals in a single startup module to avoid ordering bugs
When it happens
Trigger: callbacks: ['gitlab'] enabled while litellm.global_gitlab_config is None at the moment the logger is lazily created (first logged request, or proxy startup without the GitLab prompt management block).
Common situations: Adding the gitlab callback from docs without the corresponding global config assignment; custom hosting where the proxy's prompt-management bootstrap isn't run; renaming/moving the config class between LiteLLM versions so the assignment silently stopped happening.
Related errors
- BitBucket configuration not found. Please set litellm.global
- Failed to load prompt '{encode_prompt_id(prompt_id)}' from G
- Template '{template_id}' not found
- Prompt template '{prompt_id}' not found
- prompt_id is required for GitLab prompt manager
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/dc98e046cb026b35.
Report an issue: GitHub.