Sprach-Agent mit Whisper und Kokoro ueber eine OpenAI-kompatible API bauen
Ein Voice Agent wandelt Sprache in Sprache um: Er transkribiert die Nutzereingabe, uebergibt den Text an ein Language Model und gibt die Antwort gesprochen zurueck. Auf EcoHash lassen sich alle drei Stufen ueber eine einzige OpenAI-kompatible API und einen Key realisieren.

Ein Voice-Agent wandelt Sprache in Sprache um: Er transkribiert, was der Nutzer sagt, sendet den Text an ein Sprachmodell und spricht die Antwort zurück. Auf EcoHash baut man alle drei Stufen über eine einzige OpenAI-kompatible API und einen einzigen Schlüssel, sodass man nicht drei Anbieter und drei Abrechnungskonten miteinander verknüpfen muss. Whisper ( whisper-large-v3-turbo ) übernimmt die Sprache-zu-Text-Erkennung, ein Chat-Modell wie llama-3.1-8b-instruct verfasst die Antwort, und Kokoro ( kokoro-82m ) wandelt sie in Audio um. Keines davon benötigt eine eigene GPU, da die Modelle für einen gehostet bereitgestellt werden. Dieser Beitrag führt durch die Pipeline, die drei API-Aufrufe und zeigt, wann sich ein RTX Pro 6000 Workspace für anspruchsvollere Sprachaufgaben lohnt.
Drei API-Aufrufe, ein Schlüssel. Whisper hört, ein Chat-Modell denkt, Kokoro spricht. Etwa 0,006 Dollar pro Minute generierter Sprache.
Die Schleife besteht aus drei Stufen, und jede ist einem EcoHash-Endpunkt zugeordnet:
Danach wiederholt man den Ablauf für den nächsten Zug. Die gesamte Schleife nutzt einen Schlüssel und eine Basis-URL, sodass sich die drei Stufen Authentifizierung, Abrechnung und SDK teilen.
Verwende für die LLM-Stufe ein kleines oder mittelgroßes Chat-Modell, damit die Antworten schnell zurückkommen. Ein auf Programmierung spezialisiertes Modell ist für allgemeine Konversation die falsche Wahl.
Hier ist, was die Sprachmodelle auf einer einzelnen RTX Pro 6000 leisten, vollständig gemessen im Juli 2026. Sprache zu Text:
Auf dem HF Open ASR Leaderboard landen die von EcoHash gehosteten Modelle unter den genauesten (violett = auf EcoHash gehostet):
Vollständige Daten und Methodik: ecohash-benchmarks.
Die API ist OpenAI-kompatibel, sodass das OpenAI SDK funktioniert, sobald man Basis-URL und Schlüssel setzt. Ein einziger Client deckt alle drei Stufen ab.
from openai import OpenAI client = OpenAI ( base_url = " https://api.ecohash.com/v1 ", api_key = " eco_... ", # create a key at console.ecohash.com ) # 1. Speech to text with open ( " input.wav ", " rb " ) as f: transcript = client. audio. transcriptions. create ( model = " whisper-large-v3-turbo ", file = f, ). text # 2.
LLM-Antwort reply = client. chat. completions. create ( model = " llama-3.1-8b-instruct ", messages = [ { " role ": " system ", " content ": " You are a concise voice assistant. Keep replies short. " }, { " role ": " user ", " content ": transcript }, ], ). choices [ 0 ]. message. content # 3.
Text zu Sprache mit client. audio. speech. with_streaming_response. create ( model = " kokoro-82m ", voice = " af_heart ", input = reply, response_format = " wav ", ) as speech: speech. stream_to_file ( " reply.wav " ) print ( " You said: ", transcript ) print ( " Assistant: ", reply ) Enter fullscreen mode Exit fullscreen mode Das ist ein vollständiger Single-Turn-Voice-Agent. Für mehrere Gesprächsrunden behält man den Nachrichtenverlauf bei und durchläuft die Schleife für jede neue Audioeingabe erneut.
Man braucht keine. Alle drei Modelle werden über die API bereitgestellt, sodass man einen Voice-Agenten bauen und betreiben kann, ohne Hardware bereitzustellen, und Kokoro ist insbesondere klein genug, dass es niemals eine RTX Pro 6000 benötigt.
Ein Workspace hilft später, nicht am Anfang: wenn man eine aufwendigere Sprache-zu-Text-, LLM- und Text-zu-Sprache-Pipeline auf einer Karte bündeln, einen höheren Durchsatz erreichen oder einen eigenen Serving-Stack betreiben will. Das ist eine Skalierungsentscheidung. Siehe /gpu-compute.
Was ist ein Voice-Agent? Ein System, das zuhört, denkt und spricht: Sprache zu Text, dann ein LLM, dann Text zu Sprache. Der Nutzer spricht, und der Agent antwortet per Audio.
Welche Modelle brauche ich? Drei: ein Sprache-zu-Text-Modell wie whisper-large-v3-turbo, ein Chat-Modell wie llama-3.1-8b-instruct und ein Text-zu-Sprache-Modell wie kokoro-82m.
Geht das alles mit einem API-Schlüssel? Ja. Auf EcoHash teilen sich die Transkriptions-, Chat- und Sprach-Endpunkte eine Basis-URL und einen Schlüssel, sodass es keine Integration über drei Anbieter hinweg gibt.
Brauche ich eine RTX Pro 6000, um Kokoro oder Whisper zu betreiben? Nein. Beide laufen über die API. Ein Workspace ist optional, um eine aufwendigere Pipeline zu bündeln oder einen höheren Durchsatz zu erreichen.
Ist es schnell genug für Konversation in Echtzeit? Das hängt von deinem Netzwerk, der Modellwahl, Streaming und der Pipeline ab. Dieser Beitrag veröffentlicht keine Latenzwerte; miss dein eigenes Setup, bevor du dich auf ein Ziel verlässt.
Welche Stimmen unterstützt Kokoro? Mehrere; das Beispiel verwendet af_heart. Siehe /models/kokoro-82m.
Was kostet ein Voice-Agent? Die LLM-Stufe wird pro Token abgerechnet, die Audio-Stufen nach dem, was sie verarbeiten. Aktuelle Preise siehe /pricing.
Welches Chat-Modell sollte ich für die LLM-Stufe verwenden? Ein kleines oder mittelgroßes Allzweckmodell hält die Antworten schnell. Siehe Best models to run on RTX Pro 6000 96GB.
Einige Kommentare sind möglicherweise nur für angemeldete Besucher sichtbar. Melde dich an, um alle Kommentare zu sehen.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
A voice agent turns speech into speech: it transcribes what the user says, sends the text to a language model, and speaks the reply back. On EcoHash you build all three stages through one OpenAI-compatible API and one key, so there are no three vendors and no three billing accounts to stitch together. Whisper ( whisper-large-v3-turbo ) does speech to text, a chat model such as llama-3.1-8b-instruct writes the reply, and Kokoro ( kokoro-82m ) turns it into audio. None of it needs a GPU of your own, since the models are served for you. This post walks through the pipeline, the three API calls, and when an RTX Pro 6000 workspace is worth it for heavier voice work.
Three API calls, one key. Whisper hears, a chat model thinks, Kokoro speaks. About $0.006 per minute of generated speech.
The loop has three stages, and each maps to one EcoHash endpoint:
Then you repeat for the next turn. The whole loop uses one key and one base URL, so the three stages share auth, billing, and SDK.
Use a small or mid-size chat model for the LLM stage so replies come back fast. A coding-specialized model is the wrong pick for general conversation.
Here is what the speech models measure on a single RTX Pro 6000, end-to-end, in July 2026. Speech to text:
On the HF Open ASR Leaderboard, the models EcoHash serves land among the accurate ones (purple = served on EcoHash):
Full data and method: ecohash-benchmarks.
The API is OpenAI-compatible, so the OpenAI SDK works once you set the base URL and key. One client covers all three stages.
from openai import OpenAI client = OpenAI ( base_url = " https://api.ecohash.com/v1 ", api_key = " eco_... ", # create a key at console.ecohash.com ) # 1. Speech to text with open ( " input.wav ", " rb " ) as f: transcript = client. audio. transcriptions. create ( model = " whisper-large-v3-turbo ", file = f, ). text # 2.
LLM reply reply = client. chat. completions. create ( model = " llama-3.1-8b-instruct ", messages = [ { " role ": " system ", " content ": " You are a concise voice assistant. Keep replies short. " }, { " role ": " user ", " content ": transcript }, ], ). choices [ 0 ]. message. content # 3.
Text to speech with client. audio. speech. with_streaming_response. create ( model = " kokoro-82m ", voice = " af_heart ", input = reply, response_format = " wav ", ) as speech: speech. stream_to_file ( " reply.wav " ) print ( " You said: ", transcript ) print ( " Assistant: ", reply ) Enter fullscreen mode Exit fullscreen mode That is a full single-turn voice agent. For multi-turn, keep the message history and run the loop again for each new audio input.
You do not need one. All three models are served through the API, so you can build and run a voice agent with no hardware to provision, and Kokoro in particular is small enough that it never needs an RTX Pro 6000.
A workspace helps later, not at the start: when you want to co-locate a heavier speech-to-text, LLM, and text-to-speech pipeline on one card, push higher throughput, or run your own serving stack. That is a scaling choice. See /gpu-compute.
What is a voice agent? A system that listens, thinks, and speaks: speech to text, then an LLM, then text to speech. The user talks, and the agent replies in audio.
Which models do I need? Three: a speech-to-text model like whisper-large-v3-turbo, a chat model like llama-3.1-8b-instruct, and a text-to-speech model like kokoro-82m.
Can I do all of it with one API key? Yes. On EcoHash the transcription, chat, and speech endpoints share one base URL and one key, so there is no three-vendor integration.
Do I need an RTX Pro 6000 to run Kokoro or Whisper? No. Both run through the API. A workspace is optional, for co-locating a heavier pipeline or higher throughput.
Is it fast enough for real-time conversation? That depends on your network, model choices, streaming, and pipeline. This post does not publish latency numbers; measure your own setup before relying on a target.
Which voices does Kokoro support? Several; the example uses af_heart. See /models/kokoro-82m.
How much does a voice agent cost? The LLM stage is billed per token, and the audio stages by what they process. See /pricing for current rates.
Which chat model should I use for the LLM stage? A small or mid-size general model keeps replies quick. See Best models to run on RTX Pro 6000 96GB.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.