Round Local Development
Round Local Development
This guide explains how to set up and run the Round service locally without Docker.
Quick Start
1. Run Setup Script
The setup script downloads all required dependencies:
./setup-local-dev.shThis will:
- Download ONNX Runtime v1.23.1 (8-22MB depending on architecture)
- Download tokenizers library (~14MB)
- Create necessary symlinks
- Generate
.env.localwith environment variables
2. Build the Service
source .env.localmake build3. Run the Service
Option A: Using the wrapper script (recommended)
./run-local.shOption B: Run binary directly with environment
source .env.local./bin/appOption C: Full command
LD_LIBRARY_PATH="$(pwd)/.local-deps/onnxruntime-linux-x64-1.23.1/lib:$(pwd)/.local-deps:$LD_LIBRARY_PATH" \ MODEL_CACHE_DIR="$(pwd)/models" \ LOG_LEVEL=debug \ GRPC_PORT=8080 \ ./bin/appTesting
Test that the service is running:
# List available modelsgrpcurl -plaintext localhost:8080 round.v1.RoundService/ListModels
# Test face detection with an imagecat > /tmp/test_request.json << 'EOF'{ "model_id": "face-detection", "image_base64": "$(base64 -w 0 < your-image.jpg)"}EOF
grpcurl -plaintext -d @ localhost:8080 round.v1.RoundService/Infer < /tmp/test_request.jsonRunning Tests
# Source environment firstsource .env.local
# Run unit tests (embeddings tests will fail without tokenizers lib, but that's expected)make run-tests
# Run embeddings benchmark inside the docker build image (no local CGO deps needed)make bench-embeddings
# Run lintermake lintTroubleshooting
Error: onnxruntime.so: cannot open shared object file
Cause: The LD_LIBRARY_PATH is not set correctly.
Solution:
# Make sure to source the environment filesource .env.local
# Or set it manuallyexport LD_LIBRARY_PATH="$(pwd)/.local-deps/onnxruntime-linux-x64-1.23.1/lib:$(pwd)/.local-deps:$LD_LIBRARY_PATH"Error: cannot find -ltokenizers
Cause: The tokenizers library is not installed or CGO_LDFLAGS is not set.
Solution:
# Re-run setup script./setup-local-dev.sh
# Then rebuildsource .env.localmake buildPort Already in Use
Error: address already in use
Solution:
# Check what's using port 8080lsof -i :8080
# Kill the process or use a different portexport GRPC_PORT=8081./run-local.shDependencies Structure
After running setup, your directory structure will look like:
apps/round/├── .local-deps/ # Downloaded dependencies│ ├── onnxruntime-linux-*/ # ONNX Runtime C libraries│ │ ├── include/ # Header files for building│ │ └── lib/ # Shared libraries (.so files)│ ├── libtokenizers.a # Static tokenizers library│ └── libtokenizers.so # Shared tokenizers library├── .env.local # Auto-generated environment file├── setup-local-dev.sh # Setup script├── run-local.sh # Wrapper to run service├── models/ # ONNX model files└── bin/ # Built binary (after make build)Environment Variables
The .env.local file sets these variables automatically:
| Variable | Value | Purpose |
|---|---|---|
CGO_ENABLED | 1 | Enable CGO for C library linking |
LD_LIBRARY_PATH | .local-deps/onnxruntime-*/lib:.local-deps | Runtime library search path |
CGO_CFLAGS | -I.local-deps/onnxruntime-*/include | C header files path for building |
CGO_LDFLAGS | -L... -lonnxruntime -ltokenizers | Linker flags for C libraries |
MODEL_CACHE_DIR | ./models | Directory containing ONNX models |
LOG_LEVEL | debug | Logging verbosity |
GRPC_PORT | 8080 | gRPC server port |
Cleaning Up
To remove all downloaded dependencies:
rm -rf .local-deps .env.localTo rebuild from scratch:
# Clean dependenciesrm -rf .local-deps .env.local bin/
# Re-setup./setup-local-dev.sh
# Rebuildsource .env.localmake buildDevelopment Workflow
- Make code changes
- Rebuild:
source .env.local && make build - Test:
make run-tests && make lint - Run:
./run-local.sh - Test API: Use
grpcurlto test endpoints
Notes
- The
.local-depsdirectory is ignored by git (should be in .gitignore) - Library downloads are cached - setup is fast after first run
- The symlinks (onnxruntime.so) are required because the Go bindings expect files without the “lib” prefix
- Both ONNX Runtime and tokenizers must be in LD_LIBRARY_PATH at runtime