API
Use /reset, /step, and /state for environment control.
The same reset-step-state loop is what OpenEnv expects at the environment layer.
from __future__ import annotations import json from fastapi import FastAPI from fastapi.responses import HTMLResponse from pydantic import BaseModel from env.environment import GPUInferenceSchedulingEnv from env.models import SchedulingAction, SchedulingObservation, SchedulingStepResult class ResetRequest(BaseModel): seed: int | None = None scenario_id: str | None = None app = FastAPI(title="GPU Inference Scheduling Copilot") ENV = GPUInferenceSchedulingEnv() @app.get("/health") def health() -> dict[str, str]: return {"status": "ok"} @app.post("/reset", response_model=SchedulingObservation) def reset(request: ResetRequest) -> SchedulingObservation: return ENV.reset(seed=request.seed, scenario_id=request.scenario_id) @app.get("/state", response_model=SchedulingObservation) def state() -> SchedulingObservation: return ENV.state() @app.post("/step", response_model=SchedulingStepResult) def step(action: SchedulingAction) -> SchedulingStepResult: return ENV.step(action) @app.get("/web", response_class=HTMLResponse) def web() -> str: state_json = json.dumps(ENV.state().model_dump(mode="json"), indent=2) return f"""
A contest-first benchmark for VRAM-aware, deadline-aware scheduling decisions.
Use /reset, /step, and /state for environment control.
The same reset-step-state loop is what OpenEnv expects at the environment layer.
{state_json}