Quick guide for testing the MUXI Runtime Docker container.
- Docker installed (Docker Desktop or Docker Engine)
- OpenAI API key (or other LLM provider key)
- Formation YAML file
Before Docker, test that the runtime works locally:
# Set your API key
export OPENAI_API_KEY="sk-..."
# Run the test script
./test-local-server.shExpected: Server starts on http://localhost:8000
Test endpoints:
# Health check
curl http://localhost:8000/v1/health
# Server info
curl http://localhost:8000/
# API docs
open http://localhost:8000/docs# Build the default image
./scripts/build/runtime.sh
# Or build a specific variant
./scripts/build/runtime.sh --variant pytorch
# Check image size
docker images muxi-runtimeExpected image size: ~2.4 GB (default), larger for pytorch/cuda variants
# Set API key
export OPENAI_API_KEY="sk-..."
# Start container
docker-compose -f docker-compose.test.yaml up
# Or detached mode
docker-compose -f docker-compose.test.yaml up -d
# View logs
docker-compose -f docker-compose.test.yaml logs -f
# Stop
docker-compose -f docker-compose.test.yaml downdocker run -it --rm \
-v $(pwd)/examples:/formations:ro \
-e OPENAI_API_KEY="sk-..." \
-p 8000:8000 \
muxi-runtime:test \
/formations/test-formation.afsFlags explained:
-it- Interactive terminal--rm- Remove container after exit-v- Mount formations directory (read-only)-e- Set environment variable-p- Port mapping (host:container)
# Health check
curl http://localhost:8000/v1/health
# Get server status
curl http://localhost:8000/
# View API documentation
open http://localhost:8000/docs
# Test chat endpoint
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{
"message": "Hello! What can you help me with?",
"user_id": "test-user"
}'my-formation/
├── formation.afs
├── agents/
│ └── assistant.yaml
├── knowledge/
│ └── docs.txt
└── sops/
└── onboarding.md
docker run -it --rm \
-v /path/to/my-formation:/formation:ro \
-e OPENAI_API_KEY="sk-..." \
-p 8000:8000 \
muxi-runtime:test \
/formation/formation.afsProblem: Volume mount incorrect
Solution:
# Check your paths
ls /path/to/formation/formation.afs
# Use absolute paths
docker run -v "$(pwd)/my-formation:/formation:ro" ...Problem: Environment variable not set
Solution:
# Check if set
echo $OPENAI_API_KEY
# Set it
export OPENAI_API_KEY="sk-..."
# Or inline
docker run -e OPENAI_API_KEY="sk-..." ...Problem: Port 8000 is occupied
Solution:
# Use different host port
docker run -p 9000:8000 ...
# Or set in environment
docker run -e FORMATION_PORT=9000 -p 9000:9000 ...Problem: Check logs
Solution:
# View logs
docker logs <container-id>
# Or with docker-compose
docker-compose -f docker-compose.test.yaml logs# Required
OPENAI_API_KEY=sk-...
# Optional
FORMATION_HOST=0.0.0.0
FORMATION_PORT=8000
ANTHROPIC_API_KEY=sk-...# docker-compose.yaml
deploy:
resources:
limits:
cpus: '2.0'
memory: 2GThe container includes a health check:
# Docker will automatically check
curl -f http://localhost:8000/v1/healthAfter Docker testing passes:
- SIF Conversion - Convert Docker image to Singularity SIF
- Server Integration - Test with MUXI Server deployment
- Performance Testing - Load test multiple formations
- Production Deployment - Deploy to production environment
# Stop all containers
docker-compose -f docker-compose.test.yaml down
# Remove images
docker rmi muxi-runtime:test
# Clean up volumes
docker volume prune
# Full cleanup
docker system prune -a