{"id":49221588,"url":"https://github.com/deyzho/axonsdk-ts","last_synced_at":"2026-04-24T04:00:54.798Z","repository":{"id":349216345,"uuid":"1200983028","full_name":"deyzho/axonsdk-ts","owner":"deyzho","description":"One SDK. Any compute. Route AI inference to GPU clusters, cloud, edge, or TEE nodes — io.net, Akash, Acurast, Fluence, Koii, AWS, GCP, Azure, Cloudflare, Fly.io.","archived":false,"fork":false,"pushed_at":"2026-04-24T02:00:58.000Z","size":1140,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T02:16:22.766Z","etag":null,"topics":["ai","akash","aws","cloud-computing","cloudflare-workers","edge-computing","gpu","inference","llm","multi-provider","openai","react-native","routing","sdk","typescript"],"latest_commit_sha":null,"homepage":"https://axonsdk.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deyzho.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-04T04:04:06.000Z","updated_at":"2026-04-24T02:00:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deyzho/axonsdk-ts","commit_stats":null,"previous_names":["deyzho/phonix","deyzho/phonixsdk","deyzho/axon-ts","deyzho/axonsdk-ts"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/deyzho/axonsdk-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deyzho%2Faxonsdk-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deyzho%2Faxonsdk-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deyzho%2Faxonsdk-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deyzho%2Faxonsdk-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deyzho","download_url":"https://codeload.github.com/deyzho/axonsdk-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deyzho%2Faxonsdk-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32208477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","akash","aws","cloud-computing","cloudflare-workers","edge-computing","gpu","inference","llm","multi-provider","openai","react-native","routing","sdk","typescript"],"created_at":"2026-04-24T04:00:34.716Z","updated_at":"2026-04-24T04:00:54.767Z","avatar_url":"https://github.com/deyzho.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AxonSDK\n\n[![CI](https://github.com/deyzho/axonsdk-ts/actions/workflows/publish.yml/badge.svg)](https://github.com/deyzho/axonsdk-ts/actions/workflows/publish.yml)\n[![npm](https://img.shields.io/npm/v/@axonsdk/sdk)](https://www.npmjs.com/package/@axonsdk/sdk)\n[![Node](https://img.shields.io/node/v/@axonsdk/sdk)](https://nodejs.org)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE)\n\n**[axonsdk.dev](https://axonsdk.dev) · [npm](https://www.npmjs.com/org/axonsdk) · [Roadmap](./ROADMAP.md) · [GitHub](https://github.com/deyzho/axonsdk-ts)**\n\n**One SDK. Any compute. Route AI inference to the fastest, cheapest backend — cloud, edge, or your own infrastructure.**\n\nAxonSDK is a universal AI compute routing layer. Stop rewriting integrations every time you switch providers, hit rate limits, or find a cheaper GPU. Point AxonSDK at any backend — GPU clusters, container clouds, serverless functions, TEE enclaves, or your own servers — and it handles routing, failover, and cost optimisation automatically.\n\nDrop in the OpenAI-compatible `@axonsdk/inference` package and your existing code routes to a new backend in two lines. Call your deployed processors from **iOS and Android** with `@axonsdk/mobile`.\n\n\u003e AxonSDK is to AI compute what httpx is to HTTP — **one client, any backend**.\n\n---\n\n## Supported providers\n\n### Edge \u0026 private compute\n\n| Provider | Status | Nodes | Runtime | Cost |\n|---|---|---|---|---|\n| [io.net](https://io.net) | ✅ Live | GPU clusters (A100, H100, RTX) | nodejs, python | ~$0.40/hr GPU spot |\n| [Akash Network](https://akash.network) | ✅ Live | Container compute marketplace | nodejs, docker | Pay-per-use |\n| [Acurast](https://acurast.com) | ✅ Live | 237k+ mobile TEE nodes | nodejs, wasm | Pay-per-execution |\n| [Fluence](https://fluence.network) | ✅ Live | Serverless function compute | nodejs | Pay-per-ms |\n| [Koii](https://koii.network) | ✅ Live | Distributed task nodes | nodejs | Pay-per-task |\n\n### Cloud providers\n\n| Provider | Status | Services | Runtime |\n|---|---|---|---|\n| [AWS](https://aws.amazon.com) | ✅ Live | Lambda, ECS / Fargate, EC2 | python, nodejs, docker |\n| [Google Cloud](https://cloud.google.com) | ✅ Live | Cloud Run, Cloud Functions | python, nodejs, docker |\n| [Azure](https://azure.microsoft.com) | ✅ Live | Container Instances, Functions | python, nodejs, docker |\n| [Cloudflare Workers](https://workers.cloudflare.com) | ✅ Live | Workers, R2, AI Gateway | nodejs, wasm |\n| [Fly.io](https://fly.io) | ✅ Live | Fly Machines | python, nodejs, docker |\n\n\u003e **Provider health dashboard:** Real-time status and latency for all networks → [status.axonsdk.dev](https://status.axonsdk.dev)\n\n---\n\n## Quick start (TypeScript / Node.js)\n\n### 1. Install the CLI\n\n```bash\nnpm install -g @axonsdk/cli\n```\n\n### 2. Initialise a new project\n\n```bash\nmkdir my-app \u0026\u0026 cd my-app\naxon init\n```\n\nPrompts for project name, provider, and template, then generates `axon.json`, `.env`, and `src/index.ts`.\n\n### 3. Configure credentials\n\n```bash\naxon auth\n```\n\nThe interactive wizard generates and stores all required keys for your chosen provider. Your `.env` is locked to owner-only permissions automatically.\n\n### 4. Test locally\n\n```bash\naxon run-local\n```\n\nRuns your script in a local mock environment — simulates provider runtime APIs without touching the network or spending credits.\n\n### 5. Deploy\n\n```bash\naxon deploy\n```\n\nBundles your script, uploads it, and registers the deployment.\n\n```\n✔ Deployment live!\n  Deployment ID: 0xabc123...\n  Processors:    3 matched\n    • 0xproc1...\n    • 0xproc2...\n    • 0xproc3...\n```\n\n### 6. Send and receive\n\n```typescript\nimport { AxonClient } from '@axonsdk/sdk';\n\nconst client = new AxonClient({\n  provider: 'ionet', // 'ionet' | 'akash' | 'acurast' | 'fluence' | 'koii' | 'aws' | 'gcp' | 'azure' | 'cloudflare' | 'flyio'\n  secretKey: process.env.AXON_SECRET_KEY,\n});\n\nawait client.connect();\n\nclient.onMessage((msg) =\u003e {\n  const { result } = msg.payload as { result: string };\n  console.log('Result:', result);\n});\n\nawait client.send('0xproc1...', { prompt: 'Summarize: The quick brown fox...' });\n\nclient.disconnect();\n```\n\n---\n\n## CLI reference\n\n| Command | Description |\n|---|---|\n| `axon init` | Interactive setup — generates `axon.json`, `.env`, and template files |\n| `axon auth [provider]` | Credential wizard — generates and stores keys for the selected provider |\n| `axon deploy` | Bundle and register your deployment |\n| `axon run-local` | Run locally with a mock provider runtime |\n| `axon status` | List deployments, processor IDs, and live status |\n| `axon send \u003cid\u003e \u003cmsg\u003e` | Send a test message to a processor node |\n| `axon teardown \u003cid\u003e` | Delete a deployment and free provider resources |\n| `axon template list` | Show available built-in templates |\n\nSupported providers: `ionet`, `akash`, `acurast`, `fluence`, `koii`, `aws`, `gcp`, `azure`, `cloudflare`, `flyio`\n\n---\n\n## SDK reference\n\n```typescript\nimport { AxonClient } from '@axonsdk/sdk';\nimport type { DeploymentConfig } from '@axonsdk/sdk';\n\nconst client = new AxonClient({\n  provider: 'ionet',\n  secretKey: process.env.AXON_SECRET_KEY,\n});\n\nawait client.connect();\n\n// Estimate cost before deploying\nconst cost = await client.estimate({\n  runtime: 'nodejs',\n  code: './dist/index.js',\n  schedule: { type: 'on-demand', durationMs: 86_400_000 },\n  replicas: 1,\n});\nconsole.log(`Estimated: ${cost.amount} ${cost.token}`);\n\n// Deploy\nconst deployment = await client.deploy({ ... });\n\n// Send a message\nawait client.send(deployment.processorIds[0], { prompt: 'Hello' });\n\n// Receive results\nclient.onMessage((msg) =\u003e console.log(msg.payload));\n\n// Teardown when done\nawait client.teardown(deployment.id);\n\nclient.disconnect();\n```\n\n---\n\n## OpenAI-compatible inference endpoint\n\n`@axonsdk/inference` is a drop-in replacement for the OpenAI API that routes requests to the fastest available backend. Switch your existing OpenAI integration in two lines:\n\n```typescript\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n  baseURL: 'http://localhost:8000/v1', // your AxonSDK inference handler URL\n  apiKey:  process.env.AXON_SECRET_KEY,\n});\n\n// Everything else stays identical\nconst response = await client.chat.completions.create({\n  model:    'axon-llama-3-70b',\n  messages: [{ role: 'user', content: 'Explain edge AI in one paragraph.' }],\n});\n```\n\n### Available models\n\n| Model ID | Backend | Notes |\n|---|---|---|\n| `axon-llama-3-70b` | io.net | A100 GPU — best quality |\n| `axon-mistral-7b`  | io.net | GPU, most cost-efficient |\n| `axon-llama-3-8b`  | Akash  | Container compute, moderate cost |\n| `axon-tee-phi-3-mini` | Acurast | TEE node — private execution |\n\n### Setup (Next.js App Router)\n\n```bash\nnpm install @axonsdk/inference\n```\n\n```typescript\n// app/api/v1/chat/completions/route.ts\nimport { AxonInferenceHandler } from '@axonsdk/inference';\n\nconst handler = new AxonInferenceHandler({\n  apiKey:        process.env.AXON_SECRET_KEY!,\n  ionetEndpoint: process.env.IONET_ENDPOINT!,\n  akashEndpoint: process.env.AKASH_ENDPOINT,\n  acurastWsUrl:  process.env.ACURAST_WS_URL,\n  strategy:      'cost', // 'cost' | 'latency' | 'balanced'\n});\n\nexport const POST = (req: Request) =\u003e handler.handleRequest(req);\nexport const GET  = (req: Request) =\u003e handler.handleRequest(req); // GET /v1/models\n```\n\nThe handler implements streaming (SSE) and non-streaming, bearer auth, automatic failover with 30-second recovery, and an `X-AxonSDK-Provider` response header so you can see which backend served each request.\n\n---\n\n## Multi-provider Router\n\n`AxonRouter` routes requests across multiple providers simultaneously, picking the best one on every call based on real-time latency, cost, and availability.\n\n```typescript\nimport { AxonRouter } from '@axonsdk/sdk';\n\nconst router = new AxonRouter({\n  providers: ['ionet', 'akash', 'acurast'],\n  secretKey: process.env.AXON_SECRET_KEY,\n  strategy: 'latency',          // 'balanced' | 'latency' | 'availability' | 'cost' | 'round-robin'\n  processorStrategy: 'fastest', // 'round-robin' | 'fastest' | 'random' | 'first'\n  failureThreshold: 3,          // open circuit after 3 consecutive failures\n  recoveryTimeoutMs: 30_000,\n  maxRetries: 2,\n});\n\nawait router.connect();\nawait router.deploy({ runtime: 'nodejs', code: './dist/index.js', ... });\n\n// Automatically picks the highest-scoring provider\nawait router.send({ prompt: 'Hello' });\n\n// Health snapshot\nrouter.health().forEach((h) =\u003e {\n  console.log(h.provider, h.latencyMs, h.circuitState, h.score);\n});\n\nrouter.disconnect();\n```\n\n### Routing strategies\n\n| Strategy | Best for |\n|---|---|\n| `balanced` | General purpose — equal weight on availability, latency, cost |\n| `latency` | Interactive workloads — always picks the fastest provider |\n| `availability` | High uptime — prefers the most reliable provider |\n| `cost` | Batch jobs — routes to the cheapest option |\n| `round-robin` | Even load distribution |\n\n---\n\n## Mobile SDK (iOS \u0026 Android)\n\n`@axonsdk/mobile` is a React Native / Expo package for calling AI inference endpoints from iOS and Android apps — with automatic failover, circuit breakers, and secure key storage.\n\n```bash\nnpm install @axonsdk/mobile\n```\n\n```tsx\n// App.tsx\nimport { AxonProvider } from '@axonsdk/mobile';\n\nexport default function App() {\n  return (\n    \u003cAxonProvider provider=\"akash\" secretKey={AXON_SECRET_KEY} autoConnect\u003e\n      \u003cNavigationContainer\u003e\u003cMainStack /\u003e\u003c/NavigationContainer\u003e\n    \u003c/AxonProvider\u003e\n  );\n}\n\n// AnyScreen.tsx\nimport { useAxonContext, useMessages, useSend } from '@axonsdk/mobile';\n\nexport function InferenceScreen() {\n  const { client, connected } = useAxonContext();\n  const messages = useMessages(client);\n  const { send, sending } = useSend(client);\n\n  return (\n    \u003cView\u003e\n      \u003cText\u003e{connected ? '🟢 Live' : '⚪ Offline'}\u003c/Text\u003e\n      \u003cButton\n        title={sending ? 'Sending...' : 'Run inference'}\n        onPress={() =\u003e send(ENDPOINT_URL, { prompt: 'Hello from iOS!' })}\n      /\u003e\n      {messages.map((m, i) =\u003e \u003cText key={i}\u003e{JSON.stringify(m.payload)}\u003c/Text\u003e)}\n    \u003c/View\u003e\n  );\n}\n```\n\n```tsx\n// Multi-provider routing in mobile\nimport { useAxonRouter } from '@axonsdk/mobile';\n\nconst { router, connected, health } = useAxonRouter({\n  routes: [\n    { provider: 'akash',   endpoint: 'https://lease.akash.example.com', secretKey },\n    { provider: 'acurast', endpoint: 'wss://proxy.acurast.com',          secretKey },\n  ],\n  strategy: 'latency',\n  autoConnect: true,\n});\n```\n\n### Secure key storage\n\n```tsx\nimport { SecureKeyStorage } from '@axonsdk/mobile';\n\nconst storage = new SecureKeyStorage();\nawait storage.saveSecretKey(myKey); // iOS Keychain / Android Keystore\nconst key = await storage.loadSecretKey();\n```\n\n---\n\n## Security\n\n- **Secrets never leave `.env`** — the auth wizard generates keys locally and stores them with `chmod 600`. Never logged or transmitted.\n- **SSRF protection** — all HTTP calls validate URLs against a private-IP blocklist and enforce HTTPS.\n- **DNS rebinding defence** — resolves hostnames to IPs before opening connections, then re-validates the IP.\n- **Prototype pollution prevention** — remote JSON payloads are parsed with key blocklisting; environment maps use `Object.create(null)`.\n- **Response size caps** — all provider clients enforce a 1 MiB response cap; mock runtime enforces 4 MiB.\n- **Input validation** — `processorId` and deployment names validated for control characters and path traversal sequences.\n- **esbuild injection guard** — rejects any `environment` key that looks like a secret before bundle time.\n\n---\n\n## Project structure\n\n```\naxon/\n├── packages/\n│   ├── cli/          # @axonsdk/cli — command-line tool\n│   ├── inference/    # @axonsdk/inference — OpenAI-compatible inference handler\n│   ├── mobile/       # @axonsdk/mobile — React Native / Expo SDK\n│   └── sdk/          # @axonsdk/sdk — core library\n│       └── src/\n│           ├── providers/\n│           │   ├── ionet/      # io.net GPU provider\n│           │   ├── akash/      # Akash Network provider\n│           │   ├── acurast/    # Acurast TEE provider\n│           │   ├── fluence/    # Fluence serverless provider\n│           │   ├── koii/       # Koii task node provider\n│           │   ├── aws/        # AWS Lambda provider\n│           │   ├── gcp/        # Google Cloud Run provider\n│           │   ├── azure/      # Azure Container Instances provider\n│           │   ├── cloudflare/ # Cloudflare Workers provider\n│           │   └── flyio/      # Fly.io Machines provider\n│           └── runtime/\n│               └── adapters/ # Per-provider runtime bootstraps\n├── status/           # Provider health dashboard\n├── templates/\n│   ├── inference/    # LLM inference template\n│   └── oracle/       # Data oracle template\n└── examples/\n    └── nextjs-app/   # Next.js integration example\n```\n\n---\n\n## Development\n\n```bash\ngit clone https://github.com/deyzho/axonsdk-ts.git\ncd axonsdk-ts\nnpm install\nnpm run build\nnpm test\n```\n\n---\n\n## Contributing\n\nPull requests are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) to get started.\n\nHigh-impact areas:\n- Integration tests against live provider sandboxes\n- Additional cloud provider support\n- Template library\n\n---\n\n## Ecosystem\n\nThis repository contains the **TypeScript / Node.js** packages. If you're building with **Python**, see the companion repository:\n\n| Package | Description |\n|---|---|\n| [`axonsdk-py`](https://github.com/deyzho/axonsdk) | Python SDK — same providers, FastAPI inference server, cloud provider support |\n\n```bash\npip install axonsdk-py\n```\n\n**[axonsdk.dev](https://axonsdk.dev)** — full documentation for the Python SDK.\n\n---\n\n## License\n\nApache-2.0 — see [LICENSE](./LICENSE).\n\n---\n\n**[axonsdk.dev](https://axonsdk.dev)** · deyzho@me.com · Apache-2.0\n\n*AxonSDK is not affiliated with io.net, Akash Network, Acurast, Fluence, or Koii. Provider names and trademarks belong to their respective owners.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeyzho%2Faxonsdk-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeyzho%2Faxonsdk-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeyzho%2Faxonsdk-ts/lists"}