Initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# meshbot
|
||||
|
||||
Bridges a [MeshCore](https://meshcore.io) companion radio to any OpenAI-compatible LLM endpoint
|
||||
(e.g. `llama-server`, vLLM, Ollama). Listens for direct messages on the device, runs each
|
||||
conversation through the LLM with full per-sender history stored in SQLite, and replies back
|
||||
over the mesh — trimmed to the MeshCore packet payload limit.
|
||||
|
||||
## Quick start
|
||||
|
||||
```sh
|
||||
python -m venv .venv && source .venv/bin/activate
|
||||
pip install -e .
|
||||
|
||||
cp config.example.toml config.toml
|
||||
# edit serial_port and [llm] in config.toml
|
||||
|
||||
python -m meshbot
|
||||
```
|
||||
|
||||
Config file path defaults to `./config.toml` and can be overridden with `MESHBOT_CONFIG`.
|
||||
Any field can be overridden via env vars, e.g. `MESHBOT_LLM__API_KEY=sk-...`.
|
||||
|
||||
## Layout
|
||||
|
||||
- `src/meshbot/bot.py` — connect, subscribe to `CONTACT_MSG_RECV`, dispatch each DM.
|
||||
- `src/meshbot/db.py` — SQLite schema and per-conversation repo functions.
|
||||
- `src/meshbot/llm.py` — `AsyncOpenAI` wrapper.
|
||||
- `src/meshbot/messages.py` — UTF-8-safe byte-length trimming.
|
||||
- `src/meshbot/config.py` — TOML + env-var settings (pydantic-settings).
|
||||
Reference in New Issue
Block a user