{"_id":"@abhieren/blindference-agent","_rev":"2-5bb95e059ab47c6c1c8ec2813ea44f46","name":"@abhieren/blindference-agent","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@abhieren/blindference-agent","version":"0.1.0","license":"MIT","_id":"@abhieren/blindference-agent@0.1.0","maintainers":[{"name":"abhieren","email":"panwarabhishek629@gmail.com"}],"homepage":"https://github.com/AbhishekPanwarr/Blindference-Agent#readme","bugs":{"url":"https://github.com/AbhishekPanwarr/Blindference-Agent/issues"},"bin":{"blindference-agent":"dist/cli.js"},"dist":{"shasum":"648eb0397a5334ef87ef3868951d5e4723d561f2","tarball":"https://registry.npmjs.org/@abhieren/blindference-agent/-/blindference-agent-0.1.0.tgz","fileCount":19,"integrity":"sha512-R/t3TAZZWbolxGmngJsKmz46OhrXCCiZ+cCnHNAwpfz+h1xyoEr/o2en40I2mJTQOsYwXDh4M1l5squ3S8gvPA==","signatures":[{"sig":"MEUCIQCJt2JM2vxOI4GtQDba1gfzDx+JoWArVNQfTSMeJGOdTAIgVb4i+HOZOg1taC+jhmF98k30o1600iCDwmM5Omf736k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":93869},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"91c7a0477b75e21682225f37bd2500010268efe1","scripts":{"dev":"tsc --watch","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"abhieren","email":"panwarabhishek629@gmail.com"},"repository":{"url":"git+https://github.com/AbhishekPanwarr/Blindference-Agent.git","type":"git"},"_npmVersion":"10.9.8","description":"Blindference Agent SDK for confidential AI inference — TypeScript/Node.js edition","directories":{},"_nodeVersion":"22.22.3","dependencies":{"cors":"^2.8.5","viem":"^2.48.1","axios":"^1.7.0","dotenv":"^16.4.5","express":"^4.21.0","commander":"^12.1.0","form-data":"^4.0.0","@cofhe/sdk":"^0.5.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.0","@types/cors":"^2.8.17","@types/node":"^22.0.0","@types/express":"^4.17.21"},"_npmOperationalInternal":{"tmp":"tmp/blindference-agent_0.1.0_1780077996483_0.9653920992582603","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@abhieren/blindference-agent","version":"0.1.1","description":"Blindference Agent SDK for confidential AI inference — TypeScript/Node.js edition","main":"dist/index.js","types":"dist/index.d.ts","bin":{"blindference-agent":"dist/cli.js"},"scripts":{"build":"tsc","dev":"tsc --watch","prepublishOnly":"npm run build"},"dependencies":{"@cofhe/sdk":"^0.5.2","axios":"^1.7.0","commander":"^12.1.0","cors":"^2.8.5","dotenv":"^16.4.5","express":"^4.21.0","form-data":"^4.0.0","viem":"^2.48.1"},"devDependencies":{"@types/cors":"^2.8.17","@types/express":"^4.17.21","@types/node":"^22.0.0","typescript":"^5.8.0"},"engines":{"node":">=18.0.0"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/AbhishekPanwarr/Blindference-Agent.git"},"_id":"@abhieren/blindference-agent@0.1.1","gitHead":"4f0c4987461729b2fc1a015d51e291865260e365","bugs":{"url":"https://github.com/AbhishekPanwarr/Blindference-Agent/issues"},"homepage":"https://github.com/AbhishekPanwarr/Blindference-Agent#readme","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-zMWgNEC6YQAgrslpyp5Woo6AbFpFcppKLctjRbg+kGdxHyOZVhPVulUCHgDPUCU+44601dHz1OrQqqQzTfO3BQ==","shasum":"f4fb1416a817effde8bbc4e517e4bca22a415b40","tarball":"https://registry.npmjs.org/@abhieren/blindference-agent/-/blindference-agent-0.1.1.tgz","fileCount":19,"unpackedSize":97958,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEPkcoZrQFToy6fI2ThOVH1sWRptiHNIxco9iCZPol6nAiA6ayye8XGpCK/PDrC+fgNX0dNVeBzMns8GBTN+Vw0LfQ=="}]},"_npmUser":{"name":"abhieren","email":"panwarabhishek629@gmail.com"},"directories":{},"maintainers":[{"name":"abhieren","email":"panwarabhishek629@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/blindference-agent_0.1.1_1780240637080_0.40177717981553984"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-29T18:06:36.287Z","modified":"2026-05-31T15:17:17.682Z","0.1.0":"2026-05-29T18:06:36.636Z","0.1.1":"2026-05-31T15:17:17.251Z"},"bugs":{"url":"https://github.com/AbhishekPanwarr/Blindference-Agent/issues"},"license":"MIT","homepage":"https://github.com/AbhishekPanwarr/Blindference-Agent#readme","repository":{"type":"git","url":"git+https://github.com/AbhishekPanwarr/Blindference-Agent.git"},"description":"Blindference Agent SDK for confidential AI inference — TypeScript/Node.js edition","maintainers":[{"name":"abhieren","email":"panwarabhishek629@gmail.com"}],"readme":"# ⚠️ TESTNET ONLY — DO NOT USE REAL FUNDS\n\n> **This software runs on Arbitrum Sepolia testnet.**\n> Use a dedicated test wallet with no mainnet assets. Never use private keys that hold real funds.\n> The staking, rewards, and inference mechanics are real on testnet but have no mainnet value.\n\n---\n\n# @abhieren/blindference-agent\n\n[![Node.js 18+](https://img.shields.io/badge/node.js-18+-green.svg)](https://nodejs.org/)\n[![npm](https://img.shields.io/badge/npm-%40abhieren%2Fblindference--agent-red.svg)](https://www.npmjs.com/package/@abhieren/blindference-agent)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**Confidential AI inference SDK for Node.js — submit encrypted prompts to a decentralized quorum of verified nodes.**\n\n> 🆕 **First time here?** Read [WHY.md](WHY.md) to understand *why* this package exists, what problems it solves, and how it compares to OpenAI API vs local LLMs.\n>\n> **TL;DR:** Your prompt is encrypted with AES-256-GCM before leaving your machine, split into FHE-encrypted key halves, sent to 3 independent verified nodes that must cryptographically agree on the exact same output, and only then is the result decrypted locally. No plaintext ever touches a server.\n\nBlindference Agent enables developers to build agents that send prompts through end-to-end encryption (AES-256-GCM + Fhenix CoFHE), execute across a leader-verifier quorum for integrity, and receive decrypted results locally. No plaintext leaves your machine.\n\n🔗 **Live Services:**\n- ICL API: [icl.blindference.xyz](https://icl.blindference.xyz)\n- Payment Service: [payment.blindference.xyz](https://payment.blindference.xyz)\n- Dashboard: [www.blindference.xyz](https://www.blindference.xyz)\n\n---\n\n## Table of Contents\n\n1. [What It Does](#what-it-does)\n2. [Architecture](#architecture)\n3. [Prerequisites](#prerequisites)\n4. [Installation](#installation)\n5. [🚀 5-Minute Quickstart](#-5-minute-quickstart)\n6. [CLI Reference](#cli-reference)\n7. [SDK API](#sdk-api)\n8. [REST Server](#rest-server)\n9. [Configuration](#configuration)\n10. [Python Interop](#python-interop)\n11. [Troubleshooting](#troubleshooting)\n12. [Links](#links)\n\n---\n\n## What It Does\n\nThe Agent SDK provides a complete end-to-end confidential inference pipeline:\n\n- **Encrypts** your prompt with AES-256-GCM before it leaves your machine\n- **Splits** the encryption key into FHE-encrypted halves via Fhenix CoFHE\n- **Submits** the encrypted job to the Payment Service with on-chain key storage\n- **Dispatches** to a quorum of 3 verified nodes (1 Leader + 2 Verifiers)\n- **Verifies** all nodes cryptographically agree on the same output hash\n- **Decrypts** the result locally using CoFHE threshold decryption\n- **Returns** plaintext answer only after quorum consensus is reached\n\n**Key Features:**\n- CLI for quick inference: `blindference-agent infer --prompt \"Hello\"`\n- SDK class for programmatic use: `new BlindferenceAgent(config)`\n- REST server for language-agnostic integration\n- Multi-gateway IPFS fallback for reliable content retrieval\n- Auto-polling for job completion with configurable timeouts\n\n---\n\n## Architecture\n\n![Blindference Agent SDK Architecture](docs/assets/architecture.png)\n\n**View interactive versions:**\n- [Mermaid (GitHub native)](docs/assets/architecture.mermaid.md)\n- [Excalidraw (importable)](docs/assets/architecture.excalidraw) — open at [excalidraw.com](https://excalidraw.com)\n- [ASCII fallback](docs/assets/architecture-ascii.md)\n\n**11-Step Data Flow:**\n\n1. **User** submits prompt via Agent SDK CLI\n2. **Agent** AES-encrypts prompt, CoFHE-encrypts key halves\n3. **Agent** submits job to Payment Service\n4. **Payment Service** creates job, ICL selects quorum (1 Leader + 2 Verifiers)\n5. **ICL** dispatches to verified nodes\n6. **Nodes** decrypt prompt, run inference (Groq/Gemini/vLLM), upload result to IPFS\n7. **Nodes** commit result hash on-chain\n8. **ICL** verifies quorum consensus (2+ confirms = accepted)\n9. **Payment Service** marks job COMPLETED\n10. **Agent** polls status, decrypts output key via CoFHE\n11. **Agent** AES-decrypts final result, returns plaintext to user\n\n**API Endpoints Used:**\n- `POST /v1/jobs/submit` — Submit encrypted inference job\n- `GET /v1/jobs/{jobId}` — Poll job status\n- `GET /v1/balance/{address}` — Check credit balance\n- `POST /v1/credits/purchase-package` — Buy credit package\n- `GET /v1/inference/quorum-preview` — Preview quorum\n- `POST /v1/inference/upload-prompt` — Upload encrypted prompt\n\n---\n\n## Prerequisites\n\n- **Node.js 18+** — check with `node --version`\n- **npm 9+** — check with `npm --version`\n- A **MetaMask wallet** with Arbitrum Sepolia testnet\n- **Testnet ETH** on Arbitrum Sepolia (for gas)\n- **Testnet BLIND tokens** — get from the [Blindference Faucet](https://blindference.xyz/faucet)\n- **cUSDC credits** — purchase with BLIND via CLI\n\n### Quick Check\n\n```bash\nnode --version   # >= 18.0.0\nnpm --version    # >= 9.0.0\n```\n\n---\n\n## Installation\n\n### Global Install (Recommended)\n\n```bash\nnpm install -g @abhieren/blindference-agent\n```\n\nThis installs the `blindference-agent` CLI globally.\n\n### Per-Project Install\n\n```bash\nnpm install @abhieren/blindference-agent\n```\n\nImport in your code:\n\n```typescript\nimport { BlindferenceAgent } from '@abhieren/blindference-agent'\n```\n\n---\n\n## 🚀 5-Minute Quickstart\n\n### 1. Set Up Environment\n\nCreate `.env` in your working directory:\n\n```bash\ncat > .env << 'EOF'\nBLF_PRIVATE_KEY=0xYOUR_PRIVATE_KEY\nBLF_PAYMENT_URL=https://payment.blindference.xyz\nBLF_ICL_URL=https://icl.blindference.xyz\nBLF_RPC_URL=https://arb-sepolia.g.alchemy.com/v2/YOUR_KEY\nBLF_COFHE_URL=https://arb-sepolia.g.alchemy.com/v2/YOUR_KEY\nEOF\n```\n\n> ⚠️ **Get a free Alchemy key at [dashboard.alchemy.com](https://dashboard.alchemy.com/apps)**\n> The default URLs won't work without a real RPC endpoint.\n\n### 2. Check Your Balance\n\n```bash\nblindference-agent balance\n```\n\n### 3. Buy Credits (if needed)\n\n```bash\nblindference-agent buy-package --id starter\n```\n\nPackages:\n- `starter` — 10 calls\n- `pro` — 100 calls\n- `enterprise` — 1000 calls\n\n### 4. Run Inference\n\n```bash\nblindference-agent infer --prompt \"What is the capital of France?\"\n```\n\n**Expected output:**\n```\nInitializing CoFHE...\nEncrypting prompt...\nSubmitting to Payment Service...\nJob submitted: abc-123\nPolling for completion (this may take 1-3 minutes)...\nJob COMPLETED\n\nResult:\nParis\n```\n\n### 5. Start REST Server (Optional)\n\n```bash\nblindference-agent start --port 3000\n```\n\nNow you can call the API from any language:\n\n```bash\ncurl -X POST http://localhost:3000/infer \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"What is 2+2?\"}'\n```\n\n---\n\n## CLI Reference\n\n### `blindference-agent infer`\n\nRun a single confidential inference job.\n\n```bash\nblindference-agent infer --prompt \"Your prompt here\" [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--prompt` | The prompt to send (required) | — |\n| `--model` | Model ID to use | `groq:llama-3.3-70b-versatile` |\n| `--currency` | Payment currency (`BLIND` or `cUSDC`) | `BLIND` |\n| `--insurance` | Enable insurance for this job | `false` |\n| `--payment-service` | Payment Service URL | `https://payment.blindference.xyz` |\n| `--icl` | ICL URL | `https://icl.blindference.xyz` |\n| `--rpc-url` | Arbitrum Sepolia RPC URL | from `BLF_RPC_URL` env |\n| `--ipfs-gateway` | IPFS download gateway | `https://ipfs.io/ipfs` |\n\n**Example:**\n\n```bash\nblindference-agent infer \\\n  --prompt \"Explain quantum computing in simple terms\" \\\n  --model groq:llama-3.3-70b-versatile \\\n  --currency BLIND\n```\n\n### `blindference-agent balance`\n\nCheck your credit balances.\n\n```bash\nblindference-agent balance [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--payment-service` | Payment Service URL | `https://payment.blindference.xyz` |\n\n**Example output:**\n\n```\nBLIND Balance: 1000.0000\ncUSDC Balance: 50.0000\nCredit Packages: starter (10 calls), pro (100 calls)\n```\n\n### `blindference-agent buy-package`\n\nPurchase a credit package.\n\n```bash\nblindference-agent buy-package --id <package-id> [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--id` | Package ID: `starter`, `pro`, `enterprise` (required) | — |\n| `--payment-service` | Payment Service URL | `https://payment.blindference.xyz` |\n| `--rpc-url` | Arbitrum Sepolia RPC URL | from `BLF_RPC_URL` env |\n\n**Example:**\n\n```bash\nblindference-agent buy-package --id starter\n```\n\n### `blindference-agent start`\n\nStart the local REST server.\n\n```bash\nblindference-agent start [options]\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--port` | Server port | `3000` |\n| `--payment-service` | Payment Service URL | `https://payment.blindference.xyz` |\n| `--icl` | ICL URL | `https://icl.blindference.xyz` |\n| `--rpc-url` | Arbitrum Sepolia RPC URL | from `BLF_RPC_URL` env |\n| `--ipfs-gateway` | IPFS download gateway | `https://ipfs.io/ipfs` |\n\n**Endpoints:**\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `/health` | Server health check |\n| `GET` | `/balance` | Get credit balance |\n| `POST` | `/infer` | Submit inference job |\n\n**Example:**\n\n```bash\nblindference-agent start --port 3000\n```\n\n---\n\n## SDK API\n\n### `BlindferenceAgent`\n\nThe main SDK class for programmatic use.\n\n#### Constructor\n\n```typescript\nimport { BlindferenceAgent } from '@abhieren/blindference-agent'\n\nconst agent = new BlindferenceAgent({\n  privateKey: '0xYOUR_PRIVATE_KEY',\n  paymentServiceUrl: 'https://payment.blindference.xyz',\n  rpcUrl: 'https://arb-sepolia.g.alchemy.com/v2/YOUR_KEY',\n  // Optional:\n  iclUrl: 'https://icl.blindference.xyz',\n  ipfsGateway: 'https://ipfs.io/ipfs',\n  chainId: 421614,\n  promptKeyStoreAddress: '0x...',\n  cofheConfig: { /* CoFHE SDK config */ }\n})\n```\n\n#### Methods\n\n| Method | Description | Returns |\n|--------|-------------|---------|\n| `initCofhe()` | Initialize CoFHE client | `Promise<void>` |\n| `infer(options)` | Run inference job | `Promise<InferenceResult>` |\n| `getBalance(address?)` | Get credit balance | `Promise<CreditBalance>` |\n| `getPackages()` | List available packages | `Promise<CreditPackage[]>` |\n| `purchasePackage(packageId)` | Buy credit package | `Promise<PurchaseResult>` |\n\n#### `infer()` Options\n\n```typescript\ninterface InferOptions {\n  prompt: string                    // The prompt to send (required)\n  modelId?: string                 // Model ID (default: groq:llama-3.3-70b-versatile)\n  currency?: 'BLIND' | 'cUSDC'      // Payment currency (default: BLIND)\n  insurance?: boolean               // Enable insurance (default: false)\n}\n```\n\n#### `infer()` Result\n\n```typescript\ninterface InferenceResult {\n  jobId: string\n  taskId: string\n  status: 'COMPLETED' | 'FAILED' | 'REJECTED'\n  output?: string                   // Decrypted plaintext (only if COMPLETED)\n  outputCid?: string                // IPFS CID of encrypted output\n  commitmentHash?: string          // On-chain commitment hash\n}\n```\n\n#### Full Example\n\n```typescript\nimport { BlindferenceAgent } from '@abhieren/blindference-agent'\n\nasync function main() {\n  const agent = new BlindferenceAgent({\n    privateKey: process.env.BLF_PRIVATE_KEY!,\n    paymentServiceUrl: 'https://payment.blindference.xyz',\n    rpcUrl: process.env.BLF_RPC_URL!\n  })\n\n  await agent.initCofhe()\n\n  const result = await agent.infer({\n    prompt: 'What is the capital of France?',\n    modelId: 'groq:llama-3.3-70b-versatile',\n    currency: 'BLIND'\n  })\n\n  if (result.status === 'COMPLETED') {\n    console.log('Answer:', result.output)\n  } else {\n    console.error('Job failed:', result.status)\n  }\n}\n\nmain().catch(console.error)\n```\n\n---\n\n## REST Server\n\nThe REST server wraps the SDK for language-agnostic integration.\n\n### Start the Server\n\n```bash\nblindference-agent start --port 3000\n```\n\n### Endpoints\n\n#### `GET /health`\n\nHealth check.\n\n**Response:**\n```json\n{ \"status\": \"ok\" }\n```\n\n#### `GET /balance`\n\nGet credit balance.\n\n**Response:**\n```json\n{\n  \"blind\": \"1000.0000\",\n  \"cusdc\": \"50.0000\",\n  \"packages\": [\"starter\", \"pro\"]\n}\n```\n\n#### `POST /infer`\n\nSubmit an inference job.\n\n**Request:**\n```json\n{\n  \"prompt\": \"What is the capital of France?\",\n  \"modelId\": \"groq:llama-3.3-70b-versatile\",\n  \"currency\": \"BLIND\",\n  \"insurance\": false\n}\n```\n\n**Response:**\n```json\n{\n  \"jobId\": \"abc-123\",\n  \"taskId\": \"task-456\",\n  \"status\": \"PENDING\"\n}\n```\n\n#### `GET /status/:jobId`\n\nCheck job status.\n\n**Response:**\n```json\n{\n  \"jobId\": \"abc-123\",\n  \"status\": \"COMPLETED\",\n  \"output\": \"Paris\",\n  \"outputCid\": \"Qm...\",\n  \"commitmentHash\": \"0x...\"\n}\n```\n\n### Python Client Example\n\n```python\nimport requests\n\n# Start server first: blindference-agent start --port 3000\n\nresponse = requests.post('http://localhost:3000/infer', json={\n    'prompt': 'What is 2+2?'\n})\nresult = response.json()\nprint(result['output'])  # \"4\"\n```\n\n---\n\n## Configuration\n\nAll configuration via environment variables prefixed with `BLF_`:\n\n| Variable | Required | Description | Example |\n|----------|----------|-------------|---------|\n| `BLF_PRIVATE_KEY` | ✅ | Your wallet private key (hex) | `0xabc123...` |\n| `BLF_PAYMENT_URL` | ✅ | Payment Service URL | `https://payment.blindference.xyz` |\n| `BLF_ICL_URL` | ✅ | ICL API URL | `https://icl.blindference.xyz` |\n| `BLF_RPC_URL` | ✅ | Arbitrum Sepolia RPC | `https://arb-sepolia.g.alchemy.com/v2/KEY` |\n| `BLF_COFHE_URL` | | CoFHE RPC URL (defaults to BLF_RPC_URL) | Same as above |\n| `BLF_CHAIN_ID` | | Chain ID | `421614` |\n| `BLF_IPFS_GATEWAY` | | IPFS download gateway | `https://ipfs.io/ipfs` |\n| `BLF_PINATA_JWT` | | Pinata JWT for IPFS uploads | `eyJ...` |\n| `BLF_PROMPT_KEY_STORE` | | PromptKeyStore contract address | `0x...` |\n| `BLF_LOG_LEVEL` | | Logging level | `info` |\n| `BLF_MAX_POLL_ATTEMPTS` | | Max polling attempts | `120` |\n| `BLF_POLL_INTERVAL_MS` | | Polling interval | `3000` |\n| `BLF_GAS_MULTIPLIER` | | Gas price multiplier | `1.2` |\n| `BLF_CORS_ORIGINS` | | CORS origins (for REST server) | `*` |\n\nCreate `.env` file:\n\n```bash\ncat > .env << 'EOF'\nBLF_PRIVATE_KEY=0xYOUR_PRIVATE_KEY\nBLF_PAYMENT_URL=https://payment.blindference.xyz\nBLF_ICL_URL=https://icl.blindference.xyz\nBLF_RPC_URL=https://arb-sepolia.g.alchemy.com/v2/YOUR_KEY\nBLF_COFHE_URL=https://arb-sepolia.g.alchemy.com/v2/YOUR_KEY\nBLF_IPFS_GATEWAY=https://ipfs.io/ipfs\nBLF_LOG_LEVEL=info\nEOF\n```\n\n---\n\n## Python Interop\n\n### Subprocess\n\n```python\nimport subprocess\nimport json\n\nresult = subprocess.run(\n    ['blindference-agent', 'infer', '--prompt', 'What is 2+2?', '--json'],\n    capture_output=True, text=True\n)\noutput = json.loads(result.stdout)\nprint(output['output'])  # \"4\"\n```\n\n### HTTP Client\n\n```python\nimport requests\n\n# Start server: blindference-agent start --port 3000\n\nclass BlindferenceClient:\n    def __init__(self, base_url='http://localhost:3000'):\n        self.base_url = base_url\n    \n    def infer(self, prompt, model_id='groq:llama-3.3-70b-versatile'):\n        response = requests.post(f'{self.base_url}/infer', json={\n            'prompt': prompt,\n            'modelId': model_id\n        })\n        return response.json()\n\nclient = BlindferenceClient()\nresult = client.infer('What is the capital of France?')\nprint(result['output'])  # \"Paris\"\n```\n\n---\n\n## Troubleshooting\n\n### \"Private key is required\"\n\nCreate `.env` in your current directory:\n\n```bash\ncat > .env << 'EOF'\nBLF_PRIVATE_KEY=0xYOUR_KEY\nBLF_PAYMENT_URL=https://payment.blindference.xyz\nEOF\n```\n\n### \"Payment Service URL is required\"\n\nSet the Payment Service URL:\n\n```bash\nexport BLF_PAYMENT_URL=https://payment.blindference.xyz\n```\n\n### \"Insufficient credits\"\n\n1. Get BLIND from [faucet](https://blindference.xyz/faucet)\n2. Purchase credits:\n\n```bash\nblindference-agent buy-package --id starter\n```\n\n### CoFHE initialization hangs\n\nZK proof generation takes 10-30 seconds. Do not interrupt.\n\nIf it hangs indefinitely:\n- Check your RPC URL is valid (not the default placeholder)\n- Ensure you have testnet ETH for gas\n- Try with debug logging: `BLF_LOG_LEVEL=debug blindference-agent infer --prompt \"test\"`\n\n### \"Polling timed out\"\n\nThe job may still be processing. Check the Payment Service dashboard:\n\n```bash\ncurl https://payment.blindference.xyz/v1/jobs/YOUR_JOB_ID\n```\n\nOr check if quorum nodes are active:\n\n```bash\ncurl https://icl.blindference.xyz/health\n```\n\n### \"IPFS download failed\"\n\nThe multi-gateway fallback tries: `ipfs.io` → `pinata.cloud` → `dweb.link`\n\nIf all fail:\n- Wait 30-60 seconds for IPFS propagation\n- Check your `BLF_IPFS_GATEWAY` env var\n- Verify the job actually completed (not FAILED)\n\n### \"Invalid CoFHE RPC URL\"\n\nYou must set a real Alchemy/Infura URL. The default is a placeholder:\n\n```bash\nexport BLF_RPC_URL='https://arb-sepolia.g.alchemy.com/v2/YOUR_REAL_KEY'\nexport BLF_COFHE_URL='https://arb-sepolia.g.alchemy.com/v2/YOUR_REAL_KEY'\n```\n\n### Debug Mode\n\n```bash\nBLF_LOG_LEVEL=debug blindference-agent infer --prompt \"test\"\n```\n\n---\n\n## Links\n\n- [NPM Package](https://www.npmjs.com/package/@abhieren/blindference-agent)\n- [GitHub Repository](https://github.com/AbhishekPanwarr/Blindference-Agent)\n- [Blindference Network](https://blindference.xyz)\n- [Documentation](https://docs.blindference.xyz)\n- [Blindference Node](https://github.com/AbhishekPanwarr/Blindference-node) — Run a compute node\n- [Payment Service](https://payment.blindference.xyz)\n- [ICL API](https://icl.blindference.xyz)\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","readmeFilename":"README.md"}