paratran 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paratran-0.1.0/LICENSE +21 -0
- paratran-0.1.0/PKG-INFO +134 -0
- paratran-0.1.0/README.md +111 -0
- paratran-0.1.0/paratran/__init__.py +3 -0
- paratran-0.1.0/paratran/cli.py +20 -0
- paratran-0.1.0/paratran/server.py +77 -0
- paratran-0.1.0/paratran.egg-info/PKG-INFO +134 -0
- paratran-0.1.0/paratran.egg-info/SOURCES.txt +12 -0
- paratran-0.1.0/paratran.egg-info/dependency_links.txt +1 -0
- paratran-0.1.0/paratran.egg-info/entry_points.txt +2 -0
- paratran-0.1.0/paratran.egg-info/requires.txt +4 -0
- paratran-0.1.0/paratran.egg-info/top_level.txt +1 -0
- paratran-0.1.0/pyproject.toml +33 -0
- paratran-0.1.0/setup.cfg +4 -0
paratran-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Brian Sunter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
paratran-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paratran
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: REST API for audio transcription using parakeet-mlx
|
|
5
|
+
Author: Brian Sunter
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/briansunter/paratran
|
|
8
|
+
Project-URL: Repository, https://github.com/briansunter/paratran
|
|
9
|
+
Keywords: transcription,asr,speech-to-text,mlx,apple-silicon
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: parakeet-mlx
|
|
19
|
+
Requires-Dist: fastapi
|
|
20
|
+
Requires-Dist: uvicorn[standard]
|
|
21
|
+
Requires-Dist: python-multipart
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# Paratran
|
|
25
|
+
|
|
26
|
+
REST API for audio transcription on Apple Silicon, powered by [parakeet-mlx](https://github.com/senstella/parakeet-mlx).
|
|
27
|
+
|
|
28
|
+
Parakeet is #1 on the [Open ASR Leaderboard](https://huggingface.co/spaces/hf-audio/open_asr_leaderboard) and runs ~30x faster than Whisper on Apple Silicon via MLX.
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- macOS with Apple Silicon (M1/M2/M3/M4)
|
|
33
|
+
- Python 3.11+
|
|
34
|
+
- ~2 GB memory for the default model
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git clone https://github.com/briansunter/paratran.git
|
|
40
|
+
cd paratran
|
|
41
|
+
./run.sh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This creates a virtual environment, installs dependencies, downloads the model, and starts the server at `http://localhost:8000`.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install paratran
|
|
50
|
+
paratran
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or from source:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python3 -m venv .venv
|
|
57
|
+
source .venv/bin/activate
|
|
58
|
+
pip install -e .
|
|
59
|
+
paratran
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Default settings
|
|
66
|
+
paratran
|
|
67
|
+
|
|
68
|
+
# Custom model cache location
|
|
69
|
+
paratran --model-dir /Volumes/Storage/models
|
|
70
|
+
|
|
71
|
+
# Custom host and port
|
|
72
|
+
paratran --host 127.0.0.1 --port 9000
|
|
73
|
+
|
|
74
|
+
# Different model
|
|
75
|
+
paratran --model mlx-community/parakeet-tdt-1.1b-v2
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
All options can also be set via environment variables:
|
|
79
|
+
|
|
80
|
+
| CLI Flag | Env Var | Default |
|
|
81
|
+
|----------------|----------------------|------------------------------------------|
|
|
82
|
+
| `--model` | `PARATRAN_MODEL` | `mlx-community/parakeet-tdt-0.6b-v3` |
|
|
83
|
+
| `--model-dir` | `PARATRAN_MODEL_DIR` | HuggingFace default (`~/.cache/huggingface`) |
|
|
84
|
+
| `--host` | | `0.0.0.0` |
|
|
85
|
+
| `--port` | | `8000` |
|
|
86
|
+
|
|
87
|
+
## API
|
|
88
|
+
|
|
89
|
+
### `GET /health`
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
curl http://localhost:8000/health
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"status": "ok",
|
|
98
|
+
"model": "mlx-community/parakeet-tdt-0.6b-v3",
|
|
99
|
+
"model_dir": "/Volumes/Storage/models"
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### `POST /transcribe`
|
|
104
|
+
|
|
105
|
+
Upload an audio file (wav, mp3, flac, m4a, ogg, webm):
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
curl -X POST http://localhost:8000/transcribe -F "file=@recording.m4a"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"text": "Hello world, this is a test.",
|
|
114
|
+
"duration": 3.52,
|
|
115
|
+
"processing_time": 0.176,
|
|
116
|
+
"sentences": [
|
|
117
|
+
{
|
|
118
|
+
"text": "Hello world, this is a test.",
|
|
119
|
+
"start": 0.0,
|
|
120
|
+
"end": 3.52,
|
|
121
|
+
"tokens": [
|
|
122
|
+
{ "text": "Hello", "start": 0.0, "end": 0.48 },
|
|
123
|
+
{ "text": " world", "start": 0.48, "end": 0.8 }
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Interactive API docs are available at `http://localhost:8000/docs`.
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
paratran-0.1.0/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Paratran
|
|
2
|
+
|
|
3
|
+
REST API for audio transcription on Apple Silicon, powered by [parakeet-mlx](https://github.com/senstella/parakeet-mlx).
|
|
4
|
+
|
|
5
|
+
Parakeet is #1 on the [Open ASR Leaderboard](https://huggingface.co/spaces/hf-audio/open_asr_leaderboard) and runs ~30x faster than Whisper on Apple Silicon via MLX.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- macOS with Apple Silicon (M1/M2/M3/M4)
|
|
10
|
+
- Python 3.11+
|
|
11
|
+
- ~2 GB memory for the default model
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://github.com/briansunter/paratran.git
|
|
17
|
+
cd paratran
|
|
18
|
+
./run.sh
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This creates a virtual environment, installs dependencies, downloads the model, and starts the server at `http://localhost:8000`.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install paratran
|
|
27
|
+
paratran
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or from source:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python3 -m venv .venv
|
|
34
|
+
source .venv/bin/activate
|
|
35
|
+
pip install -e .
|
|
36
|
+
paratran
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Default settings
|
|
43
|
+
paratran
|
|
44
|
+
|
|
45
|
+
# Custom model cache location
|
|
46
|
+
paratran --model-dir /Volumes/Storage/models
|
|
47
|
+
|
|
48
|
+
# Custom host and port
|
|
49
|
+
paratran --host 127.0.0.1 --port 9000
|
|
50
|
+
|
|
51
|
+
# Different model
|
|
52
|
+
paratran --model mlx-community/parakeet-tdt-1.1b-v2
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
All options can also be set via environment variables:
|
|
56
|
+
|
|
57
|
+
| CLI Flag | Env Var | Default |
|
|
58
|
+
|----------------|----------------------|------------------------------------------|
|
|
59
|
+
| `--model` | `PARATRAN_MODEL` | `mlx-community/parakeet-tdt-0.6b-v3` |
|
|
60
|
+
| `--model-dir` | `PARATRAN_MODEL_DIR` | HuggingFace default (`~/.cache/huggingface`) |
|
|
61
|
+
| `--host` | | `0.0.0.0` |
|
|
62
|
+
| `--port` | | `8000` |
|
|
63
|
+
|
|
64
|
+
## API
|
|
65
|
+
|
|
66
|
+
### `GET /health`
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
curl http://localhost:8000/health
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"status": "ok",
|
|
75
|
+
"model": "mlx-community/parakeet-tdt-0.6b-v3",
|
|
76
|
+
"model_dir": "/Volumes/Storage/models"
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `POST /transcribe`
|
|
81
|
+
|
|
82
|
+
Upload an audio file (wav, mp3, flac, m4a, ogg, webm):
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
curl -X POST http://localhost:8000/transcribe -F "file=@recording.m4a"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"text": "Hello world, this is a test.",
|
|
91
|
+
"duration": 3.52,
|
|
92
|
+
"processing_time": 0.176,
|
|
93
|
+
"sentences": [
|
|
94
|
+
{
|
|
95
|
+
"text": "Hello world, this is a test.",
|
|
96
|
+
"start": 0.0,
|
|
97
|
+
"end": 3.52,
|
|
98
|
+
"tokens": [
|
|
99
|
+
{ "text": "Hello", "start": 0.0, "end": 0.48 },
|
|
100
|
+
{ "text": " world", "start": 0.48, "end": 0.8 }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Interactive API docs are available at `http://localhost:8000/docs`.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from paratran.server import DEFAULT_MODEL, MODEL_DIR, MODEL_NAME
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
from paratran import server
|
|
8
|
+
|
|
9
|
+
parser = argparse.ArgumentParser(description="Paratran transcription server")
|
|
10
|
+
parser.add_argument("--model", default=MODEL_NAME, help=f"HF model ID or local path (default: {DEFAULT_MODEL})")
|
|
11
|
+
parser.add_argument("--model-dir", default=MODEL_DIR, help="Directory to download/cache models")
|
|
12
|
+
parser.add_argument("--host", default="0.0.0.0", help="Bind host (default: 0.0.0.0)")
|
|
13
|
+
parser.add_argument("--port", type=int, default=8000, help="Bind port (default: 8000)")
|
|
14
|
+
args = parser.parse_args()
|
|
15
|
+
|
|
16
|
+
server.MODEL_NAME = args.model
|
|
17
|
+
server.MODEL_DIR = args.model_dir
|
|
18
|
+
|
|
19
|
+
import uvicorn
|
|
20
|
+
uvicorn.run(server.app, host=args.host, port=args.port)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import tempfile
|
|
3
|
+
import time
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import parakeet_mlx
|
|
7
|
+
from fastapi import FastAPI, File, UploadFile
|
|
8
|
+
from fastapi.responses import JSONResponse
|
|
9
|
+
|
|
10
|
+
DEFAULT_MODEL = "mlx-community/parakeet-tdt-0.6b-v3"
|
|
11
|
+
MODEL_NAME = os.environ.get("PARATRAN_MODEL", DEFAULT_MODEL)
|
|
12
|
+
MODEL_DIR = os.environ.get("PARATRAN_MODEL_DIR", None)
|
|
13
|
+
ALLOWED_EXTENSIONS = {".wav", ".mp3", ".flac", ".m4a", ".ogg", ".webm"}
|
|
14
|
+
|
|
15
|
+
app = FastAPI(title="Paratran", description="Audio transcription API powered by parakeet-mlx")
|
|
16
|
+
model = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@app.on_event("startup")
|
|
20
|
+
def load_model():
|
|
21
|
+
global model
|
|
22
|
+
kwargs = {}
|
|
23
|
+
if MODEL_DIR:
|
|
24
|
+
kwargs["cache_dir"] = MODEL_DIR
|
|
25
|
+
model = parakeet_mlx.from_pretrained(MODEL_NAME, **kwargs)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@app.get("/health")
|
|
29
|
+
def health():
|
|
30
|
+
return {"status": "ok", "model": MODEL_NAME, "model_dir": MODEL_DIR}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@app.post("/transcribe")
|
|
34
|
+
async def transcribe(
|
|
35
|
+
file: UploadFile = File(...),
|
|
36
|
+
):
|
|
37
|
+
suffix = Path(file.filename).suffix.lower() if file.filename else ""
|
|
38
|
+
if suffix not in ALLOWED_EXTENSIONS:
|
|
39
|
+
return JSONResponse(
|
|
40
|
+
status_code=400,
|
|
41
|
+
content={"error": f"Unsupported file type '{suffix}'. Allowed: {', '.join(sorted(ALLOWED_EXTENSIONS))}"},
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
tmp = None
|
|
45
|
+
try:
|
|
46
|
+
tmp = tempfile.NamedTemporaryFile(suffix=suffix, delete=False)
|
|
47
|
+
tmp.write(await file.read())
|
|
48
|
+
tmp.close()
|
|
49
|
+
|
|
50
|
+
start = time.perf_counter()
|
|
51
|
+
result = model.transcribe(tmp.name)
|
|
52
|
+
elapsed = time.perf_counter() - start
|
|
53
|
+
|
|
54
|
+
sentences = []
|
|
55
|
+
for seg in result.sentences:
|
|
56
|
+
tokens = [
|
|
57
|
+
{"text": t.text, "start": t.start, "end": t.end}
|
|
58
|
+
for t in seg.tokens
|
|
59
|
+
]
|
|
60
|
+
sentences.append({
|
|
61
|
+
"text": seg.text,
|
|
62
|
+
"start": seg.start,
|
|
63
|
+
"end": seg.end,
|
|
64
|
+
"tokens": tokens,
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
duration = result.sentences[-1].end if result.sentences else 0.0
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
"text": result.text,
|
|
71
|
+
"duration": duration,
|
|
72
|
+
"processing_time": round(elapsed, 3),
|
|
73
|
+
"sentences": sentences,
|
|
74
|
+
}
|
|
75
|
+
finally:
|
|
76
|
+
if tmp:
|
|
77
|
+
Path(tmp.name).unlink(missing_ok=True)
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paratran
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: REST API for audio transcription using parakeet-mlx
|
|
5
|
+
Author: Brian Sunter
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/briansunter/paratran
|
|
8
|
+
Project-URL: Repository, https://github.com/briansunter/paratran
|
|
9
|
+
Keywords: transcription,asr,speech-to-text,mlx,apple-silicon
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: parakeet-mlx
|
|
19
|
+
Requires-Dist: fastapi
|
|
20
|
+
Requires-Dist: uvicorn[standard]
|
|
21
|
+
Requires-Dist: python-multipart
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# Paratran
|
|
25
|
+
|
|
26
|
+
REST API for audio transcription on Apple Silicon, powered by [parakeet-mlx](https://github.com/senstella/parakeet-mlx).
|
|
27
|
+
|
|
28
|
+
Parakeet is #1 on the [Open ASR Leaderboard](https://huggingface.co/spaces/hf-audio/open_asr_leaderboard) and runs ~30x faster than Whisper on Apple Silicon via MLX.
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- macOS with Apple Silicon (M1/M2/M3/M4)
|
|
33
|
+
- Python 3.11+
|
|
34
|
+
- ~2 GB memory for the default model
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git clone https://github.com/briansunter/paratran.git
|
|
40
|
+
cd paratran
|
|
41
|
+
./run.sh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This creates a virtual environment, installs dependencies, downloads the model, and starts the server at `http://localhost:8000`.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install paratran
|
|
50
|
+
paratran
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or from source:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python3 -m venv .venv
|
|
57
|
+
source .venv/bin/activate
|
|
58
|
+
pip install -e .
|
|
59
|
+
paratran
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Default settings
|
|
66
|
+
paratran
|
|
67
|
+
|
|
68
|
+
# Custom model cache location
|
|
69
|
+
paratran --model-dir /Volumes/Storage/models
|
|
70
|
+
|
|
71
|
+
# Custom host and port
|
|
72
|
+
paratran --host 127.0.0.1 --port 9000
|
|
73
|
+
|
|
74
|
+
# Different model
|
|
75
|
+
paratran --model mlx-community/parakeet-tdt-1.1b-v2
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
All options can also be set via environment variables:
|
|
79
|
+
|
|
80
|
+
| CLI Flag | Env Var | Default |
|
|
81
|
+
|----------------|----------------------|------------------------------------------|
|
|
82
|
+
| `--model` | `PARATRAN_MODEL` | `mlx-community/parakeet-tdt-0.6b-v3` |
|
|
83
|
+
| `--model-dir` | `PARATRAN_MODEL_DIR` | HuggingFace default (`~/.cache/huggingface`) |
|
|
84
|
+
| `--host` | | `0.0.0.0` |
|
|
85
|
+
| `--port` | | `8000` |
|
|
86
|
+
|
|
87
|
+
## API
|
|
88
|
+
|
|
89
|
+
### `GET /health`
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
curl http://localhost:8000/health
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"status": "ok",
|
|
98
|
+
"model": "mlx-community/parakeet-tdt-0.6b-v3",
|
|
99
|
+
"model_dir": "/Volumes/Storage/models"
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### `POST /transcribe`
|
|
104
|
+
|
|
105
|
+
Upload an audio file (wav, mp3, flac, m4a, ogg, webm):
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
curl -X POST http://localhost:8000/transcribe -F "file=@recording.m4a"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"text": "Hello world, this is a test.",
|
|
114
|
+
"duration": 3.52,
|
|
115
|
+
"processing_time": 0.176,
|
|
116
|
+
"sentences": [
|
|
117
|
+
{
|
|
118
|
+
"text": "Hello world, this is a test.",
|
|
119
|
+
"start": 0.0,
|
|
120
|
+
"end": 3.52,
|
|
121
|
+
"tokens": [
|
|
122
|
+
{ "text": "Hello", "start": 0.0, "end": 0.48 },
|
|
123
|
+
{ "text": " world", "start": 0.48, "end": 0.8 }
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Interactive API docs are available at `http://localhost:8000/docs`.
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
paratran/__init__.py
|
|
5
|
+
paratran/cli.py
|
|
6
|
+
paratran/server.py
|
|
7
|
+
paratran.egg-info/PKG-INFO
|
|
8
|
+
paratran.egg-info/SOURCES.txt
|
|
9
|
+
paratran.egg-info/dependency_links.txt
|
|
10
|
+
paratran.egg-info/entry_points.txt
|
|
11
|
+
paratran.egg-info/requires.txt
|
|
12
|
+
paratran.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
paratran
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "paratran"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "REST API for audio transcription using parakeet-mlx"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [{ name = "Brian Sunter" }]
|
|
13
|
+
keywords = ["transcription", "asr", "speech-to-text", "mlx", "apple-silicon"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Operating System :: MacOS",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"parakeet-mlx",
|
|
23
|
+
"fastapi",
|
|
24
|
+
"uvicorn[standard]",
|
|
25
|
+
"python-multipart",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/briansunter/paratran"
|
|
30
|
+
Repository = "https://github.com/briansunter/paratran"
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
paratran = "paratran.cli:main"
|
paratran-0.1.0/setup.cfg
ADDED