﻿# BentoML packaging: a Python dependency does not include your local asset files

Debug a Bento that builds successfully but lacks tokenizer or preprocessing assets by separating build file selection, model dependencies and runtime packages.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-bentoml-build-ignore-assets-runtime-package-boundary/
Language: en

## Local serving hides an omitted resource

A text endpoint works from the development directory but its container cannot open a custom normalization table. The Python library imports correctly, so the build appears complete. The missing object is an application asset, not another package dependency.

Write down the origin of every file the service reads: selected source-tree content, declared model artifacts, runtime installation or external retrieval. This makes a packaging failure more specific than the unhelpful statement that the model works locally.

## File selection is a build decision

The [packaging guide](https://docs.bentoml.com/en/latest/get-started/packaging-for-deployment.html) describes the Bento package and source-file exclusion through .bentoignore. A file available in the checkout can still be outside the resulting package when the build rules exclude it.

Inspect the selected build context and packaged paths. Avoid fixing the problem by assuming the production working directory will resemble a developer's entire repository, including untracked files or directories outside the build root.

## Runtime packages cover a different dependency class

The [runtime-environment guide](https://docs.bentoml.com/en/latest/build-with-bentoml/runtime-environment.html) explains Python versions, packages, system dependencies and image customization. Installing a tokenizer library does not automatically include a project-specific vocabulary or transformation table stored elsewhere in the checkout.

[Tokenizer release manifests](/journal/tokenizer-artifact-release-manifest/) explain why model-adjacent files need identifiable versions. Keep the semantic relationship between the model and these assets explicit rather than resolving an arbitrary local file with a convenient matching name.

## Make inclusion rules reviewable

The [build-options reference](https://docs.bentoml.com/en/latest/reference/bentoml/bento-build-options.html) documents file-selection configuration and supported build settings. Review the effective rule set and relative asset paths together, especially after restructuring source directories.

[Artifact signature verification](/journal/artifact-signature-verification/) addresses integrity of identified artifacts. Integrity checks remain useful, but cannot make an omitted file appear in the container. Presence, identity and runtime readability are distinct conditions for a complete release.

## Test from the packaged environment

Run the built artifact with a clean working directory and the same asset-loading path used by the endpoint. Exercise an input that actually needs the custom resource rather than stopping after a successful module import.

Record the packaged asset identity in release evidence. The useful completion criterion is that the intended runtime can read the intended version from the intended path; successful dependency installation alone is insufficient evidence for that claim.
