zylon-ai/private-gpt · error · SkillDomainError
BUNDLE_TOO_LARGE
BUNDLE_TOO_LARGE
Error message
Skill bundle size ({total} bytes) exceeds the maximum allowed size of {self._max_bundle_size_bytes} bytes. What it means
SkillService._check_bundle_size sums the byte length of all StoredFile contents in an uploaded skill bundle and raises SkillDomainError BUNDLE_TOO_LARGE when the total exceeds the configured _max_bundle_size_bytes (None disables the check). The message reports both the actual and maximum byte counts, and params carries the limit in MB for API error rendering. It is a resource-exhaustion guard on skill uploads.
Source
Thrown at private_gpt/components/skills/services/skill_service.py:66
) -> None:
self._skill_repository = skill_repository
self._max_bundle_size_bytes = settings.skills.max_bundle_size_bytes
local_root = str(Path(settings.data.local_data_folder) / "storage")
self._storage_bucket_name = settings.s3.durable_bucket_name
self._storage_component = storage_component.get_object_storage(
provider=settings.skills.storage_provider,
local_root_path=local_root,
bucket_name=self._storage_bucket_name,
)
self._cache = cache
def _check_bundle_size(self, files: list[StoredFile]) -> None:
if self._max_bundle_size_bytes is None:
return
total = sum(len(f.content) for f in files)
if total > self._max_bundle_size_bytes:
max_mb = round(self._max_bundle_size_bytes / (1024 * 1024))
raise SkillDomainError(
SkillErrorCode.BUNDLE_TOO_LARGE,
f"Skill bundle size ({total} bytes) exceeds the maximum allowed "
f"size of {self._max_bundle_size_bytes} bytes.",
params={"size": str(max_mb)},
)
async def create_skill(
self,
collection: str,
display_title: str,
source: Literal["custom", "anthropic", "zylon"],
loading: Literal["eager", "lazy"],
readonly: bool,
files: list[StoredFile],
) -> SkillEntity:
self._check_bundle_size(files)
skill_id = new_skill_id()
version_id = new_skill_version_id()View on GitHub (pinned to 4a030776a3)
Solutions
- Reduce the bundle: remove unused/large assets, compress images, or host big files externally and reference them by URL in the skill body.
- If the content legitimately needs more room, raise the configured maximum bundle size (settings.skills.* bundle size option) — an admin/policy decision.
- Pre-compute the total before upload: sum(len(content) for files) and compare to the documented limit.
- Split one oversized skill into several focused skills.
Example fix
# before
await service.create_skill(collection, files=all_files) # BUNDLE_TOO_LARGE
# after
total = sum(len(f.content) for f in all_files)
if total > MAX:
all_files = prune_large_assets(all_files) # or raise a user-facing message
await service.create_skill(collection, files=all_files) Defensive patterns
Strategy: validation
Validate before calling
MAX_BUNDLE_BYTES = 10 * 1024 * 1024 # keep in sync with settings
def bundle_within_limit(files: list) -> bool:
return sum(len(f.content) for f in files) <= MAX_BUNDLE_BYTES
if not bundle_within_limit(files):
files = drop_large_assets(files, budget=MAX_BUNDLE_BYTES) Try / catch
try:
await service.create_skill(collection, title, source, loading, files=files)
except SkillDomainError as e:
if e.code is SkillErrorCode.BUNDLE_TOO_LARGE:
return HTTPException(413, "Skill bundle too large; remove large assets or split the skill")
raise Prevention
- Compute and enforce the size budget client-side before upload.
- Keep binaries/models out of skill bundles; link to external storage instead.
- Track per-skill bundle size in CI so growth is noticed before it breaches the cap.
When it happens
Trigger: Calling create_skill (or any path that stores a version bundle) with files whose combined size exceeds settings.skills max bundle size — e.g. shipping large binary assets, model files, or datasets inside the skill bundle.
Common situations: Bundling reference PDFs/images/scripts into a skill; increasing asset size over iterations until crossing the default cap; environments with a deliberately low cap; users zipping whole directories as a skill.
Related errors
AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15).
Data as JSON: /api/errors/1cc970d92e34eef1.
Report an issue: GitHub.