BerriAI/litellm · error · Exception
All values in argilla_transformation_object must be a key…
Error message
All values in argilla_transformation_object must be a key in SUPPORTED_PAYLOAD_FIELDS, {v} is not a valid key. What it means
Each value in `litellm.argilla_transformation_object` must be a key in SUPPORTED_PAYLOAD_FIELDS, which litellm defines as `["messages", "response"]` (litellm/types/integrations/argilla.py:20). These are the only parts of the standard logging payload the Argilla integration can extract. The validator raises with the offending value so you know exactly which mapping entry is wrong.
Solutions
- Use only "messages" and "response" as the dict values: `litellm.argilla_transformation_object = {"prompt": "messages", "response": "response"}`
- If you mapped key/value backwards, swap them so the Argilla field name is the key and the supported payload key is the value
- Check the installed version's SUPPORTED_PAYLOAD_FIELDS (`from litellm.types.integrations.argilla import SUPPORTED_PAYLOAD_FIELDS`) if your litellm version differs
Example fix
# before
litellm.argilla_transformation_object = {
"prompt": "prompt", # "prompt" not in ["messages", "response"]
"response": "completion", # "completion" not in ["messages", "response"]
}
# after
litellm.argilla_transformation_object = {
"prompt": "messages",
"response": "response",
} Defensive patterns
Strategy: validation
Validate before calling
from litellm.types.integrations.argilla import SUPPORTED_PAYLOAD_FIELDS
mapping = {"prompt": "messages", "response": "response"}
assert all(v in SUPPORTED_PAYLOAD_FIELDS for v in mapping.values()), (
f"bad values: {[v for v in mapping.values() if v not in SUPPORTED_PAYLOAD_FIELDS]}"
)
litellm.argilla_transformation_object = mapping Type guard
from litellm.types.integrations.argilla import SUPPORTED_PAYLOAD_FIELDS
def uses_supported_fields(mapping: dict) -> bool:
return all(v in SUPPORTED_PAYLOAD_FIELDS for v in mapping.values()) Try / catch
try:
ArgillaLogger()
except Exception as e:
if "SUPPORTED_PAYLOAD_FIELDS" in str(e):
# keep only valid entries, warn about dropped ones
valid = {k: v for k, v in mapping.items() if v in SUPPORTED_PAYLOAD_FIELDS}
log.warning("dropping invalid argilla mappings: %s", set(mapping) - set(valid))
litellm.argilla_transformation_object = valid
else:
raise Prevention
- Pin the allowed values in one constant in your codebase and reference SUPPORTED_PAYLOAD_FIELDS from litellm when available
- Watch litellm release notes: SUPPORTED_PAYLOAD_FIELDS is a small allow-list that can change between versions
When it happens
Trigger: Setting a transformation object containing any value other than "messages" or "response", e.g. `{"input": "prompt", "output": "completion"}` — the values "prompt" and "completion" are not supported and raise at ArgillaLogger init.
Common situations: Porting an older litellm example where more payload fields were allowed; guessing field names like "prompt", "model_input", "completion" instead of the canonical keys; mapping the dict backwards (payload key as value instead of as key).
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- 'argilla_transformation_object' must be a dictionary, to…
- 'litellm.argilla_transformation_object' is required, to log…
- DD_SITE is not set in .env, set 'DD_SITE=<>
- Invalid environment: . Please use one of the following…
- LiteLLM Error, trying to use DynamoDB but not table name…
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/d88058cb9bed8597.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/integrations/argilla.py:78
if os.getenv("ARGILLA_SAMPLING_RATE") is not None and os.getenv("ARGILLA_SAMPLING_RATE").strip().isdigit()
else 1.0
)
self.async_httpx_client = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)
_batch_size: Final = os.getenv("ARGILLA_BATCH_SIZE", None) or litellm.argilla_batch_size
if _batch_size:
self.batch_size = int(_batch_size)
asyncio.create_task(self.periodic_flush())
self.flush_lock = asyncio.Lock()
super().__init__(**kwargs, flush_lock=self.flush_lock)
def validate_argilla_transformation_object(self, argilla_transformation_object: dict[str, Any]):
if not isinstance(argilla_transformation_object, dict):
raise Exception("'argilla_transformation_object' must be a dictionary, to log your payload to Argilla.")
for v in argilla_transformation_object.values():
if v not in SUPPORTED_PAYLOAD_FIELDS:
raise Exception(
f"All values in argilla_transformation_object must be a key in SUPPORTED_PAYLOAD_FIELDS, {v} is not a valid key."
)
def get_credentials_from_env(
self,
argilla_api_key: str | None,
argilla_dataset_name: str | None,
argilla_base_url: str | None,
) -> ArgillaCredentialsObject:
_credentials_api_key: Final = argilla_api_key or os.getenv("ARGILLA_API_KEY")
if _credentials_api_key is None:
raise Exception("Invalid Argilla API Key given. _credentials_api_key=None.")
_credentials_base_url: Final = argilla_base_url or os.getenv("ARGILLA_BASE_URL") or "http://localhost:6900/"
if _credentials_base_url is None:
raise Exception("Invalid Argilla Base URL given. _credentials_base_url=None.")
_credentials_dataset_name = argilla_dataset_name or os.getenv("ARGILLA_DATASET_NAME") or "litellm-completion"View on GitHub (pinned to 77b7c6c40c)