Turning One Piece of Content into a Week of Posts with an AI Workflow: A Localized Pipeline in Practice

A localized, verifiable, idempotent engineering pipeline for turning long content into a week of posts.
The article treats content repurposing as a repeatable engineering problem: source material as immutable data, passing through five deterministic transformations (extraction, chunking, generation, validation, publishing), all scriptable, version-controlled, and locally checkable before calling external APIs. Chunking uses tiktoken with ~1200-token overlapping windows; embeddings run locally on a 4-bit quantized 7–8B model. Generation requires JSON output, validation uses jq for schema/length checks, a smaller model for numeric fact-checking, and hashing for deduplication. Idempotency is key: skip existing files by chunk index, record post IDs to reject duplicates. Ops cautions include Mac containers' lack of Metal GPU access, matching model size to hardware, and human-in-the-loop review.
Why Content Repurposing Needs an Engineering Mindset
Breaking a talk, an in-depth article, or a video tutorial into seven days of social media posts is fundamentally a repeatable engineering problem. The original author's approach is worth borrowing: treat source material as immutable data, run it through a series of deterministic transformations, and finally hand the output to a scheduler for publishing. The entire pipeline can be scripted, version-controlled, and checked locally before calling any external API.

The benefits are straightforward: controllable costs, transparent dependencies, and traceable errors. Especially for indie developers and small teams, building your own lightweight pipeline beats stitching together a pile of SaaS tools.
Step 1: Extract Source Material Locally
If the source is a video, use yt-dlp to download the best-quality audio, then use ffmpeg to convert it to 16 kHz mono WAV—a format that works well with most speech-to-text models.
# Download audio only
yt-dlp -x --audio-format wav --audio-quality 0 "https://example.com/talk" -o "source/%(title)s.%(ext)s"
# Normalize to 16 kHz mono
ffmpeg -i source/*.wav -ar 16000 -ac 1 source/normalized.wav
If the source is an article, just git clone or curl it. The key is to keep the original files in the source/ directory to ensure pipeline idempotency—repeated runs won't produce different results.
Step 2: Chunking and Embedding
Large language models have token window limits, and feeding an entire transcript in one go loses detail. The author suggests using a lightweight tokenizer like tiktoken to split the text into overlapping windows of about 1200 tokens (roughly 900 words), recording each chunk's character offset for later reference.
import tiktoken, json, pathlib
enc = tiktoken.get_encoding("cl100k_base")
text = pathlib.Path("source/normalized.txt").read_text()
tokens = enc.encode(text)
chunks = []
for i in range(0, len(tokens), 1000):
window = tokens[i:i+1200]
chunks.append({
"index": len(chunks),
"text": enc.decode(window),
"start_token": i,
"end_token": min(i+1200, len(tokens))
})
pathlib.Path("intermediate/chunks.json").write_text(json.dumps(chunks, indent=2))
If you need semantic retrieval later, you can generate embeddings for each chunk using a 7–8B parameter model with 4-bit quantization (Q4_K_M). The model file is about 5GB, which runs comfortably on a 16GB laptop. Embeddings can be stored in a local vector database (such as sqlite-vec), completely avoiding external calls.
Tokens and tokenizers: LLMs don't process characters directly; they first split text into tokens—which may be complete words, parts of words, or punctuation. tiktoken is OpenAI's open-source tokenizer library, and cl100k_base is its common encoding scheme. An English word typically corresponds to 1–2 tokens, while Chinese uses more. The token window is the maximum number of tokens a model can process in a single pass; anything beyond gets truncated, so long texts must be chunked.
Embeddings: Mapping a piece of text to a high-dimensional vector, where semantically similar texts are closer together in vector space. Embeddings aren't used for generating text but for semantic retrieval, clustering, and deduplication. The Q4_K_M mentioned in the original article is one level in the GGUF quantization format; 4-bit quantization of a 7–8B model yields about 4–5GB in size with acceptable precision loss, a common trade-off for local deployment.
Step 3: Generating Draft Posts
Feed each chunk (or several adjacent chunks) to an LLM with a strict prompt requiring a single-platform post: one hook, three bullet points, one call to action, and a set of tags. Require JSON output for easy schema validation downstream.
# Example request to a local llama.cpp service
curl -s http://localhost:8080/completion \
-H "Content-Type: application/json" \
-d '{
"prompt": "<|system|>You are a concise technical copywriter. Return JSON with fields: hook, bullets[3], cta, tags[5].<|user|>Chunk: '"$(jq -r '.[0].text' intermediate/chunks.json)"'
}'
Loop through all chunks and write each response to drafts/post_<n>.json. There's an easily overlooked detail here: webhooks or async callbacks use "at-least-once" delivery, meaning the same request may arrive twice. So the generator must be idempotent—include the chunk index in the output filename and skip files that already exist.
Step 4: Guardrails and Validation
Before publishing, run a set of deterministic checks:
- Schema check: Use
jqto ensure each draft contains the required fields. - Length check: Enforce platform limits, e.g., hooks must not exceed 280 characters.
- Fact-checking: Use a smaller model to scan numbers in each bullet point, only allowing numbers that appear in the source chunk or a FACTS list (such as model sizes, GPU limits) to prevent hallucinations.
- Deduplication: Compute a hash of the hook plus bullets and discard drafts that duplicate a previous day's.
**Hallucination**: Refers to an LLM generating content that seems plausible but doesn't actually exist or doesn't match the source material—for example, fabricating numbers, dates, or quotes. In automated content pipelines, hallucinations directly become public false claims, so dedicated fact-checking steps are needed. The original approach: use a smaller model to extract numbers from each bullet point, compare them against the source chunk and a FACTS whitelist, and block any number not on the list. This is deterministic string-level validation—more reliable and cheaper than having another LLM judge "accuracy."
# Schema + length validation
for f in drafts/post_*.json; do
jq -e 'has("hook") and has("bullets") and has("cta") and has("tags")' "$f" >/dev/null || { echo "bad schema: $f"; exit 1; }
hook_len=$(jq -r '.hook|length' "$f")
if (( hook_len > 280 )); then echo "hook too long: $f"; exit 1; fi
done
Step 5: Scheduling and Publishing
A small scheduler (cron, systemd timer, or GitHub Actions) picks the next unpublished draft in lexicographic order, calls the platform's posting API, then marks the file as posted_<timestamp>.json. Again, because webhooks may arrive more than once, the publishing step should record the post ID returned by the platform and refuse to republish an ID that already exists in the local SQLite log.
Idempotency: The system state should remain consistent whether an operation is executed once or multiple times. In the publishing context, idempotency means that calling the posting API repeatedly won't produce two posts. Webhook "at-least-once" delivery semantics guarantee messages aren't lost but allow duplicates, so the receiver must deduplicate itself. A common approach is to assign a unique key to each request (such as the chunk index or post ID), log processed keys locally, and check the log before executing a new request.
A Few Pitfalls in Operations
Mac GPU limitations: Docker Desktop, Colima, and OrbStack all run containers in a Linux VM, which cannot access the Apple GPU via Metal. When rebuilding his Mac cluster demo, the author moved inference to the native llama.cpp binary, which links directly to Metal.
Matching model size to hardware: A 7–8B model quantized to 4 bits is about 5GB—runs on a 16GB laptop, but you need to leave headroom for the OS and vector database.
Weight conversion: Converting fp32 weights to fp16 can halve the download size, speeding up the initial model pull.
Human in the loop: The author runs a small digital product business. AI agents draft content, but he personally reviews every claim before it goes live. This maps directly to the validation step above—automation doesn't mean abandoning oversight.
A lesson in content auditing: After auditing the catalog of his nine products, the author found missing video courses, a private repository, and a community forum. Rewriting these promises before promotion avoided future credibility issues.
Early article data: His first 26 technical articles each got fewer than 30 views, showing that distribution mechanisms matter more than output volume.
Pure browser tools: He built a free 10-question tool to estimate weekly time saved by automation, running entirely in the browser—proving that heavy computation can stay client-side.
Metal and container isolation: Metal is Apple's GPU graphics and compute API, which can only be called directly from native macOS processes. Docker Desktop, Colima, OrbStack, and similar solutions essentially run a Linux VM on macOS, with containers running inside that VM—they can't reach the host GPU, so Metal isn't available. That's why the original article moved inference to the native llama.cpp binary—only a native process linking directly to Metal can use Apple silicon's GPU acceleration.
Who This Pipeline Is For
If you spend every week manually breaking long content into short posts, this approach is worth trying. Its core value isn't the sophistication of the models used, but turning content repurposing into a verifiable, repeatable engineering process. Every step is a pure functional transformation, version-controlled, locally inspectable—and scaling from a single talk to a month of content won't bring unexpected costs or hidden dependencies.
The original author compiled the full beta into a step-by-step guide and offers a free AI automation audit tool to help determine which part to automate first.
One-line Summary
A localized, verifiable, idempotent engineering pipeline for turning long content into a week of posts.
Paragraph Summary
The article argues for treating content repurposing as a repeatable engineering problem: source material as immutable data, passing through five deterministic transformations—extraction, chunking, generation, validation, and publishing—all scriptable, version-controlled, and locally checkable before calling external APIs. Chunking uses tiktoken with overlapping windows of about 1200 tokens; embeddings run locally on a 4-bit quantized 7–8B model. The generation stage requires JSON output from the LLM; validation uses jq for schema and length checks, a smaller model for numeric fact-checking, and hashing for deduplication. Idempotency is key: generation skips existing files by chunk index, and publishing records post IDs to reject duplicates. On the ops side, watch out for Mac containers' inability to access Metal GPUs, matching model size to hardware, and human-in-the-loop review.
Related articles

iPhone Duo Battery Life Tested: One Charge a Day Is Unavoidable, and the Large Screen Is the Culprit
iPhone Duo battery test: heavy use needs at least one charge a day, and about 30% remains after 6.5 hours of screen-on time. How often the large screen is unfolded is key; a MagSafe battery pack helps, and long-term degradation is also worth watching.

Kimi K3.1 Pro Open-Sourced: 2.8 Trillion Parameters Close In on Opus
Moonshot releases the open-source MoE model Kimi K3.1 Pro, with 2.8T total parameters and 104B activated, trailing Opus 5.5 by under 1 point on Terminal Bench 4.0.

Costco Tech Price Guessing: Are Monitors, Keyboards, Mice, and Bose Speakers Worth It?
A YouTube blogger guesses prices of Costco tech products: 2K 180Hz monitor, Logitech keyboard and mouse, Bose speaker, and CyberPower UPS, revealing warehouse-store selection and brand premium.