Testing Locally
Develop and test ORS servers on your local machine for rapid iteration and debugging.Why Test Locally?
Benefits:- Rapid Iteration - Test changes instantly without deployment
- Debugging - Use debuggers and inspect environment behavior
- Offline Development - Work without internet connection
- Cost Savings - No cloud resources during development
Quick Start
1. Install Dependencies
2. Create Your ORS Server
3. Run the Server
http://localhost:8080!
Testing Methods
Method 1: Python Client
Use the OpenReward Python SDK to test your server:Method 2: curl Commands
Test HTTP endpoints directly with curl: Health check:Method 3: Python httpx
For more control than the SDK provides:Debugging
Enable Debug Logging
Use Debugger
Print Debugging
Inspect Requests
Add middleware to log all requests:Common Issues
Issue: “Connection refused”
Cause: Server not running Solution:Issue: “404 Environment not found”
Cause: Environment name mismatch Solution: Environment name is the class name in lowercase:- Class:
MathEnvironment - API name:
mathenvironment
Issue: “404 Session not found”
Cause: Session ID not provided or expired Solution: Always includeX-Session-ID header:
Issue: Tool call hangs
Cause: Not accepting SSE responses Solution: Use-N flag with curl or proper SSE handling:
Issue: Import errors
Cause: Missing dependencies Solution:Testing Best Practices
1. Test All Endpoints
Create a comprehensive test script:2. Test Error Handling
3. Test Episode Lifecycle
4. Test with Different Tasks
Local Development Workflow
Recommended Workflow
- Write environment code in
server.py - Run server in one terminal:
python server.py - Test in another terminal:
python test_client.py - Make changes to server code
- Restart server (Ctrl+C, then
python server.pyagain) - Re-run tests
Auto-Reload with Uvicorn
Enable auto-reload for faster development:Docker Testing
Build and Run Locally
CreateDockerfile:
Docker Compose
For more complex setups:Next Steps
Implementing Servers
Learn best practices for ORS servers
HTTP API
Complete API reference
Quick Start
Complete tutorial
Key Takeaway: Local testing enables rapid development and debugging of ORS servers. Use Python client for quick testing, curl for HTTP-level debugging, and Docker for production-like testing.

