# Repository Briefing: jianchang512/stt
> Source: https://repoforai.com/repo/jianchang512/stt (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/jianchang512/stt
- **Official Docs / Website**: https://pyvideotrans.com
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: GPL-3.0
- **Engineering Health**: C (47/100 · Maintenance 6/35 · Adoption 19/25 · Releases 11/20 · License 11/20)
- **Latest Release**: 20250805 (2025-08-05) — https://github.com/jianchang512/stt/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted, Local AI, GPU, API
- **Momentum**: 4,869 ★ total (+2 24h / +7 7d) · 514 forks
- **Topics**: `speech`, `speech-recognition`, `speech-to-text`, `stt`
- **When to Use**: Best for: Individuals and teams transcribing recorded audio or video on their own machines, generating SRT subtitles, or moving a file-based transcription integration off a hosted API. Skip if: You need live streaming, parallel inference with predictable turnaround, or a managed service that removes responsibility for models and GPU runtimes.

## Overview
```text
### Architecture & Core Mechanics
`start.py` launches a local Python web application with a browser upload form and an HTTP API on port 9977. The dependency manifest lists Flask and gevent for the web stack, faster-whisper for speech recognition, and `torch==2.1.2`. Source installs also require FFmpeg. The core flow is file upload, language and model selection, local inference, and conversion of the transcript into plain text, timestamped SRT, or JSON.

Model files can be staged under the project's `models/` directory, and the API selects a model by name. Integrations can use the native multipart endpoint at `/api` or point an OpenAI client at the `/v1` base URL. Release `20250805` replaced multithreaded recognition with a single worker queue: callers can submit requests independently, but should not expect them to run inference in parallel.

### Key Capabilities & Differentiators
The browser UI accepts audio and video by file selection or drag-and-drop and lets users choose the language, model, and output format. The model range includes `tiny`, `base`, `small`, `medium`, and `large-v3`. Release v0.94 added automatic language detection and custom Hugging Face model support, and updated support for `large-v3-turbo`. Native API callers can explicitly specify language codes such as `zh`, `en`, or `ja`.

`POST /api` takes a multipart `file` plus `language`, `model`, and `response_format` fields, returning a `code`/`msg`/`data` envelope. The OpenAI-style interface supports `text`, `srt`, and `json`, but its JSON output represents parsed SRT subtitles. Verify the payload against downstream consumers rather than assuming OpenAI response-schema parity. The interfaces shown are based on file uploads and completed results, not live audio streaming.

### Trade-offs & Limitations
Compared with a managed Whisper API, stt lets you keep recordings and inference on your own infrastructure, but you take responsibility for provisioning, model storage, and runtime compatibility. Compared with using faster-whisper directly, it saves the work of building an upload UI and API, at the cost of adopting its output conventions and queue behavior. A slow job can delay those behind it, so measure end-to-end turnaround under representative concurrent submissions.

Start with a smaller model on CPU and test accuracy, turnaround, and memory on your own recordings before sizing up. The project cautions against `large-v3` below 8 GB of VRAM, especially with larger videos; that is practical caution, not a guaranteed minimum. Chinese transcripts can sometimes contain Traditional characters, so test any script-normalization requirements. GPL-3.0 permits commercial use, but redistribution of covered binaries or modified versions brings source and licensing obligations.

### Hardware & Deployment Guide
On Windows, the prebuilt release can be extracted and launched with `start.exe`; the `20250805` full package is listed at about 1.6 GB. Source installation on Windows, Linux, or macOS uses Python 3.9–3.11, a virtual environment, `requirements.txt`, FFmpeg, and local model files. Run `python start.py` to open the browser UI. Inference can stay offline once dependencies and weights are in place; online model acquisition is a separate step.

CPU is the default in `set.ini`. For an NVIDIA GPU, match the driver, CUDA, cuDNN, and PyTorch build, validate the setup with `testcuda.py`, then set `devtype=cuda` and restart. The source setup includes a CUDA 12.1 PyTorch wheel path, while troubleshooting also mentions other CUDA versions, so validate the combination on the deployment host. Release `20250805` added the `/v1` interface and switched online model downloads to an HF mirror in Chinese-language environments. Keep the default loopback access for single-machine use; review authentication and access controls before exposing the service to other hosts.
```

## Key Capabilities
```text
- Runtime: `start.py` launches the local Python application; faster-whisper handles inference and FFmpeg is a source-install prerequisite.
- Native API: `POST /api` accepts multipart audio or video and wraps results in `code`, `msg`, and `data`.
- SDK compatibility: The `/v1` base URL supports OpenAI-style transcription calls; JSON output represents parsed SRT subtitles.
- Model selection: Whisper variants span `tiny` through `large-v3`; v0.94 updated `large-v3-turbo` support and added custom Hugging Face models.
- Scheduling: Release `20250805` serializes recognition jobs to reduce VRAM pressure from overlapping inference.
- Local deployment: Windows has a packaged build, while source installs target Python 3.9–3.11 with CPU by default and optional NVIDIA CUDA.
```

## Quick Start / Clone
```bash
import requests
    # 请求地址
    url = "http://127.0.0.1:9977/api"
    # 请求参数  file:音视频文件，language：语言代码，model：模型，response_format:text|json|srt
    # 返回 code==0 成功，其他失败，msg==成功为ok，其他失败原因，data=识别后返回文字
    files = {"file": open("C:/Users/c1/Videos/2.wav", "rb")}
    data={"language":"zh","model":"base","response_format":"json"}
    response = requests.request("POST", url, timeout=600, data=data,files=files)
    print(response.json())
```
