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.2.tar.gz (21.2 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.2-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qyra-0.1.2.tar.gz
  • Upload date:
  • Size: 21.2 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.2.tar.gz
Algorithm Hash digest
SHA256 655f9d45635835d48fe5963a9bad8f621e85e71d697c126fb55effdec35506ff
MD5 34a5fab68c6c01dd3d60311ceb51ad7a
BLAKE2b-256 5be24ed13f6ab5bd8973fc935b7d9e19376202fa313a76c6606754aa56748007

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qyra-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de4ce9cfae8b063c537898a38cab714a87b51ac42412ce65b510f9d0a40e039e
MD5 f392331b0a908eb2b8d52dfa793aa9af
BLAKE2b-256 6a342fd7c0ca94deee5486cbfec4a7eebf1d118a8044a24a609c84a81808e0b2

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