Serving Clients
Use this sub-skill when the ASRT service boundary is the active problem: starting an already prepared HTTP/gRPC server, constructing request payloads, calling the service, interpreting responses, or debugging deployment and client integration failures.
Route here
- Start or configure ASRT HTTP/gRPC service processes after trained acoustic weights and language-model assets are already present.
- Build HTTP JSON payloads for
GET /, POST /, POST /speech, POST /language, and POST /all.
- Integrate gRPC clients for
Speech, Language, All, and Stream using the AsrtGrpcService contract.
- Interpret ASRT response/status fields, including streaming partial status
206000 and final status 200000.
- Debug endpoint paths, ports, base64 encoding, WAV metadata, protobuf stubs, and Docker CPU-only serving behavior.
Not here
- Training, exporting, or selecting acoustic model weights.
- Dataset preparation or audio feature extraction beyond reading WAV metadata and sample bytes for service payloads.
- Language-model corpus construction, scoring internals, or pinyin-to-text quality tuning.
- Copying or rewriting ASRT server implementations.
Read first
- Deployment boundaries and startup
- HTTP JSON API
- gRPC API
- Troubleshooting
Bundled runtime helpers
scripts/make_http_payload.py builds JSON request bodies from a user-provided WAV file or pinyin sequence without importing ASRT.
scripts/asrt_http_client.py calls the ASRT HTTP service with only Python standard-library networking and WAV handling.
Safe help checks:
python scripts/make_http_payload.py --help
python scripts/asrt_http_client.py --help
Example payload/client flow:
python scripts/make_http_payload.py --endpoint /all --wav sample.wav --pretty > all-payload.json
python scripts/asrt_http_client.py all --wav sample.wav --base-url http://127.0.0.1:20001
python scripts/asrt_http_client.py language --sequence-pinyin ni3 hao3 ya5
Critical operating facts
- The original HTTP and gRPC server scripts instantiate
SpeechModel251BN, load save_models/SpeechModel251bn.model.h5, and load model_language at module import time before serving requests.
- Those server scripts start long-lived listeners (
waitress.serve for HTTP; grpc.server(...).start() plus an infinite sleep loop for gRPC). This generated runtime therefore bundles only client and payload helpers, not server copies.
- HTTP audio requests send raw WAV sample frames, not the RIFF/WAVE container, as URL-safe base64 text in
samples with matching sample_rate, channels, and byte_width metadata.
- HTTP language requests send
sequence_pinyin as a JSON list of pinyin syllable strings.
- gRPC audio requests send the same raw sample frames in
WavData.samples; gRPC language requests send repeated pinyins in LanguageRequest.
Evidence base
This sub-skill was revised from the serving evidence in asrserver_http.py, asrserver_grpc.py, client_http.py, client_grpc.py, assets/asrt.proto, Dockerfile, README.md, README_EN.md, and utils/ops.py.
Routing notes
- Missing
save_models/SpeechModel251bn.model.h5 is a model-preparation problem; stop server/client debugging and route to acoustic-model work.
- Invalid WAV sample shape, sample rate, channel count, or sample width belongs to data/audio preparation after confirming the client payload mirrors the WAV metadata.
- Bad pinyin-to-text output with successful
/language or gRPC Language responses belongs to language-model work.
- For protobuf, generated-stub, version, or service-method mismatches, use gRPC API and Troubleshooting before changing application logic.
1---2name: serving-clients3description: "Deploy and integrate ASRT HTTP/gRPC serving clients once trained4 weights are available."5metadata:6 source: https://skillmd.com/skills/vectorspacelab/serving-clients7 disco-role: operating8disable-model-invocation: true9license: GPL 3.010---1112# Serving Clients1314Use this sub-skill when the ASRT service boundary is the active problem: starting an already prepared HTTP/gRPC server, constructing request payloads, calling the service, interpreting responses, or debugging deployment and client integration failures.1516## Route here1718- Start or configure ASRT HTTP/gRPC service processes after trained acoustic weights and language-model assets are already present.19- Build HTTP JSON payloads for `GET /`, `POST /`, `POST /speech`, `POST /language`, and `POST /all`.20- Integrate gRPC clients for `Speech`, `Language`, `All`, and `Stream` using the `AsrtGrpcService` contract.21- Interpret ASRT response/status fields, including streaming partial status `206000` and final status `200000`.22- Debug endpoint paths, ports, base64 encoding, WAV metadata, protobuf stubs, and Docker CPU-only serving behavior.2324## Not here2526- Training, exporting, or selecting acoustic model weights.27- Dataset preparation or audio feature extraction beyond reading WAV metadata and sample bytes for service payloads.28- Language-model corpus construction, scoring internals, or pinyin-to-text quality tuning.29- Copying or rewriting ASRT server implementations.3031## Read first3233- [Deployment boundaries and startup](references/deployment.md)34- [HTTP JSON API](references/http-api.md)35- [gRPC API](references/grpc-api.md)36- [Troubleshooting](references/troubleshooting.md)3738## Bundled runtime helpers3940- `scripts/make_http_payload.py` builds JSON request bodies from a user-provided WAV file or pinyin sequence without importing ASRT.41- `scripts/asrt_http_client.py` calls the ASRT HTTP service with only Python standard-library networking and WAV handling.4243Safe help checks:4445```bash46python scripts/make_http_payload.py --help47python scripts/asrt_http_client.py --help48```4950Example payload/client flow:5152```bash53python scripts/make_http_payload.py --endpoint /all --wav sample.wav --pretty > all-payload.json54python scripts/asrt_http_client.py all --wav sample.wav --base-url http://127.0.0.1:2000155python scripts/asrt_http_client.py language --sequence-pinyin ni3 hao3 ya556```5758## Critical operating facts5960- The original HTTP and gRPC server scripts instantiate `SpeechModel251BN`, load `save_models/SpeechModel251bn.model.h5`, and load `model_language` at module import time before serving requests.61- Those server scripts start long-lived listeners (`waitress.serve` for HTTP; `grpc.server(...).start()` plus an infinite sleep loop for gRPC). This generated runtime therefore bundles only client and payload helpers, not server copies.62- HTTP audio requests send raw WAV sample frames, not the RIFF/WAVE container, as URL-safe base64 text in `samples` with matching `sample_rate`, `channels`, and `byte_width` metadata.63- HTTP language requests send `sequence_pinyin` as a JSON list of pinyin syllable strings.64- gRPC audio requests send the same raw sample frames in `WavData.samples`; gRPC language requests send repeated `pinyins` in `LanguageRequest`.6566## Evidence base6768This sub-skill was revised from the serving evidence in `asrserver_http.py`, `asrserver_grpc.py`, `client_http.py`, `client_grpc.py`, `assets/asrt.proto`, `Dockerfile`, `README.md`, `README_EN.md`, and `utils/ops.py`.6970## Routing notes7172- Missing `save_models/SpeechModel251bn.model.h5` is a model-preparation problem; stop server/client debugging and route to acoustic-model work.73- Invalid WAV sample shape, sample rate, channel count, or sample width belongs to data/audio preparation after confirming the client payload mirrors the WAV metadata.74- Bad pinyin-to-text output with successful `/language` or gRPC `Language` responses belongs to language-model work.75- For protobuf, generated-stub, version, or service-method mismatches, use [gRPC API](references/grpc-api.md) and [Troubleshooting](references/troubleshooting.md) before changing application logic.