What You’ll Build
A working ORS server for math problems (GSM8K-style) with:- One tool (
submit) for submitting answers - Train and test task splits
- Reward signals for RL training
- Local HTTP server you can test with curl or Python
Prerequisites
- Python 3.11+ installed
- Basic Python knowledge
- Terminal/command line access
Step 1: Install Dependencies
The ORS Python SDK is one implementation of the ORS specification. We’ll use it for this quickstart.Step 2: Download GSM8K Data
Download the GSM8K dataset from the HuggingFace repository:- Download train-00000-of-00001.parquet
- Download test-00000-of-00001.parquet
GSM8K is a dataset of grade school math word problems. Each task has a question and an integer answer.
Step 3: Create Your Environment
Create a filegsm8k_env.py:
- Loads GSM8K tasks from the parquet files
- Defines an ORS environment with math tasks
- Implements
list_splits(),list_tasks(), andget_prompt() - Creates a
submittool that checks answers and returns rewards - Starts an HTTP server on port 8080
Step 4: Run the Server
Step 5: Test with HTTP
Let’s test the server with curl. Open a new terminal:List environments
List tools
List splits
List tasks
The full dataset contains 7,473 training tasks and 1,319 test tasks.
Step 6: Run an Episode
Now let’s run a complete episode (session):Create session ID
task_id event. Save it for the next steps.
Create episode
Use a task from the dataset:Get prompt
Call submit tool
finished: true.
Cleanup
Step 7: Test with Python Client
Createtest_client.py:
Understanding the Code
Key Components
1. Environment ClassEnvironment base class, which handles HTTP protocol details.
2. Splits and Tasks
ToolOutput with reward and finished flag.
5. Tool Output
What You’ve Learned
- How to implement an ORS server using the Python SDK
- Core ORS concepts: splits, tasks, tools, prompts, rewards
- How sessions (episodes) work
- The HTTP API for ORS
- How to test an ORS server locally
Next Steps
Add More Tools
Add bash, calculator, or other tools to your environment
Design Rewards
Learn reward design patterns for RL
Implementation Guide
Deep dive into building ORS servers
Specification
Understand the complete ORS protocol
Common Issues
”ModuleNotFoundError: No module named ‘ors’”
Install the SDK:“404 Environment not found”
Check the environment name matches the class name (lowercase):- Class:
GSM8KEnvironment - Name:
gsm8kenvironment

