A full-featured microservice for audio-to-text transcription based on whisper.cpp. The architecture consists of a REST API for receiving files and a worker for asynchronous task queue processing through RabbitMQ.
- ποΈ Multi-format support: OGG, MP3, WAV, WebM, M4A
- π¦ Asynchronous processing: RabbitMQ integration for scalability
- π REST API: Simple-to-use interface for uploading and retrieving results
- π³ Docker & Kubernetes: Ready-to-use configs for containerization and orchestration
- π Scalability: Modular architecture β multiple workers can process tasks in parallel
The project is organized as a Rust monorepo:
βββ api/ # REST API service (Actix-web)
βββ worker/ # Worker for RabbitMQ queue processing
βββ shared/ # Common types and utilities
βββ k8s/ # Kubernetes manifests
- API receives an audio file and query parameters (
chat_id, optionallymessage_id) - File is saved to disk, a message is created in the RabbitMQ queue
- Worker receives the message, runs transcription via
whisper-cli - Result is saved as a JSON file
- Client retrieves the result via
/result/{task_id}endpoint
- Rust 1.70+ (or use Docker)
- RabbitMQ 3.8+ (for queue processing)
- whisper.cpp (must be available in PATH as
whisper-cli) - Optional: Docker & Docker Compose for containerization
-
Clone the repository:
git clone https://github.com/yourusername/Extera-V2T-Server.git cd Extera-V2T-Server -
Prepare environment variables:
cp .env.example .env # Edit .env if necessary -
Ensure RabbitMQ is running:
# Locally on localhost:5672 or set RABBITMQ_HOST in .env -
Run the API:
cargo run -p api
API will be available at
http://localhost:3000 -
In a separate terminal, run the worker:
cargo run -p worker
-
Start everything with one command:
docker-compose up
This will start:
- RabbitMQ (localhost:5672)
- API service (localhost:3000)
- Worker (background process)
-
Stop:
docker-compose down
-
Apply manifests:
kubectl apply -f k8s/
-
Check status:
kubectl get pods kubectl get svc
Detailed documentation is available in API.md
Upload a file for transcription:
curl -X POST "http://localhost:3000/transcribe?chat_id=12345" \
-F "file=@audio.ogg"Response:
{
"task_id": "4d1db26d-2d4e-4f3a-96e5-4f3183592161",
"status": "queued",
"file_path": "/tmp/transcribe/4d1db26d-2d4e-4f3a-96e5-4f3183592161_audio.ogg"
}Get transcription result:
curl -X GET "http://localhost:3000/result/4d1db26d-2d4e-4f3a-96e5-4f3183592161"Response:
{
"transcription": [
{
"timestamps": {"from": "00:00:00,000", "to": "00:00:02,000"},
"offsets": {"from": 0, "to": 2000},
"text": " Hello, this is a test recording."
}
]
}Check service status:
curl -X GET "http://localhost:3000/health"# RabbitMQ credentials
RABBITMQ_USER=root
RABBITMQ_PASS=<your_password>
# Optional (if RabbitMQ is not on localhost)
RABBITMQ_HOST=rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_VHOST=/
# API config
API_HOST=0.0.0.0
API_PORT=3000
# File paths
UPLOAD_DIR=/tmp/transcribe
RESULTS_DIR=/tmp/transcribe/results- Max upload size: 500 MB
- Supported formats: OGG, MP3, WAV, WebM, M4A
- Queue: RabbitMQ with queue
transcribe_tasks - Results storage: JSON files in the
RESULTS_DIRdirectory
shared/β common types, errors, configapi/β HTTP layer, request handlingworker/β RabbitMQ consumer, whisper.cpp integration
cargo testcargo fmt
cargo clippydocker build -t extera-v2t-server .
docker run -p 3000:3000 --env-file .env extera-v2t-serverFor production use:
- Kubernetes for orchestration (see
k8s/) - RabbitMQ cluster for high availability
- Configure worker scaling based on load
- Use persistent volumes for file storage
- Set up healthchecks and monitoring
Ensure RabbitMQ is running and accessible at the address from RABBITMQ_HOST
Check credentials in .env
Install whisper.cpp: https://github.com/ggerganov/whisper.cpp
Ensure whisper-cli is available in PATH
Check worker logs: docker-compose logs worker
Ensure whisper.cpp can process the audio file
MIT
Pull requests are welcome. For significant changes, please open an issue first.
If you find a bug or have questions, please open an issue on GitHub.