Skip to content

lerim serve

Start the HTTP API server and daemon loop in a single process. This repo does not bundle the full dashboard UI; the hosted product surface lives on Lerim Cloud.

Overview

lerim serve is the all-in-one runtime process. It starts:

  1. HTTP API — JSON endpoints used by CLI commands (answer, ingest, curate, status)
  2. Daemon loop — Background ingest and curate cycles on configured intervals

GET / may return a minimal HTML stub when no bundled static assets are present.

This is the Docker container entrypoint (lerim up runs lerim serve inside the container), but it can also be run directly for development without Docker.

Info

For Docker-based usage, prefer lerim up which handles container lifecycle, volume mounts, and config generation automatically. Use lerim serve directly when developing or running without Docker.

Syntax

lerim serve [--host HOST] [--port PORT]

Parameters

--host string default: from [server].host (shipped: 127.0.0.1)

Network interface to bind to. Docker path (lerim up) injects --host 0.0.0.0. Direct lerim serve uses config default unless overridden.

--port integer default: 8765

TCP port for the JSON API (and stub HTML at / when no bundled UI).

Examples

Start with defaults

lerim serve

Logs show the API bind address and daemon intervals (exact wording may vary by version).

Custom bind address

# Local-only access on a custom port
lerim serve --host 127.0.0.1 --port 9000

Development workflow

# Install in editable mode and run directly
uv pip install -e .
lerim serve

Tip

When running lerim serve directly (not via Docker), make sure your config exists. Run lerim init first if needed.

What it starts

Component Description Endpoint
HTTP API JSON API for CLI commands http://<host>:<port>/api/
Root Stub HTML or optional assets http://<host>:<port>/
Daemon loop Background ingest/curate on intervals — (internal)

The daemon loop uses ingest_interval_minutes and curate_interval_minutes from your active Lerim config (defaults are in the shipped default.toml).

Exit codes

Code Meaning
0 Clean shutdown (SIGINT/SIGTERM)
1 Startup failure (port in use, config missing)
  • lerim up


    Start Lerim via Docker (runs serve inside)

    lerim up

  • Background loop


    Ingest + curate intervals (runs inside serve)

    Background loop

  • lerim dashboard


    Print the dashboard transition message + CLI alternatives

    lerim dashboard

  • lerim status


    Check server health and runtime state

    lerim status