A unified speech recognition API gateway that integrates multiple local and cloud ASR engines with intelligent model lifecycle management.
- Dual Experience: Modern Desktop Dashboard & System Tray Companion β Lightweight native desktop console (Vue 3 + Tauri) with menu bar tray support (<5MB idle), accompanied by terminal CLI (
oneasr) and standard REST/WebSocket API - Standalone Prebuilt Packages β Self-contained installers for macOS (Apple Silicon) with pre-bundled Python runtime, hardware acceleration (Apple MPS / CUDA), and native C-extension audio decoder (
PyAV). No manual Python, PyTorch, or FFmpeg setup required - Unified OpenAI-Compatible Audio API β Upload audio/video files or specify
file_uuid/url, get transcription injson,verbose_json,text,srt,vtt, ortsv - SSE Streaming File Recognition β Receive sentence-by-sentence transcription segments in real time via Server-Sent Events (
stream=true) - Real-time WebSocket Streaming β Low-latency streaming speech recognition (
/v1/realtime&/v1/realtime_ext) powered byxasr(sherpa-onnxZipformer2 transducer) - Ollama-Style Model Lifecycle Manager β On-demand loading, configurable
keep_aliveTTL auto-unloading,max_loaded_modelsLRU eviction, active task reference counting, and manual/load&/unloadAPIs - One-Command Model CLI (
oneasr) β Inspect, verify, and download local models into~/.oneasr/modelswith automatic ModelScope / HuggingFace Mirror fallback - File Upload & MD5 Instant Dedup β Upload files with MD5 fingerprint for instant deduplication, plus async long-audio task management
Start the local speech engine daemon:
oneasr serveTranscribe an audio file using the OpenAI-compatible audio API:
curl http://localhost:8020/v1/audio/transcriptions \
-F file=@recording.mp3 \
-F model=sensevoice-smallDownload the self-contained macOS application (with built-in native UI, system tray companion, and Apple MPS acceleration):
Install the standalone command-line engine with a single terminal command:
curl -fsSL https://raw.githubusercontent.com/codeAndxv/OneASR/main/install.sh | shBundles an isolated Python runtime, PyTorch (Apple MPS/CUDA), and native C-extension audio decoder (PyAV). Zero external environment setup required.
- Python 3.12+ (managed by uv)
- Node.js 18+ & Rust / Cargo (for desktop UI)
# 1. Create virtual environment
uv venv --python 3.12
# 2. Install dependencies
uv pip install -r requirements.txt
# or install with dev/test dependencies:
uv pip install -e ".[dev]"
# 3. Download default local models
uv run python -m cli.model pull
# 4. Start the server (with auto-reload on code change)
uv run python -m server.main --reload
# or using CLI:
# uv run oneasr serve --reloadThe backend server listens on http://127.0.0.1:8020. Visit http://127.0.0.1:8020/docs for interactive Swagger API documentation.
In a second terminal, launch the companion desktop application:
cd desktop
# Launch Tauri companion with Vite HMR on port 8025
npm run tauri devNote: In development mode (
npm run tauri dev), the desktop client connects to your local backend on port8020without spawning any child processes. If you only want to debug the web UI in a browser, runnpm run devand openhttp://localhost:8025.
OneASR provides an Ollama-style terminal CLI for model lifecycle management:
# List all available models, local readiness, and disk size
oneasr list
# Pull a model from ModelScope / HuggingFace with progress bar
oneasr pull sensevoice-small
oneasr pull whisper-large-v3-turbo
# Inspect active models in VRAM/memory
oneasr ps
# Display compute acceleration (MPS/CUDA/CPU) and storage paths
oneasr info
# Remove local model weights to free up disk space
oneasr rm whisper-large-v3-turbo
# Start the daemon in foreground (with optional auto-reload)
oneasr serve --reloadcd desktop
npm run build:appThe packaged DMG and standalone bundle will be generated under desktop/src-tauri/target/release/bundle/dmg/.
OneASR runs locally at http://127.0.0.1:8020. Any OpenAI-compatible client (including DuRT, Python scripts, and automation workflows) connects seamlessly:
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:8020/v1",
api_key="sk-oneasr-v1-p_L3kXm9QZ8sT2vA4wE7rY1u"
)
with open("audio.wav", "rb") as f:
transcript = client.audio.transcriptions.create(
model="sensevoice-small",
file=f
)
print(transcript.text)# Check backend health
curl http://localhost:8020/health
# List available models (standard OpenAI format)
curl -H "Authorization: Bearer sk-oneasr-v1-p_L3kXm9QZ8sT2vA4wE7rY1u" \
http://localhost:8020/v1/models
# List models with extended capability matrix & runtime status
curl -H "Authorization: Bearer sk-oneasr-v1-p_L3kXm9QZ8sT2vA4wE7rY1u" \
http://localhost:8020/v1/x/modelsOneASR employs a unified model lifecycle management architecture. To ensure reliability for production and everyday use, the current support and verification status for each model family is as follows:
| Model Family / Architecture | Representative Model ID | Form Factor | Status | Verification & Notes |
|---|---|---|---|---|
| X-ASR (Sherpa-ONNX) | xasr (chunk-160ms-model) |
Real-time Streaming ASR | β Ready (Verified) | Zipformer2 transducer architecture, millisecond-level streaming dictation on edge devices. Fully tested and verified across platforms. |
| Faster-Whisper Series | whisper-tiny / base / small / medium / large-v3 / large-v3-turbo / distil-* |
Offline File Transcription | β Ready (Verified) | CTranslate2-accelerated, high-precision transcription & subtitle export in 99+ languages. Fully tested and verified. |
| FunASR | sensevoice-small / paraformer-zh |
Real-time / Offline | π§ In Progress (Experimental) | Driver adapters and metadata implemented; ongoing fine-tuning and benchmark verification. |
| Qwen ASR | qwen-audio-0.6b / qwen-audio-chat |
Speech Understanding & Alignment | π§ In Progress (Experimental) | Compact speech foundation models and forced alignment, driver integration in progress. |
| FireRed ASR | firered-asr-aed / firered-asr-llm |
Complex Accents & Dialects | π§ In Progress (Experimental) | Geared toward heavy accents and dialects; adapter architecture ready, pending comprehensive integration tests. |
π‘ Recommended Usage: For production and daily workflows, we strongly recommend using the verified models:
X-ASRfor real-time microphone dictation (ultra-low latency & resource consumption) and theFaster-Whisperseries for batch audio/video transcription and subtitle generation.
Local ASR models are stored in ~/.oneasr/models/ by default (configurable via ONEASR_MODELS_DIR).
Open the companion desktop interface, navigate to the Model Management tab, and click Download on the desired model card. The app provides source switching (ModelScope, HF-Mirror, HuggingFace), real-time progress bars, and automatic retry/failover.
OneASR includes a built-in CLI management tool supporting automated source failover (ModelScope -> HF-Mirror -> HuggingFace), resume on interrupt, archive unpacking, and file integrity verification:
# 1. List all local models, runtime status (Ready / Incomplete / Missing), and disk size
uv run python -m cli.model list
# 2. Pull all default-enabled missing models
uv run python -m cli.model pull
# 3. Pull a specific model by identifier
uv run python -m cli.model pull xasr
uv run python -m cli.model pull whisper-large-v3-turbo
uv run python -m cli.model pull qwen --include-aligner
# 4. Pull using a specific hub source or force redownload
uv run python -m cli.model pull --all --source modelscope
uv run python -m cli.model pull whisper-medium --source hf-mirror --force
# 5. Offline integrity verification (useful for pre-flight checks in Docker / CI)
uv run python -m cli.model checkOneASR operates with an Ollama-style zero-config architecture. All models in ~/.oneasr/models/ are detected and loaded on-demand automatically.
User preferences can be adjusted directly from the companion desktop interface (Settings tab) or stored persistently in ~/.oneasr/settings.json.
{
"api_key": "sk-oneasr-v1-p_L3kXm9QZ8sT2vA4wE7rY1u",
"keep_alive": 600,
"max_loaded_models": 2,
"download_source": "auto",
"vad_threshold": 0.5,
"target_chunk_duration": 6.0
}All settings can also be customized via standard system environment variables:
| Variable | Default | Description |
|---|---|---|
ONEASR_API_KEY |
sk-oneasr-v1-... |
API key required for client requests (Authorization: Bearer <key>) |
ONEASR_KEEP_ALIVE |
600 (10m) |
Idle duration before unloading resident models (-1 = stay in memory forever, 0 = immediate release) |
ONEASR_MAX_LOADED_MODELS |
2 |
Maximum concurrent models resident in memory/VRAM (LRU eviction) |
ONEASR_MODELS_DIR |
~/.oneasr/models |
Custom storage directory for local speech models |
ONEASR_HOST |
127.0.0.1 |
Network interface binding (0.0.0.0 for local area network sharing) |
ONEASR_PORT |
8020 |
Server HTTP and WebSocket listening port |
All API endpoints (except /health) require authentication via Authorization: Bearer <api_key> or X-API-Key: <api_key>.
| Endpoint | Method | Description |
|---|---|---|
/v1/models |
GET | List available models (standard OpenAI format) |
/v1/models/{model_id} |
GET | Get model details (standard OpenAI format) |
/v1/audio/transcriptions |
POST | Transcribe audio/video (file, file_uuid, or url; supports stream=true SSE) |
/v1/realtime?api_key= |
WebSocket | Real-time streaming (OpenAI Realtime Transcription protocol) |
/health |
GET | Service health check |
# Synchronous transcription (verbose_json / srt / vtt / text / json)
curl -X POST http://localhost:8020/v1/audio/transcriptions \
-H "Authorization: Bearer sk-oneasr-v1-p_L3kXm9QZ8sT2vA4wE7rY1u" \
-F "file=@tests/fixtures/media/en_speech_15s.wav" \
-F "model=faster-whisper" \
-F "language=en" \
-F "response_format=srt"| Endpoint | Method | Description |
|---|---|---|
/v1/x/models |
GET | List models with full capability matrix, languages, and RAM/VRAM runtime status |
/v1/x/models/{model_id}/load |
POST | Manually warm up / load a model into memory |
/v1/x/models/{model_id}/unload |
POST | Manually unload a model to free RAM/VRAM (?force=true supported) |
/v1/x/files |
POST / GET | Upload audio/video (supports MD5 instant dedup) or list files |
/v1/x/files/{file_id} |
GET / DELETE | Get or delete an uploaded file asset |
/v1/x/audio/transcriptions |
POST / GET | Create or list async long-audio transcription tasks (supports up to 2GB) |
/v1/x/audio/transcriptions/{task_id} |
GET / DELETE | Query async task status/result or cancel a task |
/v1/x/audio/transcriptions/{task_id}/stream |
GET | Subscribe to SSE progress & segment stream of an async task |
/v1/x/media |
POST / GET | Submit URL parsing & background download task (yt-dlp) or list tasks |
/v1/x/media/{task_id} |
GET / DELETE | Query media download task status or delete task & files |
/v1/x/media/{task_id}/file |
GET | Download parsed media file asset |
/v1/x/realtime?api_key= |
WebSocket | Extended real-time streaming with sentence-level events & timestamps |
/v1/x/info |
GET | Query server configuration & system status |
const ws = new WebSocket("ws://localhost:8020/v1/realtime?api_key=sk-oneasr-v1-p_L3kXm9QZ8sT2vA4wE7rY1u");
ws.onopen = () => {
ws.send(JSON.stringify({
type: "session.update",
session: {
type: "transcription",
audio: {
input: {
format: { type: "audio/pcm", rate: 16000 },
transcription: { model: "xasr", language: "en" },
},
},
},
}));
};- Model Management (
cli/model.py):uv run python -m cli.model list uv run python -m cli.model pull uv run python -m cli.model check
- Media Clipping (
cli/clip.py):uv run python cli/clip.py input_video.mp4 120
- Realtime Stream Simulator (
cli/stream_simulation_client.py):uv run python -m cli.stream_simulation_client tests/fixtures/media/en_speech_15s.wav --model xasr
OneASR uses a 3-tier test pyramid (unit, api, integration) with isolated test SQLite database (oneasr_test.db) and built-in 100% Public Domain English audio/video fixtures in tests/fixtures/media/.
# 1. Run fast unit + API contract tests (~1.6s, no real model weights required)
uv run pytest -m "not integration" -v
# 2. Run unit tests only
uv run pytest tests/unit/ -v
# 3. Run API & WebSocket contract tests only
uv run pytest tests/api/ -v
# 4. Run real-model & end-to-end integration tests (loads real xasr, faster-whisper, qwen)
uv run pytest tests/integration/ -v -stests/
βββ conftest.py # Global test setup (ONEASR_TESTING=1, shared fixtures)
βββ fixtures/
β βββ media/ # Built-in 100% Public Domain speech & video fixtures
β βββ en_speech_15s.wav # 15s 16kHz PCM WAV speech sample
β βββ en_speech_120s.mp3 # 120s long speech MP3 for VAD chunking
β βββ en_video_60s.mp4 # 60s H.264+AAC MP4 video sample
β βββ README.md # Public Domain license & Ground Truth transcript
βββ helpers/
β βββ audio_factory.py # In-memory WAV/PCM synthesizer & fixture loader
β βββ mock_engines.py # Standardized mock ASR engines & stream sessions
βββ unit/ # Tier 1: Fast isolated unit tests
β βββ engines/ # Engine & VAD toolkit unit tests
β βββ utils/ # Audio converter, formatting, subtitles, URL parsers
β βββ cli/ # Model CLI downloader & shard verification tests
βββ api/ # Tier 2: FastAPI & WebSocket contract tests
β βββ standard/ # OpenAI standard contract tests (/v1/*)
β β βββ test_audio.py # /v1/audio/transcriptions (sync + SSE stream)
β β βββ test_models.py # /v1/models contract tests
β β βββ test_realtime.py # /v1/realtime WebSocket contract tests
β βββ x/ # OneASR extended contract tests (/v1/x/*)
β β βββ test_audio.py # /v1/x/audio/transcriptions & SSE stream tests
β β βββ test_files.py # /v1/x/files upload, dedup & CRUD tests
β β βββ test_info.py # /v1/x/info version & health tests
β β βββ test_media.py # /v1/x/media parse & download tests
β β βββ test_models.py # /v1/x/models load/unload & capabilities tests
β β βββ test_realtime.py # /v1/x/realtime extended WebSocket tests
β βββ test_error_format.py # Unified OpenAI-compatible error schema tests
βββ integration/ # Tier 3: Real-model & E2E integration tests
βββ conftest.py # Session-scoped real media fixtures
βββ test_local_engines.py # Real xasr, faster-whisper & Qwen3-ASR inference benchmarks
βββ test_e2e_api.py # Unmocked REST + WebSocket end-to-end tests
βββ test_cloud_engines.py # Cloud ASR provider tests (OpenAI)
OneASR/
βββ server/ # Core FastAPI backend application
β βββ main.py # FastAPI entry point, lifespan & idle model reaper
β βββ api/ # Dual-layer REST & WebSocket route controllers
β β βββ auth.py # Bearer / X-API-Key authentication
β β βββ standard/ # OpenAI standard layer (/v1/*)
β β β βββ audio.py # POST /v1/audio/transcriptions
β β β βββ models.py # GET /v1/models, GET /v1/models/{model_id}
β β β βββ realtime.py # WS /v1/realtime (OpenAI Realtime protocol)
β β βββ x/ # OneASR extended native layer (/v1/x/*)
β β βββ audio.py # POST /v1/x/audio/transcriptions & SSE stream
β β βββ files.py # POST /v1/x/files RESTful upload, dedup & CRUD
β β βββ info.py # GET /v1/x/info version & status
β β βββ media.py # POST /v1/x/media yt-dlp parsing & download
β β βββ models.py # GET /v1/x/models & lifecycle load/unload
β β βββ realtime.py # WS /v1/x/realtime (sentence events & timestamps)
β βββ core/ # Configuration, exceptions & file storage
β βββ db/ # Async SQLAlchemy session & SQLite management
β β βββ session.py # Session factory & WAL initialization
β β βββ base.py # DeclarativeBase
β β βββ orm_models.py # SQLAlchemy database models
β βββ engines/ # ASR engine adapters & lifecycle registry
β β βββ base.py # ASREngine ABC (validate_config, load, unload)
β β βββ registry.py # ModelManager (keep_alive, LRU, acquire_engine)
β β βββ xasr_engine.py # sherpa-onnx streaming engine
β β βββ whisper_engine.py # faster-whisper engine
β β βββ qwen_engine.py # Qwen3-ASR engine
β β βββ funasr_engine.py # FunASR / Paraformer engine
β β βββ firered_engine.py # FireRedASR engine
β β βββ openai_engine.py # OpenAI cloud ASR engine
β βββ schemas/ # Pydantic request/response schemas
β βββ services/ # Business logic services
β β βββ transcription_service.py # Async task orchestrator, workers & SSE
β β βββ file_service.py # Uploaded file reader & dedup
β β βββ media_service.py # yt-dlp download & background workers
β β βββ record_service.py # Transcription records persistence
β βββ utils/ # High-performance audio & subtitle utilities
βββ cli/ # Command-line utilities & unified `oneasr` CLI
β βββ main.py # Unified CLI entry (`oneasr list/pull/serve/ps/info`)
β βββ model.py # Model download, status & integrity check CLI
β βββ clip.py # Media clipping utility
β βββ converter.py # Audio format converter
β βββ stream_simulation_client.py # WebSocket streaming test client
βββ desktop/ # Native companion desktop app (Vue 3 + Tauri 2.0)
β βββ src/ # Vue 3 dashboard (views, components, i18n, assets)
β βββ src-tauri/ # Tauri 2.0 Rust core (system tray, IPC, bundle)
β βββ vite.config.js # Vite configuration (port 8025)
β βββ build.sh # macOS standalone packaging script
βββ install.sh # One-line headless terminal installer (Ollama pattern)
βββ tests/ # 3-tier automated test suite (unit, api, integration)
βββ docs/ # Architecture & API design documentation
βββ config.yaml # Server, model lifecycle & provider configuration
βββ pyproject.toml # Project metadata, scripts & pytest config
βββ requirements.txt # Python dependencies
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.