@zerro_ai/sdk
v0.1.3
Published
Zerro AI Infrastructure SDK — Swarm, Free API Hub, Local LLM, Routing, Cost, Gateway
Maintainers
Readme
@zerro_ai/sdk — Zerro AI Infrastructure
Zerro AI = 무료 API와 로컬 LLM을 위한 AI Operating System.
Phase 3 developer surface: API Hub · Swarm · Local LLM · Routing · Cost Optimization · AI Gateway.
import { zerro, createZerro } from "@zerro_ai/sdk";
const client = createZerro({
apiKeys: { groq: process.env.GROQ_API_KEY! },
swarm: { mode: "auto" }, // Auto failover · set mode: "max" for #1 only
gatewayUrl: process.env.ZERRO_GATEWAY_URL, // optional AI Gateway
});
await client.chat({
messages: [{ role: "user", content: "hi" }],
});
await client.agent({ name: "ops" }).generate("List free LLM providers");
await client.workflow({ goal: "Research AI news and draft a briefing" });Install
npmjs (preferred):
npm install @zerro_ai/sdkRequires one-time setup: npm org @zerro_ai + GitHub secret NPM_TOKEN, then tag sdk-v* (or Actions → Publish @zerro_ai/sdk).
Token (required for CI publish):
- https://www.npmjs.com/settings/~/tokens → Granular Access Token
- Packages: Read and write
- Bypass two-factor authentication 체크 (필수 — 없으면 E403)
- Organization:
zerro_ai
- 또는 Classic → Automation 토큰 (2FA bypass 내장)
- GitHub → Settings → Secrets → Actions →
NPM_TOKEN업데이트
From GitHub Release (private repo — use a PAT):
npm install https://github.com/Benjamin5607/zero_ai/releases/download/sdk-v0.1.3/zerro-sdk-0.1.3.tgzSurface
| API | Maps to |
|-----|---------|
| zerro.chat() | Swarm Engine routing + failover |
| zerro.agent() | Named agent generate/chat |
| zerro.workflow() | Plan → execute (LLM or gateway tools) |
| zerro.swarm.configure() | Auto / MAX + model mix |
| zerro.providers.free() | Free API Hub (13+) |
| zerro.cost.inferCostTier() | Cost optimization hints |
| createLegalClient() | KR_AI_Legal ZeroAI plugin (Legal Research) |
import { createLegalClient } from "@zerro_ai/sdk";
const legal = createLegalClient(); // default https://kr-ai-legal.onrender.com
await legal.getPlugin();
await legal.workspaceLegal({ question: "…", rounds: 2, lang: "ko" });Build / publish
npm run sdk:build
# Tag: sdk-v0.1.3 → Actions publish-sdk.yml → npmjsKeys
createZerro({ apiKeys: { groq: "…" } })- Or env:
GROQ_API_KEY/ZERRO_KEYS_JSON - Or
gatewayUrl→ app/api/proxy+/api/tools/execute
