SDK & CLI Guide
The Agnitra CLI mirrors the Python SDK so teams can trigger optimizations, collect telemetry, and emit usage events from any environment.CLI Commands
agnitra optimize
Optimize a TorchScript model and optionally save the optimized artifact.
--device— moves the model to a specific device (e.g.cuda:0).--disable-rl— skip PPO fine-tuning passes.--offline— disable control plane calls (requires enterprise license).--require-license— fail if license validation is unavailable.--license-seat/--license-org— override license metadata sent to the control plane.
agnitra-api
Start the Agentic Optimization API backed by Starlette:
POST /optimize— synchronous or async queued optimization.GET /jobs/{id}— poll async job status.POST /usage— convert telemetry snapshots into marketplace usage records.
AGNITRA_API_KEY (and variants) and enforced for every request.
agnitra-dashboard
Spin up the HTML dashboard for local telemetry review:
Python SDK Highlights
agnitra.optimize(model, input_tensor=...)returns aRuntimeOptimizationResultincluding the optimized model, usage event, and patch metadata.agnitra.sdk.resolve_input_tensorsynthesizes input tensors based on shape hints or example tensors on the module.- Usage events expose GPU hours saved, cost savings, and marketplace metadata (see
agnitra/core/metering/usage_meter.py).
Example
Troubleshooting
- Missing PyTorch: install
torch>=2.0or ensure CUDA libs are discoverable. - Control plane unavailable: pass
--offlineor setAGNITRA_CONTROL_PLANE_URLto the reachable endpoint. - Stripe/NVML optional deps: install extras (
agnitra[nvml],agnitra[marketplace]) to enable GPU telemetry and marketplace dispatchers.