zylon-ai/private-gpt · error · ValueError

Image size {image_size} exceeds maximum allowed size of {set

Error message

Image size {image_size} exceeds maximum allowed size of {settings().chat.maximum_blob_size} bytes.

What it means

Raised by POST /skills/{skill_id}/versions when the skill exists but is readonly. Readonly skills accept no new versions through the public API; the route returns 403 before processing the multipart uploads.

Source

Thrown at private_gpt/chat/input_models.py:904

        if isinstance(content, str):
            blocks.append(LITextBlock(text=content))
            content_blocks: Sequence[ContentBlockType] = []
        elif isinstance(content, BaseContentBlock):
            content_blocks = [cast(ContentBlockType, content)]
        else:
            content_blocks = content or []

        for block in content_blocks:
            if isinstance(block, TextBlock):
                blocks.append(LITextBlock(text=block.text))
            elif isinstance(block, MidConvSystemBlock):
                text = "\n".join(b.text for b in block.content)
                blocks.append(LITextBlock(text=text))
            elif isinstance(block, ImageBlock):
                image_bytes = load_file_from_uri(block.source.get_data())
                image_size = len(image_bytes.read())
                if image_size > settings().chat.maximum_blob_size:
                    raise ValueError(
                        f"Image size {image_size} exceeds maximum "
                        f"allowed size of {settings().chat.maximum_blob_size} bytes."
                    )

                image_bytes.seek(0)
                blocks.append(
                    LIImageBlock(
                        image=image_bytes.read(),
                        image_mimetype=block.source.get_media_type(),
                    )
                )
            elif isinstance(block, AudioBlock):
                audio_bytes = load_file_from_uri(block.source.get_data())
                audio_size = len(audio_bytes.read())
                if audio_size > settings().chat.maximum_blob_size:
                    raise ValueError(
                        f"Audio size {audio_size} exceeds maximum "
                        f"allowed size of {settings().chat.maximum_blob_size} bytes."

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Filter out readonly skills before version operations.
  2. For customized content, clone the readonly skill under a new id and version that clone.
  3. Surface the readonly flag in the UI to disable the upload form.

Example fix

// before
for (const s of allSkills) await skillsApi.createVersion(s.id, col, files);

// after
for (const s of allSkills) {
  if (!s.readonly) await skillsApi.createVersion(s.id, col, files);
}
Defensive patterns

Strategy: type-guard

Validate before calling

const skill = await skillsApi.get(id, collection);
if (!skill || skill.readonly) { throw new Error('cannot version this skill'); }

Type guard

const isVersionable = (s) => s != null && !s.readonly;

Try / catch

try { await skillsApi.createVersion(id, collection, files); }
catch (e) {
  if (e.status === 403 && /readonly/.test(e.detail)) return null; // skip
  throw e;
}

Prevention

When it happens

Trigger: Uploading a new version for a builtin/admin-managed skill flagged readonly; automation iterating over all skills and attempting version bumps.

Common situations: Bulk version scripts that don't filter on the readonly flag; product change marking stock skills readonly after upgrade.

Related errors


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/37157fb0b294b00d. Report an issue: GitHub.