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 evaluatebacklog,catchup, andopener. - 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. - Seen (
brain/seen/):!seen <nick>reports per-channel last-seen activity (channel-only, never leaking DMs, other channels, hostmasks, or memory notes). - Weather (
brain/weather/):!weather <location>looks up current conditions via Open-Meteo (with two-tier caching, optional Lambda proxy for IPv6-only hosts, guarded LLM replies, and deterministic fallback). - Help (
brain/help/):!helplists public activity commands via NOTICE. - Activities plugin API (
brain/activity.py): Additional activities register via thecamosur.activitiesentry 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.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| camosur-0.4.0.tar.gz | 233.8 kB | With provenance | Details for camosur-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| camosur-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for camosur-0.4.0-py3-none-any.whl |
Total release size: 522.3 kB
Release files / camosur-0.4.0.tar.gz
| Download URL | camosur-0.4.0.tar.gz |
|---|---|
| Size | 233.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34e157fae3aff097b30f0408b6928f487122a25e5f4cb319251771f4b4bae691
|
|
BLAKE2b-256 checksum How to use checksums |
78c8e6510bb5f759f5150b8328ffb66c5923d379db6106ba761500dcddbbeba0
|
| 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 logRelease files / camosur-0.4.0-py3-none-any.whl
| Download URL | camosur-0.4.0-py3-none-any.whl |
|---|---|
| Size | 288.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d9a21c1aa2e18948cf960fa90f8dbd1efa1bc471955f5dc15247ee085c990d5
|
|
BLAKE2b-256 checksum How to use checksums |
9c2cc06b8cf281b7d7a0fa5aee8d29f0ce3470adc91e30301d0173a51fd2b2ae
|
| 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 logSecurity for camosur 0.4.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.
Attestation for camosur-0.4.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 logA 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.