Developer Tutorials
How to Deploy Your Own AI Model as a Miner on ORI
ORI allows you to deploy your custom AI models (like your TRM Oracle) as miners. Your model runs on confidential Targon infrastructure, but you only interact with ORI’s clean dashboard and API. No Targon commands or SDK are visible to you.
Prerequisites
- ORI Miner account (enabled)
- Your model files ready (e.g.
miner.py,trm_100_oracle.py,hybrid_heads.py,ETH_trm_oracle.pt,ETH_oracles.json, etc.) - Basic Python knowledge
Step 1: Prepare Your Miner Package
Create a clean folder with only the files needed for inference:
eth_miner_v1/
├── core
│ ├── hybrid_heads.py
│ ├── __init__.py
│ └── trm_100_oracle.py
├── ETH_01_correlation_hunter.py (only for reference)
├── ETH_02_dataset_builder.py (only for reference)
├── ETH_03_signal_generator_training.py (only for reference)
├── ETH_04b_xgboost_baseline.py (only for reference)
├── ETH_04_evaluator.py (only for reference)
├── ETH_18_signal_generator_daemon.py (only for reference)
├── ETH_19_evaluation_truth_engine.py (only for reference)
├── ETH_ml_dataset.csv (only for reference)
├── ETH_oracles.json (model specs: e.g.:
{
"target": "ETH-USDC",
"optimal_horizon": 66,
"oracles": {
"BTC-USDC": 66,
"DOGE-USDC": 61,
"LINK-USDC": 149,
"SPY": 109
}
}
)
├── ETH_raw_data.csv (only for reference)
├── ETH_trm_oracle.pt (model weights)
├── miner.py
├── README.md
└── requirements.txt
Important modification to miner.py
Replace the dual-broadcast section with a clean call to ORI (remove the local 127.0.0.1:5050 hardcoding if you want it fully portable):
# Inside forward() method, replace the _push_to_platform block with:
try:
import threading
def _push_to_platform():
try:
payload = {
"model_id": self.wallet.hotkey.ss58_address,
"asset": self.asset,
"spot_price": float(current_spot),
"ptdv": ptdv_signal,
"prediction_timestamp": synapse.prediction_timestamp,
"processing_time": time.time() - start_time
}
# This will be replaced by ORI during deployment with the correct endpoint
import requests
requests.post("https://api.ori.app/api/v1/submit_ptdv",
json=payload, timeout=8)
except Exception as e:
pass # Silent fail - do not crash the miner
threading.Thread(target=_push_to_platform, daemon=True).start()
except Exception:
pass
Step 2: Go to ORI Miner Dashboard
Log in → Miner → Deploy New Model
Step 3: Use the Deployment Wizard
Choose “Advanced Custom Miner (Bittensor-style)”
- Upload Package: Zip your
my-miner/folder and upload it - Entry Point:
miner.py(the file containing theETHMinerclass) - Main Class:
ETHMiner - Hardware Tier: GPU (recommended for TRM Oracle) or CPU Small
- Signal Endpoint: ORI will automatically expose
/generate_signal(or you can keep using the internal Bittensor axon style — ORI handles the wrapper)
ORI will:
- Automatically install dependencies from
requirements.txt - Bundle your model weights (
ETH_trm_oracle.pt) - Wrap your miner so it can receive challenges and submit PTDV signals via ORI’s API
- Deploy it as a confidential, auto-scaling serverless function on Targon
Step 4: Test the Deployment
After deployment:
- Use the Test Challenge button in ORI
- Send a sample
TRMChallengepayload - Check that you receive a correctly formatted PTDV response and that it appears in your platform’s signal feed
Step 5: Register for Competition
Click “Register Model for Live Competition”.
Your miner is now eligible to receive real challenges and earn based on signal quality.
Monitoring
In My Models you can see:
- Status & uptime
- Number of challenges processed
- Average processing time
- Tokens/compute usage (for billing transparency)
Tips
- For multiple assets (ETH + others), deploy one miner per asset or modify the class to handle multiple.
- Keep model weights under ~2–4 GB for fast cold starts. Larger models may need persistent rental mode (contact support).
- All inference runs in full confidential compute.