[PR #13475] [CLOSED] feat: add whisper.cpp integration for speech-to-text #45472

Closed
opened 2026-04-25 01:10:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13475
Author: @Thorfy
Created: 12/14/2025
Status: Closed

Base: mainHead: feature/whisper-integration


📝 Commits (1)

  • e3585cc feat: add whisper.cpp integration for speech-to-text

📊 Changes

19 files changed (+4908 additions, -1 deletions)

View changed files

BUILD_WHISPER.md (+156 -0)
📝 api/client.go (+68 -0)
📝 api/client_test.go (+205 -0)
api/transcribe.go (+381 -0)
📝 api/types.go (+127 -0)
📝 api/types_test.go (+187 -0)
📝 cmd/cmd.go (+98 -0)
📝 envconfig/config.go (+6 -0)
runner/whisperrunner/runner.go (+403 -0)
📝 server/routes.go (+417 -1)
📝 server/sched.go (+239 -0)
stt/client.go (+316 -0)
stt/server.go (+568 -0)
stt/server_test.go (+326 -0)
whisper/README.md (+336 -0)
whisper/test/main.go (+154 -0)
whisper/whisper.cpp (+1 -0)
whisper/whisper.go (+770 -0)
whisper/whisper_test.go (+150 -0)

📄 Description

This PR adds speech-to-text capabilities to Ollama via whisper.cpp integration, following the same architecture pattern as the existing llama.cpp integration.

Features

  • Audio transcription with multiple output formats (json, text, srt, vtt)
  • Translation to English from 99 supported languages
  • Automatic language detection
  • GPU acceleration support (CUDA, Metal, Vulkan)
  • Streaming transcription support
  • Full scheduler integration with model caching and keep-alive

New API Endpoints

  • POST /api/transcribe - Transcribe audio to text
  • POST /api/translate - Translate audio to English
  • POST /api/detect-language - Detect spoken language
  • GET /api/languages - List supported languages
  • POST /v1/audio/transcriptions - OpenAI-compatible endpoint
  • POST /v1/audio/translations - OpenAI-compatible endpoint

New CLI Command

  • ollama transcribe <audio_file> [options]

Components Added

  • whisper/ - CGo bindings for whisper.cpp
  • stt/ - Speech-to-text server and client

unner/whisperrunner/ - Whisper model runner

  • pi/transcribe.go - Transcription API types

See whisper/README.md for detailed documentation.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13475 **Author:** [@Thorfy](https://github.com/Thorfy) **Created:** 12/14/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/whisper-integration` --- ### 📝 Commits (1) - [`e3585cc`](https://github.com/ollama/ollama/commit/e3585cc005ddae6938afd623ae95650fa89faa0d) feat: add whisper.cpp integration for speech-to-text ### 📊 Changes **19 files changed** (+4908 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `BUILD_WHISPER.md` (+156 -0) 📝 `api/client.go` (+68 -0) 📝 `api/client_test.go` (+205 -0) ➕ `api/transcribe.go` (+381 -0) 📝 `api/types.go` (+127 -0) 📝 `api/types_test.go` (+187 -0) 📝 `cmd/cmd.go` (+98 -0) 📝 `envconfig/config.go` (+6 -0) ➕ `runner/whisperrunner/runner.go` (+403 -0) 📝 `server/routes.go` (+417 -1) 📝 `server/sched.go` (+239 -0) ➕ `stt/client.go` (+316 -0) ➕ `stt/server.go` (+568 -0) ➕ `stt/server_test.go` (+326 -0) ➕ `whisper/README.md` (+336 -0) ➕ `whisper/test/main.go` (+154 -0) ➕ `whisper/whisper.cpp` (+1 -0) ➕ `whisper/whisper.go` (+770 -0) ➕ `whisper/whisper_test.go` (+150 -0) </details> ### 📄 Description This PR adds speech-to-text capabilities to Ollama via whisper.cpp integration, following the same architecture pattern as the existing llama.cpp integration. ## Features - Audio transcription with multiple output formats (json, text, srt, vtt) - Translation to English from 99 supported languages - Automatic language detection - GPU acceleration support (CUDA, Metal, Vulkan) - Streaming transcription support - Full scheduler integration with model caching and keep-alive ## New API Endpoints - POST /api/transcribe - Transcribe audio to text - POST /api/translate - Translate audio to English - POST /api/detect-language - Detect spoken language - GET /api/languages - List supported languages - POST /v1/audio/transcriptions - OpenAI-compatible endpoint - POST /v1/audio/translations - OpenAI-compatible endpoint ## New CLI Command - ollama transcribe <audio_file> [options] ## Components Added - whisper/ - CGo bindings for whisper.cpp - stt/ - Speech-to-text server and client - unner/whisperrunner/ - Whisper model runner - pi/transcribe.go - Transcription API types See whisper/README.md for detailed documentation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 01:10:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#45472