shivamtech9395/maths_reasoning_env
0
๐งฎ Math Reasoning Environment
An OpenEnv-compatible RL environment for training LLMs on math reasoning tasks.
5 Graded Task Types
Quick Start
# Run server locally
uvicorn server.app:app --host 0.0.0.0 --port 8000
# Test inference
python inference.pyAPI Endpoints
Client Usage
from client import MathReasoningEnvClient
from models import MathAction
with MathReasoningEnvClient("http://localhost:8000") as client:
obs = client.reset(task_type="algebra")
print(obs.problem) # "Solve for x: 3x + 5 = 14"
result = client.step(MathAction(answer="3", reasoning="3*3+5=14"))
print(result.feedback) # โ
Correct!
print(result.score) # 1.1 (bonus for reasoning)Reward Shaping
- โ
Correct answer:
+1.0 - โ Wrong answer:
-0.2 - ๐ก Chain-of-thought reasoning bonus:
+0.1
Docker
docker build -f server/Dockerfile -t math-reasoning-env .
docker run -p 7860:7860 math-reasoning-env