Getting Started¶
Install the Infrintia package from a local checkout:
git clone https://github.com/CrossGL/infrintia.git
cd infrintia
pip install -e ".[dev]"
cp .env.example .env
Run the broker locally:
python run_server.py
Start a host agent in another terminal. Without HOST_TOKEN, the agent
auto-detects local hardware and registers itself with the broker.
python -m host_agent.agent
Create a user and keep the returned API key:
curl -s -X POST http://127.0.0.1:8000/users \
-H "Content-Type: application/json" \
-d '{"name":"researcher","initial_credits":20}'
Submit inference through the SDK:
from sdk.compute import ComputeClient
client = ComputeClient("http://127.0.0.1:8000", api_key="YOUR_API_KEY")
job = client.run_model(
model_name="gpt2",
prompt="Quantum tunneling is",
estimated_runtime_seconds=60,
max_new_tokens=80,
backend="worker",
)
for event in client.stream_job(job["job_id"]):
if event["type"] == "token":
print(event["text"], end="", flush=True)
Core environment variables¶
DATABASE_URLSQLAlchemy async database URL. SQLite is used by default for development.
REDIS_URLandREDIS_ENABLEDEnable Redis-backed caching, streaming, and rate limiting for distributed broker deployments.
ADMIN_API_KEYRequired for admin endpoints such as forced job failure and host bans.
BROKER_URLandHOST_TOKENConfigure host agents that connect to a local or deployed broker.