trilha: identifying birds by ear on the trail, with no signal
Description and use
The "trilha" CLI processes trail audio offline, identifies bird species, and produces a trustworthy field note, avoiding hallucinations in species, counts, and location.
Problem
Field researchers need to identify bird species from audio recordings taken in remote trail locations without relying on cellular or satellite signal, and record observations in a trustworthy field journal.
Outcome
The tool processes a 5‑minute recording in 5.2 s on CPU, identifies 596 species in range, and outputs a concise field note without hallucinating species or counts. After prompt refinement, it also avoids inventing place names, ensuring the journal reflects the actual location.
Workflow
- 1. Record audio on trail.
- 2. Transfer WAV file to laptop.
- 3. Run
trilha listen <file> --lat <lat> --lon <lon> [--place "<name>"]. - 4. BirdNET 3.0 slices audio into 3‑s windows and scores each window for 11,560 species.
- 5. BirdNET’s range model narrows candidates to 14,082 species, then to 596 species in the specified location and week.
- 6. Gemma 3 generates a prose field note from the detection list, respecting prompt constraints to avoid hallucinations.
- 7. Output detections and field note to console or file.
Evidence
trilha is a command-line tool that does the whole thing on your laptop, offline. It listens to a recording, names what it heard, and writes the outing into a field journal in prose.
BirdNET 3.0, through ONNX on CPU. It knows 11,560 species. It slices the audio into 3-second windows and scores each window independently...
The filter — BirdNET's range model, 14,082 species. Give it latitude, longitude and the week of the year, and it narrows the candidates to what could plausibly be there right now.
The voice — Gemma 3, through Ollama, on my machine. It turns the detection list into a few sentences for the journal.
The field note came back like this: "Field note Aqui está a nota de campo em português: **Nota de Campo – Reserva do Pampa** ..."
I added the rule I'd been missing: "Only ever refer to the location exactly as it is given to you."
- Record date: 2026-10-06T23:41:04.535Z