The Sermon Pipeline Explained

,

Models On My Own Machine

At a church that I do tech work for had 598 recorded sermons going back to 2013. Almost all of them were a video and a title and nothing else, so anyone wanting to know what a sermon was about had to watch on average 27 minutes of it.

I wanted to change that. Not everyone has 27 minutes to watch a video, especially if they are just looking for a quick word of encouragement or a specific meaningful point. By providing written summaries and transcripts, I wanted to ensure these messages became searchable and accessible, while ultimately saving time. I wanted to provide a transcript option which is a much more powerful study tool than a video.

Over three days, I gave 577 of them a written summary and a full transcript. The AI in this story ran on a Mac in my office, not in a data centre.

I’m assuming you’ve used a chat assistant and know roughly what a language model is, but have never run one yourself and don’t know what Ollama, Whisper or a “local model” actually means. That’s what this post explains, the pieces, what each one does, and how they were wired together.

When you use a chat assistant, three separate things are happening.

There is a model: a large file of numbers, tens of gigabytes of them, which can predict text in a plausible way. There is a program that runs the model, loading it into memory and feeding it your words one piece at a time. And there is a subscription fee or you pay for the tokens.

The third part is what you’re paying for, and it’s the only part that requires a company. The first two work perfectly well on a computer you own.

The word tokens matters here. A model doesn’t read letters or words; it reads tokens, which are chunks of a word, “sermon” might be one, “unbelievable” might be three. Every model has a context window: the maximum number of tokens it can hold at once, counting both what you send and what it writes back. This is a hard ceiling, and it’s the reason for several decisions below.

Three programs, three jobs

The whole system was three programs, and none of them was a chatbot.

JobProgramWhat it is
Runs the language modelOllamaA server on the machine that loads models and answers requests
Turns speech into textwhisper.cppA command-line program that listens to an audio file and writes what it hears
Decides what to do nextHermes AgentAn agent that runs the scripts, reads the results, and reacts

Ollama is the piece that surprises people. It is a chat interface and or a server . Install it, and it sits quietly on your machine, waiting for a request that says which model you selected to use and what to ask it. Anything on that machine that can send an HTTP request can use it, a script, a web interface, another program.

Whisper is a completely different kind of model and this is the part most people haven’t met. It doesn’t chat. It doesn’t answer questions. It takes an audio or video file and produces text, and that’s all it does. It was published by OpenAI as open source, and the version used here is a C++ rewrite called whisper.cpp that runs fast on Apple Silicon.

There are two useful links if you want to read further: the whisper.cpp project, and the model files on Hugging Face — the one used was large-v3-turbo, about 1.5 GB, which is a good balance between accuracy and speed on a laptop-class chip.

Hermes Agent is the part that makes decisions. It’s not a model; it’s the thing that runs the pipeline, notices when something fails, reads the logs, and tries a different approach. When a summary came back wrong at three in the morning, that’s the piece that could look at why.

Local and cloud models

A local model runs on hardware you own. A cloud model runs on someone else’s, and you reach it over the internet.

The trade is straightforward. Local is free per word, private, and works with the network unplugged, but you’re limited by the amount VRAM on your computer. The Mac Studio I have has 64 GB of Unified RAM, so a 12-billion-parameter model fits comfortably and something five times larger does not. Cloud models are bigger and better at hard reasoning, they cost money per token, and whatever you send them leaves your machine.

Ollama does both: local models on your own disk, and a subscription service for larger ones hosted for you. The pipeline in this post used only local models for the actual work. Sermons belong to a congregation, and a machine in the office is the right place for them.

The cloud model appears once, in the debugging. When the job started duplicating summaries and I needed to work out why from the script’s logic, that reasoning went to a larger model over the internet. A useful way to think about the split: local models do the volume, a cloud model does the thinking about the volume.

Which models, and why three of them

The models are all Gemma, Google’s open-weight family, available through Ollama’s model library. Three variants did different jobs:

  • gemma4:12b-mlx-8k wrote the summaries. 12 billion parameters, 8,000 tokens of context. This is the part a person actually reads, so it gets the largest model that fits the job.
  • gemma4:12b-mlx-16k took over when a transcript ran past 6,000 tokens, because the instructions plus a long sermon don’t fit in 8,000. Same model, bigger window, more memory.
  • gemma4:e4b-mlx did the paragraph formatting. A smaller, faster model, because deciding where a paragraph break belongs inside a chunk it was handed is easier than writing a summary.

The mlx suffix means the model is built for Apple’s MLX framework, which uses the Mac’s own graphics processor. That’s what makes this practical at all: the same work on a CPU would take many times longer.

One detail caused a wasted evening and is worth mentioning, because it’s a real trap. The MLX runner ignores the context size sent with each request, it only reads it from the model’s own configuration file. Send it as a parameter and it is silently discarded. The result was a 12-billion-parameter model pinning 50 GB of memory against a 65,536-token window it never needed, on a machine that has 64 GB.

The other operational fact: the runner degrades after an hour of continuous calls. The batch restarts before every sermon and pokes it with a one-token request to see if it’s alive. That’s why it kept working for three days instead of quietly slowing to nothing.

The job, split in two

My first instinct was one request: hand the transcript over, ask for a summary and a neat copy of the text.

That failed in an instructive way. A 12-billion-parameter model summarised three and a half thousand words was fine, because a summary is supposed to paraphrase. But the same model asked to copy three and a half thousand words drifted. The first version dropped the clause “Jesus still is.” That was from the middle of a sermon and turned “typhoons” into “typhopens”. Both read plausibly. Neither is what the preacher said.

So the pipeline makes two requests, always:

  • The summary: generative. Paraphrasing is the point.
  • The transcript: copied, 450 words at a time, and every chunk is checked (token-for-token) against the source before it’s accepted.

If a chunk drifts it’s retried. If it drifts twice, that chunk is split on sentence boundaries and rejoined mechanically, which cannot alter a word. The transcript is exact by construction rather than by hope, and that’s why the job takes four minutes a sermon instead of one.

Whisper does the hearing

When a post had no transcript, something had to listen to the recording. The chain is:

video URL → download the audio → convert to 16 kHz mono → whisper.cpp → text

The 16 kHz mono conversion isn’t fussy. Whisper expects that format specifically, and letting it resample on its own produced worse results than converting first.

YouTube published automatic captions for most of these videos. The obvious shortcut is to use them, but I chose not to for a few reasons. They mangle names and scripture, which are the two things a church archive most needs to get right. The pipeline downloads them anyway and compares them against Whisper’s output: a big disagreement is a signal to check the page before publishing, and a close match says nothing has gone wrong. Neither makes the captions the transcript.

Putting it back on the website

There’s no plugin and no API key anywhere in this. The site runs in a container on the same machine, and that container answers WordPress’s own API on a local port. The pipeline reads the post from there, rebuilds the body, and writes it back through a small PHP script that loads WordPress directly.

One trap: WordPress’s default save runs a filter that strips iframes, which would have removed the video player from every sermon and said nothing about it. The write disables that filter for the duration of the call, then restores it, and checks afterwards that the player is still there.

After each write the pipeline fetches the public page and checks what a reader would see the summary heading, the transcript, the player. A save isn’t a success until the page says so. It’s the measure twice cut once motto.

The third copy

Everything ends up in three places, which is deliberate.

The post itself on the website, for the congregation. A markdown file in a git repository on the same machine, one per sermon, one folder per year, plain text that will still open in twenty years and can be searched without a database. And a reading copy in a folder on the desktop, for browsing.

The repository is served by Gitea, a self-hosted equivalent of GitHub. A daily job converts anything that changed on the site and pushes it, so the archive follows the website without anyone remembering to run anything.

That job has one deliberate quirk. It refuses to overwrite a file when the site’s content shrank, because a site-side edit can silently drop text and the archive shouldn’t follow it down. The guard caught my own repair by removing duplicated summary blocks and held eleven files until I rewrote them on purpose.

What broke

Two failures, both worth the telling.

The audit couldn’t see hand-written summaries. Deciding whether a post had a summary came down to one pattern – looking for a markdown heading. But summaries on this site exist in three shapes: a heading, a bold **Summary** line, and on several 2025 posts, a bare first paragraph beginning “In this week’s service”. The check knew one of three. So the thirty-nine posts that a person had already summarised by hand were queued to be summarised again, and eleven were done before I noticed.

The fix is three lines: teach the audit all three shapes, and put a guard in the pipeline that refuses to write a second summary over an existing one. Then repair the eleven from the pre-run copies, and verify on the live pages.

The queue could stall silently. The batch uses a lock file so two runs can’t overlap. It’s removed on a clean exit and never checked for staleness. Kill a run mid-sermon and the file stays behind. Every later run returns without a word, no error, no log line. It would look like the job had simply stopped. That matters because it runs unattended overnight, which is exactly when nobody’s watching.

The numbers

Sermons in the archive598
Processed by the batch450, over about 55 hours
Transcribed from video350
Reused a transcript already in the post65
Now have a summary and a transcript566
With no recording at all32

Roughly four minutes per sermon, and most of that is Whisper working through the audio. A 27-minute service produced 3,756 words of transcript and two paragraphs of summary.

AI is such an amazing tool to have. I have many other uses for it. I can’t wait to start my next project!

I can’t wait to find other ways to use it.


Discover more from AddSpice

Subscribe to get the latest posts sent to your email.