← Back to list

Moltbot on DGX Spark: A Private AI Agent Using Ollama Local Model

What is simple is false and what is not is useless. — Paul Valéry

Doran Gao · 2026-01-29 07:34 · 150 claps · 5.5 min read paywalled
#inspiration #moltbot-telegram #dgx-spark #local-ai-agent #ollama
Open on Medium ↗
Wiki topics: LLM · Large Language Models AGT · AI Agents ✨ · Lifestyle · General

Moltbot on DGX Spark: A Private AI Agent Using Ollama Local Model

https://theonequote.app/quote/11182

https://theonequote.app/quote/11182

What is simple is false and what is not is useless. — Paul Valéry

Local LLMs make it tempting to pile everything into a single script: a model endpoint here, a Telegram bot there, a few ad-hoc prompts stitched together until the demo replies. It works — right up to the moment you need persistence, authorization, concurrency, or even a clean restart. That’s where complexity quietly becomes the real failure mode. Valéry’s warning is why this article exists: we take a working local Ollama deployment and move the agent concerns into Moltbot, running on DGX Spark as a stable control plane. The result isn’t more capability — it’s less accidental complexity: a clear gateway, explicit pairing, predictable model routing, and an agent that can grow without collapsing under its own glue code.

There’s a big difference between running a local LLM and running a personal AI agent.

A local LLM gives you inference: prompt → tokens → response. A personal agent is always-on, reachable from your phone, and built to hold state, manage sessions, and safely route requests across channels and models.

This is where DGX Spark and Moltbot become an unusually clean match:

  • DGX Spark is a “personal AI supercomputer” class box: Grace‑Blackwell (GB10) + 128GB coherent unified memory, marketed at up to 1 petaFLOP FP4 and capable of working with very large models locally (even up to ~200B parameters depending on format/quantization). (NVIDIA) Even if your LLM is hosted elsewhere (like your K8s cluster), DGX Spark is an excellent always‑on host for the agent runtime and gateway.
  • Moltbot is the orchestration layer: it turns “a model endpoint” into an agent that can live in chat apps, enforce pairing/approval, manage sessions/compaction, and route messages to your chosen model provider(s). It reads a JSON5 config from ~/.clawdbot/moltbot.json and runs a WebSocket gateway (default port is typically 18789). (Molt Bot)

In this article we’ll do exactly one thing — cleanly:

✅ Run Moltbot on DGX Spark ✅ Connect it to your existing Ollama endpoint (already running on local K8s, exposed by IP) ✅ Talk to it through Telegram (BotFather token + Moltbot pairing approval) ✅ Use **nemotron-3-nano:30b** first (try other models later)

What you’re building

Telegram → Moltbot Gateway (DGX Spark) → Agent Runtime → Ollama OpenAI-compatible API (K8s) → nemotron-3-nano:30b

Moltbot handles:

  • Telegram message ingestion
  • DM sender authorization via pairing codes
  • Session state + compaction
  • Dispatch to your Ollama endpoint (OpenAI-compatible /v1)

Prerequisites

  1. DGX Spark (or any Linux host) with shell access
  2. Ollama already running in your local environment and reachable from DGX Spark by IP
  3. Telegram account
  4. A Telegram bot token from BotFather (we’ll create it below)

Step 0: Confirm Ollama is reachable (quick readiness check)

From DGX Spark, verify your Ollama endpoint is live:

curl http://192.168.86.201:11434/v1/models

You should see a list similar to what you posted, including:

  • nemotron-3-nano:30b
  • and other models you may try later (deepseek-ocr, qwen3-coder, etc.)

This confirms “Ollama is ready.” We won’t install or configure it in this article.

Step 1: Create a Telegram bot (BotFather)

  1. Open Telegram and message @BotFather
  2. Run:
/newbot
  1. BotFather will ask for:
  • A name (anything)
  • A username (must end in bot, e.g. MyMoltAgentBot)
  1. BotFather replies with your bot token, which looks like:
123456789:AA...REDACTED...xyz

Save it. You’ll paste it into Moltbot config later.

Optional BotFather settings (nice for personal bots):

  • /setprivacy (controls behavior in groups)
  • /setjoingroups (if you want to prevent group usage)

For a first run, I recommend DM only.

Step 2: Install Moltbot on DGX Spark

If you haven’t installed Moltbot yet, the simplest path is the official installer script:

curl -fsSL https://molt.bot/install.sh | bash

The installer approach is documented by Moltbot. (Molt Bot)

After install, confirm the command exists:

moltbot --help

Step 3: Create the Moltbot config file

Moltbot reads configuration from:

~/.clawdbot/moltbot.json (Molt Bot)

Create the directory if needed:

mkdir -p ~/.clawdbot
nano ~/.clawdbot/moltbot.json

Paste your configuration (intact, sensitive fields masked)

You asked to keep this file structurally unchanged and include it intact. Here it is, exactly as you provided, with sensitive fields already masked:

{
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "ollama": {
        "baseUrl": "http://192.168.86.201:11434/v1",
        "apiKey": "ollama-local",
        "api": "openai-responses",
        "models": [
          {
            "id": "nemotron-3-nano:30b",
            "name": "nemotron-3-nano:30b",
            "reasoning": true,
            "input": ["text"],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 128000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      },
      "compaction": {
        "mode": "safeguard"
      },
      "workspace": "/home/doran/clawd",
      "model": {
        "primary": "ollama/nemotron-3-nano:30b"
      },
      "models": {
        "ollama/nemotron-3-nano:30b": {}
      }
    }
  },
  "gateway": {
    "mode": "local",
    "auth": {
      "mode": "token",
      "token": "xxxx"
    },
    "port": 18789,
    "bind": "loopback",
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    }
  },
  "plugins": {
    "entries": {
      "telegram": {
        "enabled": true
      }
    }
  },
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "xxxxxx"
    }
  },
  "meta": {
    "lastTouchedVersion": "2026.1.24-3",
    "lastTouchedAt": "2026-01-29T01:07:44.567Z"
  }
}

Now replace only the sensitive fields

  1. Set your Telegram bot token:
  • Replace:"botToken": "xxxxxx"
  • With:"botToken": "<YOUR_BOTFATHER_TOKEN>"
  1. Set a strong gateway token:
  • Replace:"token": "xxxx"With a random value:
openssl rand -hex 32

Paste that output into gateway.auth.token.

Quick annotation: why each section matters (without changing the file)

  • **models.providers.ollama.baseUrl** Points Moltbot at your K8s-exposed Ollama endpoint (/v1), so Moltbot can treat it as an OpenAI-style API.
  • **models.providers.ollama.api: "openai-responses"** Tells Moltbot to use the Responses-style interface for model calls (Moltbot supports this mode). (Molt Bot)
  • **models.providers.ollama.models[0]** Pins one model for now: nemotron-3-nano:30b with reasoning: true and large context settings.
  • **agents.defaults** Sets concurrency and compaction behavior so the agent can run multiple tasks/subagents without going wild.
  • **gateway.bind: "loopback"** Security-by-default: gateway only listens on localhost unless you intentionally expose it.
  • **channels.telegram + plugins.entries.telegram** Enables Telegram channel support.

Step 4: Start the Moltbot gateway

Run:

moltbot gateway

The gateway CLI supports flags like --port and --bind, but your config already sets them. (Molt Bot)

If you want more logs while debugging:

moltbot gateway --verbose

Step 5: Telegram “authorization code” (Pairing)

By default, Moltbot uses DM pairing for Telegram:

  • An unknown sender gets a pairing code
  • Messages are ignored until that code is approved
  • Codes expire after ~1 hour (Molt Bot)

Flow

  1. In Telegram, DM your bot:
/start
  1. The bot replies with a pairing code like:
JN4MSY23
  1. On DGX Spark, approve it:
moltbot pairing list telegram
moltbot pairing approve telegram <CODE>

These are the official commands documented for Telegram DM pairing. (Molt Bot)

After approval, your Telegram account is authorized and the bot will respond normally.

Step 6: Validate end-to-end

In Telegram, ask a couple of “sanity check” prompts:

  • “What model are you using?”
  • “Summarize what you can do as my assistant”
  • “Write a short migration plan from Docker Compose to Kubernetes”

If you want to confirm model routing:

  • keep the gateway running in a terminal and watch for outbound calls to your Ollama base URL.

Screen demo

What this unlocks next

Once this baseline is stable, you can grow it safely:

  • Swap agents.defaults.model.primary to try your other Ollama models (qwen3-coder, devstral, etc.)
  • Add more channels later (WhatsApp, Slack, etc.) without changing inference
  • Introduce plugins/tools gradually when you’re ready

But the core is already powerful:

https://theonequote.app/quote/11182DGX Spark hosts your agent runtime + gateway. Telegram is your UI. Ollama (K8s) is your local intelligence.

That’s the simplest “private AI agent” stack that actually feels usable day-to-day.

AI only gets real when you stop talking about it and start building with it.Used well, it unlocks what wasn’t possible before — and as it evolves, it keeps opening new paths and redefining how we do the old ones. That’s what I share here — what works, what breaks, and what’s worth understanding more deeply. **Follow along and subscribe** if you want to stay close to the edge.

[embed]About — Doran Gao — Medium Read writing from Doran Gao on Medium. Doran Gao builds AI-powered products and systems. Creator of TheOneQuote.app…medium.com


메타데이터
post_id
432dbbc03301
slug
moltbot-on-dgx-spark-a-private-ai-agent-using-ollama-local-model-432dbbc03301
url
https://medium.com/@dorangao/moltbot-on-dgx-spark-a-private-ai-agent-using-ollama-local-model-432dbbc03301
canonical_url
https://medium.com/@dorangao/moltbot-on-dgx-spark-a-private-ai-agent-using-ollama-local-model-432dbbc03301
author_url
https://medium.com/@dorangao
status
ok
fetched_at
2026-07-20 22:19:23