Skip to main content

Production infrastructure for HyperCycle AIMs — telemetry, retries, health, and inter-AIM routing.

Project description

qyra

CI

PyPI License: Apache 2.0 Python 3.10+

Production infrastructure for HyperCycle AIMs.

qyra is a small, dependable toolkit for building, instrumenting, and operating AI Microservices on the HyperCycle network. It gives you four things that every production AIM needs and that you'd otherwise re-implement: telemetry, retries, health endpoints, and inter-AIM routing.

Why qyra

If you're building an AIM today, you're probably writing the same handful of boilerplate every time:

  • A try/except around every model call to log latency and tokens.
  • An ad-hoc retry loop when the next-hop AIM hiccups.
  • /health and /ready endpoints copy-pasted from your last service.
  • A homegrown HTTP client with timeouts you tune by trial and error.

qyra standardises this so you can focus on what your AIM actually does.

Install

pip install qyra

For FastAPI integration (recommended):

pip install 'qyra[fastapi]'

30-second quickstart

from fastapi import FastAPI
from qyra import attach_health_endpoints, instrument, track

app = FastAPI()
attach_health_endpoints(app, aim_name="my-aim", aim_version="0.1.0")

@app.post("/ask")
@instrument(operation="ask")
async def ask(payload: dict):
    # your model call here
    response = call_my_model(payload["question"])
    track("ask", response, aim_name="my-aim")
    return {"answer": response.text}

That's it. Every call to /ask now reports latency, success/failure, model, and token usage to your telemetry endpoint. /health, /ready, and /metrics exist automatically.

Configuration

qyra is environment-driven. The most common variables:

Variable Purpose
QYRA_TELEMETRY_URL Where to POST telemetry events.
QYRA_API_KEY API key sent in the X-Qyra-Api-Key header.
QYRA_AIM_NAME Default AIM name when not passed to a call.
QYRA_DISABLED Set to 1 to silence telemetry (useful in tests).

Full list: see src/qyra/config.py.

Inter-AIM calls

qyra.AsyncClient (and qyra.Client) wrap httpx with retries, timeouts, and automatic telemetry:

from qyra import AsyncClient

async def fetch_news():
    async with AsyncClient("aim-web-research", base_url="http://127.0.0.1:8087") as c:
        resp = await c.post("/research", json={"query": "HyperCycle"})
        return resp.json()

Failed calls are retried with exponential backoff. Every call — successful or not — emits a telemetry event tagged with the operation name.

What qyra is not

  • Not a competing AIM marketplace. It plays well with HMS, HyperCycle's own marketplace.
  • Not a node-operator certification. That's HyperCycle's 88.88 Certification — we operate at the AIM layer, not the node layer.
  • Not magic. It's a thin layer over httpx and FastAPI. Read the source.

License

Apache 2.0 — see LICENSE.

Status

This is an alpha release (0.1.0). The public API may shift before 1.0. We use semantic versioning from 1.0 onward.


Built by Qyratech for the HyperCycle ecosystem.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qyra-0.1.3.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qyra-0.1.3-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file qyra-0.1.3.tar.gz.

File metadata

  • Download URL: qyra-0.1.3.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for qyra-0.1.3.tar.gz
Algorithm Hash digest
SHA256 81c585303878ef51c81f8b0bf84e898e817dc7d8832be5dce01dd4e62d11446c
MD5 88595ef35fed30a694189aa294ec60f6
BLAKE2b-256 8faef4a251405a88207570d5e270e90174208752c308ba7ea24cef933b584f94

See more details on using hashes here.

File details

Details for the file qyra-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: qyra-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for qyra-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e7a01d62ab8fb8787d5aa01015cf27a79456f49b995eca0b6a824836d18a6d5b
MD5 849041c3e59ca86aca2489811efec147
BLAKE2b-256 8566c605eb2d45de975f2815eae1a3e13664720c194dee787892abe4ece33bc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page