Experimental Multi-Platform LLM Harness

One unified AI engine. Discord, Web, and everywhere your tools run.

Connect any OpenAI-compatible model to Discord guilds and web consoles with real-time SSE tokens, dynamic system presets, and hardened JavaScript sandboxes.

$ git clone https://github.com/df-001/nocturne-engine

[14:50:01] <BOOT> Nocturne Engine v0.3.1 starting on Node v24.0.0
[14:50:02] <API> API running on port 3000
[14:50:02] <TOOLS> Registered 9 tools
[14:50:03] <DISCORD> Active account: Nocturne
[14:50:19] <WEB REQ> Write a JavaScript function to calculate the Fibonacci sequence
> Ctrl+C to cancel...
# Service Toggles
DISCORD_BOT_ENABLED=true
WEB_API_ENABLED=true

# OpenAI-Compatible LLM Endpoint
LLM_URL=http://127.0.0.1:1234/v1/chat/completions
LLM_MODEL=
LLM_VISION=true
ENABLE_TOOLS=true
MAX_TOOL_TURNS=10

# Discord Gateway
DISCORD_TOKEN=
STATUS="online"
STREAMING_INTERVAL=1000 # ms

# Web API & Storage
API_PORT=3000
SQLITE_DB_NAME=web.db
[
  {
    "id": 0,
    "name": "nt-preview",
    "description": "Model description here",
    "systemPrompt": {
      "web": "web-prompt",
      "guild": "guild-prompt",
      "dm": "dm-prompt"
    },
    "temperature": 1.0,
    "model": null,
    "maxTokens": 4000,
    "toolsEnabled": true,
    "topP": 0.95
  }
]

How It Works

How a message moves through Nocturne

From the moment you hit Enter to the first streamed token, here is what happens under the hood.

01. Receive

Discord or Web

Takes in prompts from Discord slash commands, DMs, or web chat. If you attach an image, it automatically resizes and compresses it first.

02. Presets

Load Channel Settings

Pulls the right system prompt, temperature, and enabled tools based on the channel or model preset you chose.

03. Generate

Query the Model

Sends the prompt to your LLM endpoint (local or cloud) and checks if the model wants to answer or call a tool.

04. Tools

Run Tools in a Sandbox

Searches the web with Tavily or runs JavaScript inside a locked-down isolated-vm sandbox so untrusted code can't touch your host machine.

05. Stream

Send the Answer Back

Live-streams tokens to the web console via SSE, or edits Discord messages in real time with formatted markdown and math.

Discord Integration

Built-in Slash Commands

Registered with Discord REST API v10 with dynamic permission resolution and guild channel targeting.

Command Description Context & Permissions
/chat <message> Stream an autonomous prompt response in designated guild channels or threads. Guild Channels · Public
/model <preset> Switch channel LLM system prompt and temperature with live autocomplete. Guild Channels · Admin
/reset Flush conversational short-term memory window for the active channel or DM. Guild & Direct Messages
/ping Report bot heartbeat, Discord gateway WebSocket latency, and inference status. Public Everywhere
Swipe horizontally to view full table details

Core Capabilities

Engineered for Modularity

Every component is decoupled for easy extensibility.

Modular Tooling System

Create or download new tools with just drag-and-drop, then install through installed-tools.js. Bundles with core built-in functionality.

✓ Custom Tool Packs

Multimodal Input

Use image uploads with supported models, automated Sharp compression for cheap CDN hosting.

✓ Compression for DB

Data Persistence

SQLite for lightning-fast conversation history (>2ms reads) paired with Firebase Admin authentication.

✓ SQLite + Firebase Auth

Ready to deploy?

Get started locally with npm run start or launch the web workspace console directly in your browser.

Launch Console View on GitHub