Skip to main content

Local inference client for Loreguard NPCs

Project description

Loreguard

PyPI version Build License: MIT Python 3.10+ GitHub release

┌────────────────────────────────────────────────────────────────────────────────┐
│                                                                                │
│  ██╗      ██████╗ ██████╗ ███████╗   ██████╗ ██╗   ██╗ █████╗ ██████╗ ██████╗  │
│  ██║     ██╔═══██╗██╔══██╗██╔════╝  ██╔════╝ ██║   ██║██╔══██╗██╔══██╗██╔══██╗ │
│  ██║     ██║   ██║██████╔╝█████╗    ██║  ███╗██║   ██║███████║██████╔╝██║  ██║ │
│  ██║     ██║   ██║██╔══██╗██╔══╝    ██║   ██║██║   ██║██╔══██║██╔══██╗██║  ██║ │
│  ███████╗╚██████╔╝██║  ██║███████╗  ╚██████╔╝╚██████╔╝██║  ██║██║  ██║██████╔╝ │
│  ╚══════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝   ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝  │
│                                                                                │
│  Local inference for your game NPCs                                            │
│  loreguard.com                                                                 │
│                                                                                │
└────────────────────────────────────────────────────────────────────────────────┘

AI-Powered NPCs using your own hardware (your servers or your player's hardware) Loreguard CLI connects the LLM Inference to the Loreguard NPC system.

How It Works

┌─────────────────┐    wss://api.loreguard.com    ┌─────────────────┐
│   Your Game     │◄────────────────────────────► │  Loreguard API  │
│  (NPC Dialog)   │                               │    (Backend)    │
└─────────────────┘                               └────────┬────────┘
                                                           │
                                                           │ Routes inference
                                                           │ to your worker
                                                           ▼
                                                  ┌─────────────────┐
                                                  │  Loreguard CLI  │◄── You run this
                                                  │  (This repo)    │
                                                  └────────┬────────┘
                                                           │
                                                           │ Local inference
                                                           ▼
                                                  ┌─────────────────┐
                                                  │   llama.cpp     │
                                                  │  (Your GPU/CPU) │
                                                  └─────────────────┘

Installation

Option 1: Download Binary (Recommended)

Download standalone binaries from Releases:

  • loreguard-linux - Linux x64
  • loreguard-macos - macOS (Intel & Apple Silicon)
  • loreguard-windows.exe - Windows x64

Option 2: Install from PyPI

pip install loreguard-cli

Option 3: Install from Source

git clone https://github.com/beyond-logic-labs/loreguard-cli
cd loreguard-cli
pip install -e .

Option 4: Build Your Own Binary

git clone https://github.com/beyond-logic-labs/loreguard-cli
cd loreguard-cli
pip install -e ".[build]"
python scripts/build.py
# Output: dist/loreguard (or dist/loreguard.exe on Windows)

Quick Start

Interactive Wizard

loreguard

The wizard guides you through:

  1. Authentication - Enter your worker token
  2. Model Selection - Choose or download a model
  3. Running - Starts llama-server and connects to backend

Headless CLI

loreguard-cli --token lg_worker_xxx --model /path/to/model.gguf

Or auto-download a supported model:

loreguard-cli --token lg_worker_xxx --model-id qwen3-4b-instruct

Environment variables:

export LOREGUARD_TOKEN=lg_worker_xxx
export LOREGUARD_MODEL=/path/to/model.gguf
loreguard-cli

Supported Models

Works with any .gguf model. Tested with the following model families:

  • Qwen - Recommended for best quality/speed balance
  • Llama - Meta's open models
  • GPT - GPT-style open models
  • RNJ - Specialized models
  • Violet Lotus - Community fine-tunes

Use any model with --model /path/to/model.gguf.

Use Cases

For Game Developers (Testing & Development)

Use Loreguard CLI during development to test NPC dialogs with your own hardware:

# Start the worker
loreguard-cli --token $YOUR_DEV_TOKEN --model-id qwen3-4b-instruct

# Your game connects to Loreguard API
# NPC inference requests are routed to your local worker

For Players (Coming Soon)

Note: Player distribution support is in development. Currently, players would need their own Loreguard account and token.

We're working on a Game Keys system that will allow:

  • Developers to register their game and get a Game API Key
  • Players to run the CLI without needing a Loreguard account
  • Automatic worker provisioning scoped to each game

Interested in early access? Contact us at loreguard.com

Requirements

  • RAM: 8GB minimum (16GB+ for larger models)
  • GPU: Optional but recommended (NVIDIA CUDA or Apple Silicon)
  • Disk: 2-6GB depending on model
  • Python: 3.10+ (if installing from source)

Get Your Token

  1. Go to loreguard.com/developers
  2. Create a worker token
  3. Use it with --token or LOREGUARD_TOKEN

Development

git clone https://github.com/beyond-logic-labs/loreguard-cli
cd loreguard-cli
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

# Run interactive wizard
python -m src.wizard

# Run headless CLI
python -m src.cli --help

# Run tests
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loreguard_cli-0.3.4.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loreguard_cli-0.3.4-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

Details for the file loreguard_cli-0.3.4.tar.gz.

File metadata

  • Download URL: loreguard_cli-0.3.4.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for loreguard_cli-0.3.4.tar.gz
Algorithm Hash digest
SHA256 6b0845f98e0cc8d2fca58090e484c9db37e75e40481fa4e4e4ba2ad155d4e5e7
MD5 b226a75dc79f7f523f4d45ae683a5dba
BLAKE2b-256 4cddcb12a3e1b15fbef9fd352a3bba5009fcf3345e24238fac0f674e77288d9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for loreguard_cli-0.3.4.tar.gz:

Publisher: release.yml on beyond-logic-labs/loreguard-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loreguard_cli-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: loreguard_cli-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 46.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for loreguard_cli-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9e23997f27d04cb43a1067ffca7f3dab1f465aedae9fa3d1d71caa9d5b7f8204
MD5 896fb2519317ec54f143765ce4e9823d
BLAKE2b-256 2ce09b61acae840af6a8800d774b7c0a0cfc9fea7c67a9a2e2ffadea45a491b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for loreguard_cli-0.3.4-py3-none-any.whl:

Publisher: release.yml on beyond-logic-labs/loreguard-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page