pkg
The pkg command group lets you package and export your application for custom deployments.
Currently it supports exporting a Dockerfile that can be built into an image with any OCI compliant image builder, such as docker or podman.
llamactl pkg [COMMAND] [options]Available Commands
Section titled “Available Commands”container– Generate a minimal, build-ready container file (e.g.,Dockerfile) for your workflows.
Command: container
Section titled “Command: container”llamactl pkg container [DEPLOYMENT_FILE] [options]Generates a container build file from a given deployment file and user-specified options.
Options
Section titled “Options”deployment_file- Path to the deployment file. Defaults to the current directory (.)--python-version- Python version for the base image. If not specified, it’s inferred from.python-versionorpyproject.toml; defaults to 3.12 if none found.--port <int>- Port to expose for the API server. Defaults to 4501.--dockerignore-path- Path for the generated.dockerignorefile. Defaults to.dockerignore.--overwrite- Overwrite any existing output files. No default value.--exclude <path>- Path(s) to exclude from the build (appended to.dockerignore). Can be used multiple times. No default value.--output-file- Path and filename for the generated container build file. Defaults toDockerfile.--help- Show help for this command and exit. No default value.
- The generated
.dockerignorefile automatically excludes common Python-related directories such as:- Local virtual environments
- Caches
- Files that may contain sensitive data (e.g.,
.env)
- The produced container file is minimal by design. It should work for most cases, but you may need to customize it for specific use cases.
Examples
Section titled “Examples”1. Create default Dockerfile and .dockerignore:
llamactl pkg container2. Generate a custom container file with specific name, Python version, and port:
llamactl pkg container --output-file Containerfile --python-version 3.14 --port 45023. Exclude certain files or directories from the build:
llamactl pkg container --exclude .env.local --exclude .github/workflows/ --exclude "*.pdf"Note for AI agents: this documentation is built for programmatic access.
- Overview of all docs: https://developers.llamaindex.ai/llms.txt
- Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md
- Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters.
- A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/python/shared/mcp/