Ollama语言模型
2026年10月24日 (英语).
Ollama现在可以将文本变成语音。 最早的语音模型是Phonon,由来自Gradium的小型,最先进文本转语音模型组成的家族。 现在为macOS提供了语音模型,Windows和Linux的支持很快会到来。
ollama跑出"从Ollama来的你好".
Apple硅的性能
在Apple硅上,Ollama由MLX,Apple的机器学习框架加速,为最先进的吞吐量。 在M5 Max的MacBook Pro上,Ollama比下个最快的引擎Gradium自己的运行时间快了35%.
Ollama的执行同样准确,匹配了Hugging Face变换器中引用执行的单词错误率:
声音
在 API 中选择带有 --voice 或 voice 的声音:
ollama跑出phonon-voice Hadley"从Ollama来的你好".
这些声音来自Gradium的语音目录。 ollama显示phonon列出全部。
语文
phonon在Apache 2.0下为发布。 40M型号为CC BY-NC 4.0下发布,这限制了它们的非商业用途。
大声读取回复
给Phonon输入聊天模式的答复。 文字在到达时会说话,所以在第一句后,回复开始播放:
ollama跑出gemma4——隐想"两句里说猫头鹰的趣事". ollama 运行相声
运行 ollama 运行phonon 时没有文本可以按下行,或重定向输出以保存 WAV 文件:
ollama运行相声"保存此为文件". > 语音.wav
API 密码
Phonon与OpenAI相兼容/v1/audio/speech端点合作,因此使用OpenAI SDK的现有代码只需要一个新的基址。
校对:Soup
-H"Content-Type:应用程序/json"\?
-d '{
"模型":"发音"
"相声":"祖伊".
"输入":"Ollama你好".
\' -输出语音.wav from openai 导入 OpenAI
客户端 = OpenAI(base url="http://localhost:11434/v1", api key="ollama").
与客户端。 adio. speech. with sreaming respace.create( 创建)
模型="光线"
声音="佐伊"
输入="Ollama你好".
响应 format="wav"
作为答复:
响应。 stream to file ("speech.wav") 从"node:fs"导入 fs.
从“ openai” 导入 OpenAI
const openai = 新的 OpenAI ({ baseURL:"http://localhost:11434/v1", apiKey:"ollama" }).
const响应=等 openai.audio.speech.create({
模型:“光子”
声音:"佐伊"
输入:"Ollama你好".
响应格式:“wav”
})
fs.writeFileSync ("speech.wav"), Buffer. from (等待响应。 arrayBuffer ()) 互联网档案馆的存檔,存档日期2013-12-21.
音频生成时的响应流,因此可以立即播放:
卷曲-sN http://localhost:11434/v1/audio/speech\
-H"Content-Type:应用程序/json"\?
-d'{'型号":"phonon","输入":"Playback从马上开始")?
ffplay - nodisp - 自动出局 - log级错误 -
音频为24 kHz mono,默认情况下作为WAV返回,或作为生于16位的样本并带有"reswer format":"pcm".
开始吧
语音模型运行于Apple硅Macs上。 下载 Ollama 0.40.11 或以后,然后拉出 Phonon:
ollama 拉出发光
更多信息见:
本文由 AI宝库自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Speech models in Ollama
October 24, 2026
Ollama can now turn text into speech. The first speech model is Phonon, a family of small, state-of-the-art text-to-speech models from Gradium. Speech models are now available for macOS, with Windows and Linux support coming soon.
ollama run phonon "Hello from Ollama."
Performance on Apple Silicon
On Apple Silicon, Ollama is accelerated by MLX, Apple’s machine learning framework, for state-of-the-art throughput. On a MacBook Pro with M5 Max, Ollama was 35% faster than the next fastest engine, Gradium’s own runtime.
Ollama’s implementation is just as accurate, matching the word error rate of the reference implementation in Hugging Face Transformers:
Voices
Choose a voice with --voice, or voice in the API:
ollama run phonon --voice Hadley "Hello from Ollama."
The voices come from Gradium’s voice catalog. ollama show phonon lists them all.
Languages
phonon is released under Apache 2.0. The 40M models are released under CC BY-NC 4.0, which limits them to noncommercial use.
Read replies aloud
Pipe a chat model’s reply into Phonon. Text is spoken as it arrives, so the reply starts playing after its first sentence:
ollama run gemma4 --hidethinking "Tell me a fun fact about owls in two sentences." | ollama run phonon
Run ollama run phonon with no text to type lines at a prompt, or redirect the output to save a WAV file:
ollama run phonon "Save this to a file." > speech.wav
API
Phonon works with the OpenAI-compatible /v1/audio/speech endpoint, so existing code that uses the OpenAI SDK only needs a new base URL.
curl http://localhost:11434/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "phonon",
"voice": "Zoey",
"input": "Hello from Ollama."
}' --output speech.wavfrom openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
with client.audio.speech.with_streaming_response.create(
model="phonon",
voice="Zoey",
input="Hello from Ollama.",
response_format="wav",
) as response:
response.stream_to_file("speech.wav")import fs from "node:fs"
import OpenAI from "openai"
const openai = new OpenAI({ baseURL: "http://localhost:11434/v1", apiKey: "ollama" })
const response = await openai.audio.speech.create({
model: "phonon",
voice: "Zoey",
input: "Hello from Ollama.",
response_format: "wav",
})
fs.writeFileSync("speech.wav", Buffer.from(await response.arrayBuffer()))
The response streams while the audio is generated, so it can play right away:
curl -sN http://localhost:11434/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "phonon", "input": "Playback starts right away."}' \
| ffplay -nodisp -autoexit -loglevel error -
Audio is 24 kHz mono, returned as WAV by default or as raw 16-bit samples with "response_format": "pcm".
Get started
Speech models run on Apple Silicon Macs. Download Ollama 0.40.11 or later, then pull Phonon:
ollama pull phonon
For more information, see:
Auto-fetched and translated by AI Gem Box. All rights belong to the original author.