A Python service that consumes notes from a Nostr relay and enriches them with machine-learning labels.
It connects to a relay (default wss://saltivka.org) over WebSocket, streams in events, and for each note runs:
dslim/bert-base-NER to extract entities (people, organisations, locations)Redis is used for coordination/state. Models run on CPU by default, or on GPU when CUDA_DEVICE is set.
With Docker Compose:
docker compose up
Or directly:
pip install -r requirements.txt
python3 app.py
All configuration is via environment variables:
| Variable | Default | Description |
|---|---|---|
RELAY_URL | wss://saltivka.org | Nostr relay to consume from |
REDIS_URL | redis://redis:6379 | Redis connection URL |
SECRET_KEY | — | Secret key used by the service (provide your own; do not commit it) |
PAST_EVENTS_LIMIT | 1000 | How many historical events to pull on connect |
CUDA_DEVICE | -1 | GPU device index; -1 runs the models on CPU |
2 commits
Python
95.5%
Dockerfile
4.5%
A Python service that consumes notes from a Nostr relay and enriches them with machine-learning labels.
It connects to a relay (default wss://saltivka.org) over WebSocket, streams in events, and for each note runs:
dslim/bert-base-NER to extract entities (people, organisations, locations)Redis is used for coordination/state. Models run on CPU by default, or on GPU when CUDA_DEVICE is set.
With Docker Compose:
docker compose up
Or directly:
pip install -r requirements.txt
python3 app.py
All configuration is via environment variables:
| Variable | Default | Description |
|---|---|---|
RELAY_URL | wss://saltivka.org | Nostr relay to consume from |
REDIS_URL | redis://redis:6379 | Redis connection URL |
SECRET_KEY | — | Secret key used by the service (provide your own; do not commit it) |
PAST_EVENTS_LIMIT | 1000 | How many historical events to pull on connect |
CUDA_DEVICE | -1 | GPU device index; -1 runs the models on CPU |
2 commits
Python
95.5%
Dockerfile
4.5%