Skip to main content

sypho build

Build an agent Docker image with auto-discovery of entrypoints and tools.

Usage

sypho build --version <VERSION> [OPTIONS]

Options

FlagDescription
--version <VERSION>Image version tag (required)

What It Does

  1. Auto-Discovery: Runs auto_package.py to scan code for @entrypoint and @tool decorators
  2. Generates Manifest: Creates manifest.json with agent configuration
  3. Builds Image: Runs docker build with generated Dockerfile
  4. Tags Image: Names image as {agent-name}:{version}

Example

cd my-agent
sypho build --version 0.1.0

Output:

🔍 Discovering entrypoints and tools...
✓ Found 1 entrypoint: main
✓ Found 2 tools: example_tool, fetch_data

📦 Building Docker image...
[+] Building 12.3s (10/10) FINISHED
✓ Built: my-agent:0.1.0

Generated Manifest

builds/my-agent/0.1.0/manifest.json:

{
"schema_version": "1.0",
"agent_name": "my-agent",
"version": "0.1.0",
"execution_mode": "agent",
"agent_config": {
"model": "anthropic/claude-3-5-sonnet-20241022",
"max_tokens": 4096,
"max_iterations": 10,
"system_prompt": "You are a helpful assistant."
},
"entrypoints": {
"main": {
"tools": ["example_tool", "fetch_data"],
"local_tools": []
}
}
}

Docker Image

Uses multi-stage build:

  1. Install Python dependencies
  2. Copy agent code
  3. Set entrypoint to SDK runtime

Local Testing

# Verify image
docker images | grep my-agent

# Run locally
docker run my-agent:0.1.0

Troubleshooting

Auto-discovery fails

Ensure decorators are used correctly:

from sypho_sdk import entrypoint, tool

@entrypoint # Required
async def main(input: dict, context: AgentContext):
...

Docker build fails

Check Dockerfile and requirements.txt are present.

Next Steps