Metadata-Version: 2.5
Name: notepipe-asr-llama
Version: 0.1.5
Summary: llama.cpp speech recognition adapter for notepipe
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# notepipe-asr-llama

A [notepipe](https://github.com/3ae3ae/notepipe) speech adapter that runs speech recognition locally with
[llama.cpp](https://github.com/ggml-org/llama.cpp)'s `llama-server`, on CPU or GPU.

It starts `llama-server` on an internal port with the arguments you give it, serves notepipe's adapter API in front of
it, and removes Qwen3-ASR's output markers (`language …<asr_text>`) so notepipe receives plain text.

## Install

Install `llama-server` (for example from your package manager or the llama.cpp releases), then:

```sh
uv tool install "notepipe[llama]"
```

## Use

```toml
[providers.llama]
command = ["notepipe-asr-llama", "-hf", "ggml-org/Qwen3-ASR-1.7B-GGUF:Q8_0"]
concurrency = 1

[stages.transcript.speech]
provider = "llama"
```

Every argument other than `--host`, `--port` and `--llama-server PATH` is passed to `llama-server` unchanged, so you can
add options such as `-ngl 0` (CPU only). The first run downloads the model. The transcript stage's `language` is passed
to the model as a hint.

Each segment may produce 40 tokens plus 25 per second of audio, several times what speech needs. On some short
segments Qwen3-ASR repeats one word under greedy decoding until it reaches that cap; the adapter then decodes the
segment again with a repetition penalty, and then with sampling at temperature 0.4. Only when all three reach the cap
does it report `output_limit`. All decodes of one segment share 570 seconds, inside the 600 seconds notepipe gives a
request, and the adapter answers `504` when they run out. When a fallback decoding produced the text, the answer carries
a `warning` that says so, which notepipe shows next to the segment's time.
