ai
AI Plugin
Section titled “AI Plugin”Multi-provider AI inference service with prompt marketplace and consensus mode. Pro plugin.
Requires: Basic license tier or higher.
nself license set nself_pro_...
Install
Section titled “Install”nself license set nself_pro_xxxxx...nself plugin install aiWhat It Does
Section titled “What It Does”Runs a unified AI inference service supporting 7 providers: OpenAI, Anthropic, Gemini, Groq, Mistral, Ollama, and custom endpoints. Implements a 3-layer request pipeline (pre-processing → inference → post-processing), prompt marketplace for sharing and reusing prompts, consensus mode for multi-model agreement, and shadow testing to compare providers without affecting production. Required by the claw, mux, and voice plugins.
Configuration
Section titled “Configuration”| Env Var | Default | Description |
|---|---|---|
AI_PORT | 3709 | AI service port |
AI_DEFAULT_PROVIDER | openai | Default inference provider |
OPENAI_API_KEY | none | OpenAI API key |
ANTHROPIC_API_KEY | none | Anthropic API key |
GEMINI_API_KEY | none | Google Gemini API key |
GROQ_API_KEY | none | Groq API key |
MISTRAL_API_KEY | none | Mistral API key |
OLLAMA_HOST | none | Ollama server URL (for local models) |
AI_CONSENSUS_THRESHOLD | 0.7 | Agreement threshold for consensus mode |
| Port | Purpose |
|---|---|
| 3709 | AI inference REST API |
Database Tables
Section titled “Database Tables”6 tables added to your Postgres database:
np_ai_providers: provider configurations and statusnp_ai_prompts: prompt marketplace entriesnp_ai_requests: inference request lognp_ai_responses: response cache and audit lognp_ai_pipeline_configs: 3-layer pipeline configurationsnp_ai_shadow_tests: shadow testing results
Nginx Routes
Section titled “Nginx Routes”| Route | Target |
|---|---|
/ai/ | AI inference API |
GET /health: Health checkPOST /chat: Chat completion (OpenAI-compatible)POST /complete: Text completionPOST /embed: EmbeddingsGET /providers: List available providersGET /models: List available modelsPOST /prompts: Save to prompt marketplaceGET /prompts: Browse marketplaceUsed By
Section titled “Used By”claw: AI agent reasoningmux: Email/message classificationvoice: Speech transcription and synthesis