Metadata-Version: 2.3
Name: open-asr-server
Version: 0.1.0
Summary: OpenAI-compatible ASR server with pluggable local backends.
Keywords: asr,speech-to-text,openai,fastapi,whisper
Author: codyw912
Author-email: codyw912 <32690983+codyw912@users.noreply.github.com>
License: MIT License
         
         Copyright (c) 2025 codyw912
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Dist: fastapi>=0.110
Requires-Dist: pydantic>=2.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: typer>=0.12
Requires-Dist: uvicorn>=0.29
Requires-Dist: pytest>=7.4 ; extra == 'dev'
Requires-Dist: lightning-whisper-mlx ; python_full_version < '3.12' and extra == 'lightning-whisper'
Requires-Dist: parakeet-mlx ; extra == 'parakeet'
Requires-Dist: mlx-whisper ; python_full_version < '3.12' and extra == 'whisper'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/codyw912/open-asr-server
Project-URL: Repository, https://github.com/codyw912/open-asr-server
Project-URL: Issues, https://github.com/codyw912/open-asr-server/issues
Provides-Extra: dev
Provides-Extra: lightning-whisper
Provides-Extra: parakeet
Provides-Extra: whisper
Description-Content-Type: text/markdown

# Open ASR Server

[![CI](https://github.com/codyw912/open-asr-server/actions/workflows/ci.yml/badge.svg)](https://github.com/codyw912/open-asr-server/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/open-asr-server)](https://pypi.org/project/open-asr-server/)

OpenAI-compatible ASR server with pluggable local transcription backends.

## Install

Base install includes the API server and shared models/formatters:

```bash
uv tool install "open-asr-server"
```

Add backend extras as needed:

```bash
uv tool install "open-asr-server[parakeet]"
uv tool install "open-asr-server[whisper]"
uv tool install "open-asr-server[lightning-whisper]"
```

Note: the Whisper extras currently require Python 3.11 (tiktoken build constraints on 3.12+).

### Whisper troubleshooting

If `uv run --extra whisper` fails on Python 3.12+, use a 3.11 interpreter for now:

```bash
uv run --python 3.11 --extra whisper -- open-asr-server serve --host 127.0.0.1 --port 8000
```

## Run

```bash
uv tool run open-asr-server serve --host 127.0.0.1 --port 8000
```

Environment variables:

- `OPENAI_ASR_SERVER_DEFAULT_MODEL`: default model ID for requests
- `OPENAI_ASR_SERVER_PRELOAD`: comma-separated models to preload at startup

## Backend options

Model IDs determine which backend is used:

- Parakeet MLX: `mlx-community/parakeet-tdt-0.6b-v3` (default) or `parakeet-*`
- MLX Whisper: `whisper-large-v3-turbo` or `mlx-community/whisper-large-v3-turbo`
- Lightning Whisper MLX: `lightning-whisper-distil-large-v3`

## API compatibility

The server implements:

- `POST /v1/audio/transcriptions`
- `GET /v1/models`

Example:

```bash
curl -s -X POST "http://127.0.0.1:8000/v1/audio/transcriptions" \
  -F "file=@audio.wav" \
  -F "model=whisper-large-v3-turbo"
```

## Release

```bash
uv version --bump patch
uv run --extra dev pytest
uv build --no-sources
uv publish --index testpypi --token "$UV_PUBLISH_TOKEN"
uv publish --token "$UV_PUBLISH_TOKEN"
```
