1. Local Network Server (OpenAI-Compatible LAN API)
Enable Local Network Server inside Pandux AI to bind an HTTP server on your local Wi-Fi interface (default port 8080). Standard OpenAI endpoints are exposed:
GET /v1/models— Lists the currently loaded GGUF model.POST /v1/chat/completions— Chat completions (supportsstream: true).POST /v1/completions— Raw text completions.
curl http://192.168.1.42:8080/v1/chat/completions \
-H "Authorization: Bearer YOUR_LOCAL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "local-gguf",
"messages": [{"role": "user", "content": "Explain zero-custody AI in 2 sentences."}],
"stream": false
}'2. Pocket Inference Node (Cloud API Bridge — WSS)
When your client is outside your home Wi-Fi, enable Pocket Inference Node. Your phone opens an outbound encrypted WSS connection to the Pandux Relay using a scoped node key (pdx_node_...). Prompts and tokens pass end-to-end without being logged on relay servers.
- Base URL:
https://api.pandux.ai/v1 - Auth Header:
Authorization: Bearer pdx_node_... - Compatible with Cursor, Continue.dev, LangChain, and OpenAI SDKs.
3. Hardware Guardrail Error Codes
To protect your phone's battery and thermal envelope, Pandux AI enforces automatic hardware guardrails and returns standard HTTP status codes:
| HTTP Status | Condition | Recommended Client Action |
|---|---|---|
401 Unauthorized | Missing or invalid Bearer / pdx_node_ key | Verify token in Pandux AI Server settings |
408 Request Timeout | Inference exceeded mobile timeout window | Reduce max_tokens or prompt length |
429 Too Many Requests | Concurrent request limit reached (mobile GPU/CPU busy) | Retry with exponential backoff |
503 Service Unavailable | Thermal throttling, low battery, or node offline | Wait for device cooldown or reconnect node |
4. Self-Hosted Relay Quickstarts (Node.js & Python)
Point any official OpenAI SDK at your LAN IP or Pocket Node URL:
Node.js (OpenAI SDK)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "http://192.168.1.42:8080/v1",
apiKey: process.env.PANDUX_TOKEN,
});
const res = await client.chat.completions.create({
model: "local-gguf",
messages: [{ role: "user", content: "Hello from Node.js!" }],
});
console.log(res.choices[0].message.content);Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="http://192.168.1.42:8080/v1",
api_key="YOUR_LOCAL_TOKEN",
)
resp = client.chat.completions.create(
model="local-gguf",
messages=[{"role": "user", "content": "Hello from Python!"}],
)
print(resp.choices[0].message.content)5. Security, Prompt Hygiene & Real Mobile Capacity
- Keep Tokens Private: Never commit
pdx_node_...keys to public repositories. Rotate keys immediately in-app if exposed. - Context Window & RAM: Mobile devices typically perform best with 4-bit quantized 1.5B–7B GGUF models and context windows of
2048–4096tokens. - Privacy & Safety: All local server traffic is governed by the Pandux AI Privacy Policy and Terms of Service.