BerriAI/litellm · error · HTTPException

Cannot create a new memory via PUT without a 'value'.

Error message

Cannot create a new memory via PUT without a 'value'.

What it means

HTTPException raised on PUT when the target memory row does not exist and the request body lacks a 'value' — PUT cannot create a new entry without content, since only 'metadata' was supplied. The caller must include a value to create-or-replace the key.

Source

Thrown at litellm/proxy/memory/memory_endpoints.py:506

            if e.status_code == 404:
                return None
            raise

    try:
        existing: Final = await _find_existing()
        if existing is not None:
            # Visibility != write authority. Make sure the caller actually
            # owns this row (their user_id matches, or it's a pure team row in
            # their team) — otherwise a teammate could overwrite a personal
            # entry through the OR-based visibility filter.
            await _assert_write_access(prisma_client, existing, user_api_key_dict)
            row = await _memory_table(prisma_client).update(
                where={"memory_id": existing.memory_id},
                data=data,
            )
        else:
            if body.value is None:
                raise HTTPException(
                    status_code=400,
                    detail="Cannot create a new memory via PUT without a 'value'.",
                )
            # PUT-create must honor admin scope override, matching POST semantics.
            user_id, team_id = _resolve_scope(user_api_key_dict, body.user_id, body.team_id)
            # Omit `metadata` when None so the column defaults to SQL NULL;
            # otherwise JSON-encode for Prisma — same pattern as
            # `create_memory` above.
            create_data: Final[dict[str, object]] = {
                "key": key,
                "value": body.value,
                "user_id": user_id,
                "team_id": team_id,
                "created_by": user_api_key_dict.user_id,
                "updated_by": user_api_key_dict.user_id,
            }
            if body.metadata is not None:
                create_data["metadata"] = _serialize_metadata_for_prisma(body.metadata)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Include a 'value' in the PUT body when creating a new memory entry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/memory/memory_endpoints.py:506 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/a4472414096fdf84. Report an issue: GitHub.