Adding speech recognition and image generation to a local LLM client: Investigating model runtimes

March 4, 2025

When building PromptPulse, I wanted a large language model (LLM) client people could use locally as soon as they downloaded it, with as little runtime installation and API configuration as possible. I wanted to integrate other kinds of models too. Some would accompany chat, such as automatic speech recognition (ASR) transcribing the user's words into the input box. 1 Others would be called by the LLM, such as an image generator invoked at the user's request.

I remember looking into running Whisper and Stable Diffusion in Node.js and later reading about FunASR, SenseVoice and their model files. These remained research. I did not attempt to integrate ASR or Stable Diffusion into PromptPulse. This article collects the questions I was investigating.

Voice input and model-directed tools are two ways to integrate models

Voice input can be a fixed workflow:

麦克风录音 → ASR 转写 → 输入框中的文字 → LLM 回复

The LLM need not first decide whether to invoke ASR. When the user starts recording, the client captures and recognizes speech, then lets them confirm the text or submits it after an utterance. Even a text-only chat model can offer voice input this way.

If users should speak into a microphone and hear the model answer directly, OpenAI's Realtime API offers an online approach. The client streams small audio chunks to the service and can start playback when a chunk of response audio arrives. The first design fills a text box. The second lets the user and model converse by voice. 2

Letting the LLM orchestrate models adds a decision. For example, the proposed image-generation workflow was:

用户提出需求 → LLM 生成工具调用 → 客户端运行图像模型
                                    ↓
                  展示图片,并将执行结果交回对话

The LLM supplies the tool and arguments, and the client executes it. The image model need not understand the entire conversation. The client need not feed raw images back to a text-only model, either. It can return task status or a file identifier. Having the LLM inspect the picture and judge the result requires a separate visual understanding capability.

This is an application workflow composed of several models, distinct from one model with native multimodal support. If the drawing program is a standalone tool, the Model Context Protocol (MCP) lets the client discover its name and required parameters and invoke it through an agreed protocol. The inference engine and weights still need to ship with the application.

Once someone selects an image in chat, how does the local model read it?

While building Meowssenger in June, I added an attachment picker. The client sent chat messages to a local service, specifying Qwen3-0.6B-ONNX as the model. On June 10 I searched “how to give qwen3 an image” and found a discussion asking precisely that: Qwen Chat accepts uploads on the web, but do locally downloaded Qwen3 weights accept images too? I followed links to Qwen Chat and the Qwen2.5-VL model files and looked at how to use the 7B vision model. My local Qwen3-0.6B accepted text. To ask questions directly about a photo, you can use Qwen2.5-VL with its vision encoder, which converts the image into input the model can process. 345

Suppose the user selects a train ticket photo and asks, “What is the departure station on this ticket?” Here the official 7B Python example is adapted for that case. The image is assumed to be ticket.jpg in a working directory readable by the inference process. Both model and matching processor can be loaded once when the service starts. 5

from qwen_vl_utils import process_vision_info
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration

model_id = "Qwen/Qwen2.5-VL-7B-Instruct"
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    model_id, torch_dtype="auto", device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)

messages = [{
    "role": "user",
    "content": [
        {"type": "image", "image": "ticket.jpg"},
        {"type": "text", "text": "这张票的出发站是哪一站?"},
    ],
}]

prompt = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
images, _ = process_vision_info(messages)
inputs = processor(text=[prompt], images=images, return_tensors="pt").to(model.device)

output = model.generate(**inputs, max_new_tokens=64)
# 返回的序列包含原提示,只把新生成的回答解码给用户。
answer = output[0, inputs.input_ids.shape[1]:]
print(processor.decode(answer, skip_special_tokens=True))

The same message is read twice for different purposes. apply_chat_template formats the question as the conversation the model expects and marks the image position in the prompt. process_vision_info calls fetch_image to open the actual picture, convert it to RGB and resize it. Only at processor(text=[prompt], images=images, ...) do the question and ticket pixels become inputs for the model together. 5

If a browser selected the image, the inference service usually cannot open the original on the user's computer from a filename alone. The client can send the image bytes, or replace ticket.jpg in the example with a data:image/jpeg;base64,... string containing the image. fetch_image can decode it directly. 5

This added a concrete design question. The attachment bar can preview the same picture, but what gets sent depends on what the current model accepts. With Qwen2.5-VL the client can send both question and image to the vision model. I found this option during Meowssenger development. The project code from then establishes the attachment picker and chat requests to local Qwen3. 3

Calling from Node.js need not mean running inference in JavaScript

My first searches included llamacpp run whisper model, run stable diffusion in nodejs and run whisper in nodejs. The existing client used Node.js and local LLMs, and I wanted options callable from that application.

For Whisper, the downloaded model file contains trained parameters or weights. The inference engine uses them to turn recordings into text, and a Node.js wrapper exposes functions to the client. The file has to match the engine. ONNX in the table stores a model's computation graph and parameters. GGUF can also hold weights and model metadata. Besides reading the file format, the engine must implement the computations the model requires.

SubjectLayerWhat still needs checking
nodejs-whisperNode.js wrapper around whisper.cppHow to distribute the executable, audio conversion tools, model and paths
Transformers.jsTask pipelines running models with ONNX RuntimeCompatible ONNX models, audio preprocessing and local assets
FunASRSpeech toolkit and deployment optionsModel choice, file transcription or streaming service
SenseVoiceSmallAudio understanding modelWhich inference implementation supports it and how to handle inputs and outputs
SenseVoice GGUF filesWeights for a particular modelWhether the loader implements the architecture as well as the GGUF container
Stable DiffusionFamily of image generation modelsSpecific model, inference backend and how the client invokes it and receives the image

The source and deployment docs below illustrate these distinctions. 678910

Reusing the Python model toolchain

A sidecar is an auxiliary process launched with the main app. An Electron UI could capture a recording, hand it to a separate Python program, and put the returned transcript in the input box. For other desktop architecture trade-offs, see choosing a cross-platform desktop AI stack. Here I'll focus on how the speech and image models themselves run.

I remember most Node options I initially found centered on LLMs. For speech and images there were few directly usable choices, and I struggled to find a fit. Python had more mature model tooling, so I considered keeping Electron and TypeScript for the client and running the models in Python.

I even considered PyTorch inside Electron and searched for using it from JavaScript, hoping to reuse existing model implementations directly. This was still integration research. I did not complete the integration.

That led from python in electron to run python in js, run python in nodejs and eventually node-calls-python. It offers in-process calls: a native extension embeds a Python interpreter so Node code can import modules, call functions and receive results. Its historical README explicitly lists running machine learning and deep learning models as uses. 11

I also considered bundling Python with the application, for example as a sidecar. Users would still download only the client. The app would start an independent Python inference process, send tasks and receive results through IPC. The client could keep its UI and reuse Python libraries and examples for the models.

This differs from node-calls-python: a sidecar puts Python in a separate process, while the latter embeds the interpreter in the Node process. Either way, distribution must account for the Python environment, model dependencies and weights. A sidecar also requires process lifecycle and communication management. I considered this for other modalities and did not complete an integration then.

nodejs-whisper: what else needs shipping besides the npm package?

Whisper is OpenAI's speech recognition model released as open source in 2022. It supports multilingual transcription and translation into English. The launch post Introducing Whisper outlines the approach. An encoder–decoder Transformer processes 30-second audio windows. A log-Mel spectrogram represents how sound strength in different frequency bands changes over time. The encoder extracts speech features, and the decoder generates text from them step by step. 12

I visited the official Whisper repository and searched whisper nodejs to learn how to call it from the existing client. 13 The nodejs-whisper npm page led to the GitHub source. 6 It provides a Node.js transcription entry point but does not implement Whisper inference purely in JavaScript.

In the June 2025 source snapshot, whisper.ts looks for whisper-cli, or whisper-cli.exe on Windows, and executes it through the shell. If the executable is missing, it also tries to build whisper.cpp with CMake. When audio conversion is needed, utils.ts invokes ffmpeg to normalize recordings to mono PCM WAV at 16,000 samples per second. The recognizer gets a consistent input regardless of the recording's original format. 7

That brings us back to PromptPulse's delivery goal. An npm call working on my development machine doesn't mean users can run it with just the app. This route would require preparing the inference executable and necessary audio tools for each platform, locating the model, and replacing development paths with ones that work after installation. Automatically compiling on first run cannot guarantee users won't need a toolchain.

This sort of call could run in a separate process, with Electron managing launch, exit and result delivery. Having run a separate process for other model experiments doesn't verify Whisper's entire distribution path.

Transformers.js ASR examples and compatible models

I later found an official example calling a speech model directly from Node: Transformers.js's Server-side Audio Processing in Node.js. It uses Whisper for ASR. I also visited the npm page for @xenova/transformers. 10

The example takes a different route: load an ONNX model with the Transformers.js automatic-speech-recognition pipeline. Version 2.17.2 uses onnxruntime-node as the Node backend and needs neither Python nor whisper.cpp for inference. The pipeline wraps the steps for one transcription in a callable function. This adaptation of the 2.17.2 tutorial assumes voice.wav is a mono English recording in the current directory. 10

import { readFile } from "node:fs/promises";
import { pipeline } from "@xenova/transformers";
import wavefile from "wavefile";

const transcribe = await pipeline("automatic-speech-recognition", "Xenova/whisper-tiny.en");
const recording = new wavefile.WaveFile(await readFile("voice.wav"));
recording.toBitDepth("32f");
recording.toSampleRate(16000);

const { text } = await transcribe(recording.getSamples());
console.log(text); // 客户端可以把这段文字填进输入框,供用户确认。

How do you transcribe a recording if you already have an exported Whisper ONNX model? Someone asked in the Whisper large-v2 discussions. sanchit-gandhi mentioned using Hugging Face Optimum's transcription pipeline in Python or calling ONNX Runtime directly. The latter requires preparing inputs according to the model's specification yourself. The poster later reported that the former failed in their Transformers 4.26.0 environment. The discussion ended with a request to submit the error information to Optimum. 14

I then filtered Hugging Face models by automatic-speech-recognition and transformers.js and browsed subsequent pages sorted by Trending to find supported models. 15 One I visited, Xenova/whisper-tiny.en, was also the tutorial's model. It supplies Transformers.js-compatible ONNX weights. .en indicates English only. 16 For Chinese voice input, start with Hugging Face's list filtered to Chinese and speech recognition. 17 Check each candidate's model card and files to verify it provides ONNX files loadable by your Transformers.js version.

That added Transformers.js/ONNX to the ASR shortlist. The official example explains execution, but “download the client and use it” also requires delivering model files, a cache directory and the runtime. The tutorial downloads and caches the model on first use. Offline first use requires preparing the assets with the app in advance. 10 I continued researching models but didn't integrate this ASR pipeline into PromptPulse.

Looking next for an LLM for chat and tool calls

After the speech models, I switched the task filter to text-generation, kept transformers.js, sorted by Trending and searched for instruct. I wanted to see what LLMs this ONNX approach supported and identify candidates for chat and tool calls. 18

Two conditions need distinguishing. Instruct usually indicates instruction tuning to follow user requests. It isn't a standard marker for enhanced tool calling. search=instruct in the link also just searches model names. It cannot replace checking capabilities. Suppose a model receives a generate_image(prompt) tool and the user says “draw a red desk lamp.” The client must extract the tool name and prompt from the reply before launching the generator. To see whether the chain works, check the model's tool-calling instructions, input template and how the runtime parses results. Loading an ONNX model and generating a reply are distinct from wiring up an entire tool-call workflow. 19

This search connects back to PromptPulse's local LLM work. For the ONNX inference and packaging experiments I actually ran later, see running a local ONNX model in Electron with a standalone Node sidecar.

How FunASR introduced me to streaming speech recognition

I then found a post about a bundled local distribution of FunASR. An AI tools directory, the product home page I found in search and FunAudioLLM's model pages led me to FunASR's real-time dictation deployment guide. 202122

The bundle demonstrated a packaged experience. The SDK docs explained how to organize audio input and recognition results in my own client. FunASR's historical deployment guide distinguishes online, offline and 2pass, with clients including an HTML example. For the same recording, offline waits for a complete segment before transcribing. online can display words as you speak. Either service can run on the local machine. 8

2pass is especially helpful for understanding interaction. Show streaming results while the user speaks, then run another recognition pass to correct the text once the sentence ends. The documentation also records adding SenseVoiceSmall support for 2pass-offline. That means it can handle the second pass, not that SenseVoiceSmall itself is the same kind of streaming model. 8

In a chat input, I would handle “recognition in progress” and “confirmed text” separately. The first can update continuously. Only the latter enters chat history and goes to the LLM. Otherwise correcting a few recognized characters might trigger another model reply. This is a design derived from the interface behavior, still unimplemented in PromptPulse.

Besides recognition quality, choosing ASR involves how soon after speech you can submit, how to detect the end of an utterance and whether results may change later. An example transcribing complete audio files does not automatically solve those interaction questions.

SenseVoiceSmall, GGUF and Whisper large-v3

Following that trail, I searched sensevoice, read the SenseVoiceSmall model card and the file listing for lovemefan/sense-voice-gguf, and finally looked at Whisper large-v3. 2324

Besides transcribing words, SenseVoiceSmall can tag language, emotion and sound events such as applause and laughter. If someone says “thank you” and applause follows, the chat input could contain only “thank you,” with applause marked separately. Whisper large-v3 offers speech recognition and speech translation. Both merited investigation, but I did not compare them on the same recordings and machine, so I can't conclude which suited PromptPulse better. 2324

To compare Chinese transcription, first inspect a few samples in Hugging Face's Dataset Viewer to check the dataset has Chinese recordings and corresponding human transcripts. Then use the Python Datasets library to load the same recordings, transcribe each with both models and compare line by line with the human text to see which characters each misheard. 25

GGUF files naturally brought to mind the earlier LLM runtime experience. A common extension, though, does not guarantee that passing the path to node-llama-cpp will recognize speech. The historical SenseVoice.cpp documentation I consulted during editing provides its own conversion, loading and audio processing instructions and links to the sense-voice-gguf repository I had visited. 9

For instance, the contemporary SenseVoice.cpp CLI accepted the model and recording as different arguments. Assuming the program has been built, the following weights downloaded, and voice.wav is a 16 kHz Chinese recording, its historical example simplifies to one line. 9

./bin/sense-voice-main -m sense-voice-small-q4_k.gguf -l zh voice.wav

Here -m selects the weights, -l zh specifies Chinese and the last argument is the recording to transcribe. To reuse an existing engine, the client must verify its version implements SenseVoice's audio processing and recognition computations.

How can an LLM invoke image generation?

For Stable Diffusion I first searched run stable diffusion in nodejs, hoping to add image generation to the client. Later I searched Hugging Face's transformers python library run stable diffusion and transformers python library run stable diffusion for Python-side runtime and integration options. This connected to my earlier idea of bundling Python with the app. I did not proceed to verify a specific model integration.

Several Hugging Face libraries need distinguishing. Although I searched for Transformers, Diffusers usually provides the full Stable Diffusion pipeline. In the classic StableDiffusionPipeline, for example, a user types “red desk lamp.” The tokenizer and CLIP text encoder turn the words into numerical representations of the prompt. Starting from random noise, a denoising network uses the prompt to estimate noise to remove at each step, while the scheduler updates a compressed image representation over the selected steps. Finally a VAE decoder turns it back into displayable pixels. Transformers can provide the text components, Diffusers connects the generation stages, and PyTorch can handle the underlying computation. 26

I continued comparing image generation runtimes. In the Diffusers v0.12.0 installation guide I followed a link to learn about Flax. The page listed diffusers["torch"] and diffusers["flax"] installation options. Flax is a JAX-based Python neural network library, corresponding to a different implementation and compute backend, rather than a tool for executing Python in JavaScript. 27

📓 Note JAX lets Python send array operations to the GPU. In the denoising example, Flax defines the network layers, JAX executes operations such as matrix multiplications inside them, and Diffusers runs the network step by step to turn noise into an image.2627

Next I searched stable diffusion oonx and read How to Run Stable Diffusion with ONNX to see whether image models might fit the local inference path I was investigating. The article discusses Python-side model export and ONNX Runtime inference, describes Microsoft examples and Hugging Face Optimum as two entry points, and records compatibility issues with CUDA, cuDNN and runtime versions. 28

I remember specifically investigating how to export models to ONNX and reading the Diffusers ONNX Runtime documentation. Besides finding preconverted models, I wanted to see whether I could export one, save it locally and give it to the client. In the then-available v0.32.2 docs, Optimum's export=True could convert while loading. Alternatively, export using optimum-cli export onnx first and load from a local directory. 29 I investigated that route, but can't establish whether I actually completed an image model conversion at the time.

Flax and ONNX sit at different layers. PyTorch and JAX/Flax implement and run models. ONNX is an interchange format, and ONNX Runtime is an inference engine for it. Flax is not a prerequisite for ONNX. Diffusers already documented ONNX inference, but its Python pipeline did not imply an equivalent image generation API in Transformers.js. Moving to Node would still require arranging model components, denoising iterations and pre- and post-processing. 29 These materials helped me compare integrations. I did not finish integrating Flax or ONNX image generation.

For example, an export-then-package approach could run the following command on the development machine to export Stable Diffusion 1.5 into sd15-onnx/. Both excerpts below adapt the v0.32.2 docs. 29

optimum-cli export onnx --model stable-diffusion-v1-5/stable-diffusion-v1-5 sd15-onnx/

Once the exported directory ships with the app, a Python helper can load it locally. A fixed prompt demonstrates one call. In the real integration the client supplies it.

from optimum.onnxruntime import ORTStableDiffusionPipeline

draw = ORTStableDiffusionPipeline.from_pretrained("./sd15-onnx")
image = draw("a red desk lamp on a wooden table").images[0]
image.save("lamp.png")

The drawing result now has a clear destination. The helper can return the generated file path to Electron for display in chat.

Node.js can submit parameters, launch work and receive results while a program compatible with the image model handles inference. As another reference, stable-diffusion.cpp already offered a C/C++ inference program and CLI at the time. I added it while editing to illustrate a runtime option, not as a record of adopting it. 30

On March 10, after researching ONNX, I looked at two ready-made drawing interfaces. Comparing Stable Diffusion UIs, Wang Fuqiang recommended starting with AUTOMATIC1111 WebUI. ComfyUI lets users connect generation steps into a graph and retain the other steps when adjusting one. 31

For an LLM to call a drawing tool, first distinguish creating a new image from editing the current one. In a WebUI tutorial, maxx showed how to add a scarf to a person: paint the area around the neck to change, then describe the scarf with a prompt. 32 Text-to-image can take just a prompt. Inpainting also needs the original and a mask identifying the edit region. After submission the client must show progress, handle cancellation or failure, and return the generated image to the conversation.

Adding a model also consumes resources. Whether LLM, ASR and image generation must remain resident simultaneously, and when to load or release them, needs testing on target machines. Separate processes help manage their lifecycles but cannot create physical memory or VRAM or remove the inference backend's own allocation limits.

The product goal was always to put these capabilities inside one client. The interface and invocation can be unified, but each underlying model environment needs its own solution. “Supports speech and images” ultimately comes down to model files, executables, process management, and how the interface handles waiting and feedback.

Research sources

Footnotes

  1. Hugging Face. (n.d.). Automatic Speech Recognition [任务定义及音频转写示例]. 任务介绍. ↩

  2. OpenAI. (n.d.). Realtime. OpenAI API Reference. 见音频输入事件 input_audio_buffer.append 和语音回复事件 response.output_audio.delta。 ↩

  3. Cai, B. [S2thend]. (2025, June 9). Meowssenger [聊天输入组件]. GitHub. 附件选择界面的改动;同日版本发送给本地服务的消息与模型名。 ↩ ↩2

  4. kuliev-vitaly. (2025, April 29). Image support [Qwen3-30B-A3B 讨论 #9,见首帖及 4 月 30 日、5 月 13 日回复]. Hugging Face. 讨论原文。Qwen Team. (n.d.). Qwen3-0.6B [文本生成模型卡]. Hugging Face. 模型介绍与调用示例。 ↩

  5. Qwen Team. (n.d.). Qwen2.5-VL-7B-Instruct [模型卡]. Hugging Face. Transformers 图文对话示例。QwenLM contributors. (2025, April 23). vision_process.py [源代码,提交 a30e36f]. GitHub. 对话消息中的图片分支、读取图片、处理透明通道和缩放。 ↩ ↩2 ↩3 ↩4

  6. ChetanXpro. (n.d.). nodejs-whisper. npm / GitHub. 浏览入口:https://www.npmjs.com/package/nodejs-whisper ;源码:https://github.com/ChetanXpro/nodejs-whisper 。README 历史快照:https://github.com/ChetanXpro/nodejs-whisper/blob/5f89932d4c71c9bc2c6a8f661b36dc2788b86834/README.md 。Access date: June 8, 2025. ↩ ↩2

  7. ChetanXpro et al. (n.d.). whisper.ts; utils.ts [源代码,快照 5f89932]. GitHub. getWhisperExecutablePath、executeCppCommand 与音频转换实现:https://github.com/ChetanXpro/nodejs-whisper/blob/5f89932d4c71c9bc2c6a8f661b36dc2788b86834/src/whisper.ts ;https://github.com/ChetanXpro/nodejs-whisper/blob/5f89932d4c71c9bc2c6a8f661b36dc2788b86834/src/utils.ts 。Access date: June 8, 2025. ↩ ↩2

  8. ModelScope / FunASR contributors. (n.d.). FunASR实时语音听写服务开发指南 [文档,快照 4f87e0b;模式说明及 2024-10-29 更新记录]. GitHub. 浏览链接:https://github.com/modelscope/FunASR/blob/main/runtime/docs/SDK_advanced_guide_online_zh.md ;历史版本:https://github.com/modelscope/FunASR/blob/4f87e0b8f850706dc39ded2eca54aa574ed46e44/runtime/docs/SDK_advanced_guide_online_zh.md 。Access date: June 8, 2025. ↩ ↩2 ↩3

  9. lovemefan et al. (n.d.). SenseVoice.cpp [README,“使用”部分,历史快照 8b3587f]. GitHub. https://github.com/lovemefan/SenseVoice.cpp/blob/8b3587f0626dde2f463d8e8bc3617beda9874b3c/README.md 。补充技术参考。Access date: June 8, 2025. ↩ ↩2 ↩3

  10. Hugging Face / Xenova. (n.d.). Server-side Audio Processing in Node.js [教程,“Creating the application”及首次运行说明]. https://huggingface.co/docs/transformers.js/tutorials/node-audio-processing ;@xenova/transformers [npm 包入口]. https://www.npmjs.com/package/@xenova/transformers 。技术说明按 2.17.2 的历史教程、包清单和 ONNX 后端选择核对;版本用于解释当时已有的方案,不代表本地已安装该版本。npm 页面不可读,包名与依赖依据历史源码。Access date: June 8, 2025. ↩ ↩2 ↩3 ↩4

  11. hmenyus et al. (n.d.). node-calls-python [README,“Motivation”“Installation FAQ”及调用示例,历史快照 79cca1e]. npm / GitHub. 浏览入口:https://www.npmjs.com/package/node-calls-python ;历史文档:https://github.com/hmenyus/node-calls-python/blob/79cca1ec28a49c96a3b4a86496ed5052edd8fde1/README.md 。Access date: June 8, 2025. 我记得检索顺序是 python in electron → run python in js → run python in nodejs → node calls python;尚未确定它与前一组模型资料之间的具体访问顺序。 ↩

  12. OpenAI. (2022, September 21). Introducing Whisper [模型介绍及以“The Whisper architecture”开头的架构说明段落]. OpenAI. https://openai.com/index/whisper/ 。Access date: June 8, 2025. ↩

  13. OpenAI. (n.d.). Whisper [官方代码仓库]. GitHub. https://github.com/openai/whisper 。Access date: June 8, 2025. 另保留检索词 whisper nodejs,不据此确定它与此前各次浏览的精确先后顺序。 ↩

  14. kirankumaram. (2022, December 27). ONNX implementation [讨论帖,第 12 号]. Hugging Face. 原帖及回复,见 sanchit-gandhi 于 2023 年 1 月 26 日的两种调用建议,以及 2 月 1–2 日关于 Transformers 4.26.0 的跟帖。 ↩

  15. Hugging Face. (n.d.). Models: Automatic Speech Recognition, Transformers.js [模型筛选及分页入口]. https://huggingface.co/models?pipeline_tag=automatic-speech-recognition&library=transformers.js ;https://huggingface.co/models?pipeline_tag=automatic-speech-recognition&library=transformers.js&p=1&sort=trending 。Access date: June 8, 2025. 保留筛选条件,不将当前结果数量、排序或模型列表当作当时的页面快照。 ↩

  16. Xenova. (n.d.). whisper-tiny.en [模型卡,“Whisper”及“Usage (Transformers.js)”]. Hugging Face. https://huggingface.co/Xenova/whisper-tiny.en 。Access date: June 8, 2025. 当前模型卡的包名已更新;正文中的历史包名及示例模型依据注 14 的固定版本教程。 ↩

  17. Hugging Face. (n.d.). Models [中文语音识别模型,按 Trending 排序]. 打开模型筛选页. ↩

  18. Hugging Face. (n.d.). Models: Text Generation, Transformers.js, instruct [模型筛选入口,Trending 排序]. https://huggingface.co/models?pipeline_tag=text-generation&library=transformers.js&sort=trending&search=instruct 。Access date: June 8, 2025. 页面当前无法读取;按作者提供的 URL 保留筛选条件,不复原当时的结果列表。 ↩

  19. Qwen Team. (n.d.). Qwen2.5-0.5B-Instruct [模型卡,“Introduction”中的 instruction-tuned 说明]. Hugging Face. https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct#introduction ;Function Calling [Qwen 2.5 文档,“What is function calling?”及“Inference with Function Calling”]. https://qwen.readthedocs.io/en/v2.5/framework/function_call.html 。补充技术参考,用于区分指令微调与工具调用,不作为当时浏览或选用这个具体模型的记录。Access date: June 8, 2025. ↩

  20. 无言***. (2025, February 23). FunASR - 阿里开源语音识别模型 支持语音转文本/语音转字幕/视频转字幕等 本地一键整合包下载 [论坛帖子]. DeepFace. https://deepface.cc/thread-568-1-1.html 。Access date: June 8, 2025. ↩

  21. AI小集. (2024). FunASR – 阿里开源的多功能语音识别工具包. AI工具集. https://ai-bot.cn/funasr/ 。另保留当时搜索到的产品主页入口:FunASR. (n.d.). https://www.funasr.com/?utm_source=ai-bot.cn#/ 。Access date: June 8, 2025. ↩

  22. FunAudioLLM. (n.d.). FunAudioLLM [组织及模型页面]. Hugging Face. https://huggingface.co/FunAudioLLM 。Access date: June 8, 2025. ↩

  23. FunAudioLLM. (n.d.). SenseVoiceSmall [模型卡]. Hugging Face. https://huggingface.co/FunAudioLLM/SenseVoiceSmall 。lovemefan. (n.d.). sense-voice-gguf [模型文件]. Hugging Face. https://huggingface.co/lovemefan/sense-voice-gguf/tree/main 。Access date: June 8, 2025. ↩ ↩2

  24. OpenAI. (n.d.). whisper-large-v3 [模型卡]. Hugging Face. https://huggingface.co/openai/whisper-large-v3 。Access date: June 8, 2025. ↩ ↩2

  25. Hugging Face. (n.d.). Dataset viewer. Hugging Face Docs. 见首页的数据集预览示例。音频加载见 Hugging Face. (n.d.). Datasets, “Load audio data”. ↩

  26. Hugging Face / Diffusers contributors. (n.d.). Text-to-image [Diffusers v0.32.2 文档,生成示例及 StableDiffusionPipeline 组件说明]. https://huggingface.co/docs/diffusers/v0.32.2/en/using-diffusers/conditional_image_generation ;https://huggingface.co/docs/diffusers/v0.32.2/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline 。补充技术参考,用于解释 Python 图像生成工具的分工,不作为当时已浏览这些具体页面或采用该版本的记录。Access date: June 8, 2025. ↩ ↩2

  27. Hugging Face / Diffusers contributors. (n.d.). Installation [Diffusers v0.12.0,“Install with pip”]. https://huggingface.co/docs/diffusers/v0.12.0/en/installation 。The Flax authors. (n.d.). Flax [文档首页]. https://flax.readthedocs.io/en/latest/ 。Access date: June 8, 2025. 安装页直接链接 Flax;当前 Flax 首页已突出 NNX,本文只引用其基于 JAX 的定位,不据此认定当时阅读了当前 API 内容。 ↩ ↩2

  28. Turc, J. (2024, May 13). How to Run Stable Diffusion with ONNX [“How to run Stable Diffusion with the ONNX runtime”]. Medium, TDS Archive. 原浏览入口:https://medium.com/towards-data-science/how-to-run-stable-diffusion-with-onnx-dafd2d29cd14 ;可读地址:https://medium.com/data-science/how-to-run-stable-diffusion-with-onnx-dafd2d29cd14 。Access date: June 8, 2025. 我记得的访问顺序为注 20 的 Diffusers 安装页 → Flax 文档 → 搜索 stable diffusion oonx → 本文;检索词保留原拼写。 ↩

  29. Hugging Face / Diffusers contributors. (n.d.). ONNX Runtime [“Stable Diffusion”中的模型导出、保存与本地加载]. 原浏览入口:https://huggingface.co/docs/diffusers/optimization/onnx 。导出说明参照 v0.32.2 历史文档;另对照 v0.12.0 文档中加载 ONNX 权重的方式。作者确认研究过模型导出;无版本号的入口不能确定当时所见版本,固定版本用于核对方案,不证明已执行转换。Access date: June 8, 2025. ↩ ↩2 ↩3

  30. leejet et al. (n.d.). stable-diffusion.cpp [README,“Features”及“Usage”,历史快照 10c6501]. GitHub. https://github.com/leejet/stable-diffusion.cpp/blob/10c6501bd05a697e014f1bee3a84e5664290c489/README.md 。补充技术参考。Access date: June 8, 2025. ↩

  31. 王福强. (2023, April 29). 不知道Stable Diffusion Web UI应该怎么选? 看这一篇就够了! [“ComfyUI”及“小结”]. 王福强的个人博客. 原文. Access date: March 10, 2025. ↩

  32. maxx. (2023, October 7, 编辑). (入门)Stable Diffusion Web UI [“txt2img(文生图)”及“Inpaint(重绘)”的围脖示例]. 知乎专栏「Stable Diffusion 绘图」. 原文. Access date: March 10, 2025. ↩

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-03-04). Adding speech recognition and image generation to a local LLM client: Investigating model runtimes. https://caiborui.com/blog/2025-03-04-zh-local-speech-image-model-runtimes-entrans

@misc{borui2025-f04b8e2f,
  author = {borui},
  title = {{Adding speech recognition and image generation to a local LLM client: Investigating model runtimes}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-03-04-zh-local-speech-image-model-runtimes-entrans}
}