@denispro2006/duke-ai-kernel
v1.0.0
Published
AI kernel for the duke-messenger platform — handles LLM routing, context management, and real-time messaging via WebSocket.
Downloads
127
Readme
duke-ai-kernel
AI kernel for the duke-messenger platform. Handles LLM routing, context management, and real-time messaging via WebSocket.
Quick Start
# 1. Clone and install
git clone https://github.com/duke-messenger/duke-ai-kernel
cd duke-ai-kernel
npm install
# 2. Configure environment
cp .env.example .env
# Edit .env with your API keys
# 3. Start the kernel
npm run devThe kernel starts on http://localhost:3000 by default.
Features
- Unified LLM routing — route requests to OpenAI, Anthropic, or local Ollama models
- Context management — per-conversation history with configurable token-budget trimming
- Real-time streaming — stream responses to clients over WebSocket
- Plugin pipeline — extend with custom pre/post processors
- Worker concurrency — bounded async workers prevent rate-limit saturation
Stack
| Layer | Technology | |-------|-----------| | Runtime | Node.js 20+ | | Framework | Express 5 | | WebSocket | ws | | Language | TypeScript | | Testing | Vitest |
Scripts
npm run dev # Start with hot reload
npm run build # Compile TypeScript
npm start # Run compiled output
npm run lint # Check code style
npm run typecheck # Type-check without building
npm test # Run all tests
npm run test:coverage # Run tests with coverage reportEnvironment Variables
Copy .env.example to .env. At minimum you need:
OPENAI_API_KEY=sk-...
AUTH_SECRET=your-secret-hereSee Environment Variables for the full reference.
Docker
# Start kernel + Redis
docker compose up -d
# Verify
curl http://localhost:3000/api/v1/healthzDocumentation
License
MIT © duke-messenger contributors
