Skip to main content

camosur

An IRC chat persona and West Marches D&D game master backed by a language model.

camosur connects to one or more IRC networks, keeps a shared WAL-mode SQLite database between its IRC relay and LLM brain, participates in channel banter on a schedule with presence windows and spend caps, reflects nightly on conversations, and runs West Marches D&D 5e (SRD 5.1) expeditions via !dnd.

Quick start

camosur requires Python 3.13 or later and declares no base dependencies — install the provider extra you need (openai, anthropic, bedrock, or all).

Local with Ollama (free)

Ollama's OpenAI-compatible API uses the openai extra:

pip install 'camosur[openai]'
ollama pull qwen2.5:7b
camosur run ircs://irc.example.org/#channel

camosur run with an IRC URL seeds the channel and an always-on schedule in camosur.db, turns disclosure on (AI bot - https://camosur.com), auto-detects Ollama on http://127.0.0.1:11434, and prints a one-time /msg <nick> claim <code> instruction to stderr so you can claim ownership on IRC.

Cloud providers

# Anthropic (uses ANTHROPIC_API_KEY)
pip install 'camosur[anthropic]'
camosur run ircs://irc.example.org/#channel

# OpenAI (uses OPENAI_API_KEY)
pip install 'camosur[openai]'
camosur run ircs://irc.example.org/#channel

# Amazon Bedrock (uses ambient AWS credentials)
pip install 'camosur[bedrock]'
camosur run ircs://irc.example.org/#channel

Pass --model PROVIDER:MODEL (e.g. --model anthropic:claude-haiku-4-5) to override auto-detection, or --nick NICK to override the persona's default nick.

Configuration file

camosur init
# Edit camosur.toml and persona.toml
camosur run

camosur init writes a starter camosur.toml and persona.toml (copied from brain/persona.example.toml). Without a URL, camosur run reads camosur.toml, or falls back to relay.json and brain.json. Pass --only relay or --only brain to run the two sides in separate processes sharing --db.

Models and evals

camosur routes each job to a named model slot (banter, guard, reflection, and game). Small models handle the non-GM routes well; the West Marches GM route is more demanding.

Results from the fictional public eval suite (brain/evals/results/2026-12-03.md, 3 runs per case, projected at 100 calls/day):

Route Model Limit cases (strict) Limit cases (2/3 runs) Contract Est. USD/month
guard us.amazon.nova-lite-v1:0 10/10 10/10 30/30 0.07
banter global.anthropic.claude-haiku-4-5-20251001-v1:0 9/10 10/10 36/36 2.34
reflection us.amazon.nova-pro-v1:0 6/6 6/6 18/18 3.12
game global.anthropic.claude-haiku-4-5-20251001-v1:0 4/8 4/8 24/24 17.58

Note: game is currently below gate on Haiku 4.5 (4/8 cases); evaluate a stronger model before relying on it for West Marches sessions.

Run the eval suite against any candidate model:

python -m brain.evals --route banter --models <model-id> --guard-model <guard-id>

Deploying on AWS

For a self-hosted AWS deployment (single Spot EC2 instance over IPv6, Litestream SQLite replication to S3, Bedrock Converse proxy Lambda, status page, and optional D&D hex map publishing), use the terraform-aws-camosur Terraform module.

Design and activities

See docs/architecture.md for process topology, message dispatch, and deployment diagrams.

  • Chat (brain/chat/): Presence windows, measured channel rhythm, burst holding, thread-aware addressing, catch-up remarks, conversation openers, link title fetching, optional cultural calendar awareness (US, CA, GB, AU, INTL) and per-channel timezones, outbound safety guard (KEEP/DROP), daily and monthly spend caps, and nightly reflection (brain/reflect/). Turn rules evaluate in order (away, hard, summon, answer, quiet, held, queued, other, engaged, unprompted), and periodic ticks evaluate backlog, catchup, and opener.
  • West Marches (brain/game/): SRD 5.1 rules core (Fighter, Rogue, Cleric, Wizard to level 5; four races; spells to 3rd level; ~20 monsters), seeded hex map with SVG/HTML rendering, expeditions, and shared journal. Players interact in-channel via !dnd.
  • Slap (brain/slap/): !slap <nick> and !slap <nick> with <item> with configurable trout chance and cooldown.
  • Help (brain/help/): !help lists public activity commands via NOTICE.
  • Activities plugin API (brain/activity.py): Additional activities register via the camosur.activities entry point group.

Owner commands

Private messages from configured owner masks or IRCv3 accounts are commands answered via NOTICE with no model call; non-owner DMs are ignored (except the one-time claim <code> bootstrap when unowned). Send /msg <nick> help to list Core, Chat, and Activities commands (status, budget, schedule, presence, channel, person, mask, directive, campaign, flag).

Development

pip install -r requirements-dev.txt
pytest
pre-commit run --all-files

Layout:

  • camosur/irc/: Standard-library-only IRC client (IRCv3 capabilities, SASL PLAIN, TLS certificate pinning, CTCP, rate limiting).
  • relay/: Multi-network IRC bridge, !botlist/!rollcall, ident server, and SQLite event/outbox loop.
  • brain/: Activity dispatch, chat presence/rhythm/guard/budget, nightly reflection, West Marches GM, owner commands, and evals.
  • shared/: Shared SQLite store, key encoding, event helpers, and package version lookup.
  • runner/: CLI (camosur), camosur.toml/URL config, CloudWatch/status/map wiring.
  • scripts/: Utility scripts (models.py, transcript.py, corpus.py, migrate_state.py, denylist.sh).

License

Licensed under the Apache License 2.0. See NOTICE for third-party attributions.

This work includes material taken from the System Reference Document 5.1 ("SRD 5.1") by Wizards of the Coast LLC and available at https://dnd.wizards.com/resources/systems-reference-document. The SRD 5.1 is licensed under the Creative Commons Attribution 4.0 International License available at https://creativecommons.org/licenses/by/4.0/legalcode.

Metadata

Release files for camosur 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for camosur 0.2.0
File Size Uploaded Provenance Actions
camosur-0.2.0.tar.gz 223.4 kB With provenance Details for camosur-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for camosur 0.2.0
File Interpreter ABI Platform Actions
camosur-0.2.0-py3-none-any.whl Python 3 none any Details for camosur-0.2.0-py3-none-any.whl

Total release size: 497.0 kB

Release files / camosur-0.2.0.tar.gz

Download URL camosur-0.2.0.tar.gz
Size 223.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9ef32085c80993f90f19e08cd30c25bb539c6e2833a548639b2760f4d4f6dcb6
BLAKE2b-256 checksum
How to use checksums
fea69f58e43b98b02a013ee4e10a8094d35e818af734bf163af01d100dd1bf93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / camosur-0.2.0-py3-none-any.whl

Download URL camosur-0.2.0-py3-none-any.whl
Size 273.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b97af6a4b482f61d1d9a19831f1f9c088728c2bfee4c9f764627fe706b94f52c
BLAKE2b-256 checksum
How to use checksums
941a837d335158751792a01fc28647748a4adebc498d82b1669eac69bbdd5012
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for camosur 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for camosur-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page