How I Use a Local LLM to Generate SEO Content for 10,000+ Pages

Published: (March 9, 2026 at 09:37 PM EDT)
7 min read
Source: Dev.to

Source: Dev.to

Apex Stack

There’s a lot of hype about using AI for content. Most of it is about writing blog posts faster. That’s fine, but it misses the bigger opportunity: using AI as a component in a programmatic content pipeline that generates thousands of unique pages.

I run a stock‑comparison site with 287 000 pages across 12 languages. Every page has AI‑generated narrative sections — not generic filler, but analysis that’s specific to each stock pair. The AI doesn’t write the whole page; it writes the parts that need to feel human, while structured data handles everything else.

Below is how the system works and what I’ve learned about making AI content that Google actually accepts.

Why a Local LLM (and Why Llama 3)

First question everyone asks: Why not just use the OpenAI API?

FactorWhy a local Llama 3 instance wins
Cost287 k pages × 500‑800 tokens ≈ $200‑$400 at GPT‑3.5 rates for the initial generation alone. Regeneration for template updates, multilingual variants, and iterative improvements adds up quickly.
SpeedAPI rate limits would turn this into days of queued requests. A local Llama 3 on a decent GPU can generate thousands of pages per hour, free from rate limits or outages.
ControlFine‑tune prompts, adjust generation parameters, and rerun entire batches without worrying about cost. I went through ~15 iterations of prompt templates before landing on output that consistently passed quality checks.
PrivacyFinancial data flowing through a third‑party API isn’t ideal. Running locally keeps all data on‑premises.

That said, cloud APIs have their place—for one‑off content, complex reasoning tasks, or when you need the best possible quality on a small number of pages, GPT‑4 or Claude is better. But for batch generation at scale, local is the way to go.

The Template + AI Hybrid

Key concept: AI doesn’t write the entire page; it writes specific sections within a structured template.

Page structure (simplified)

[Header — ticker names, logos, prices]          ← Structured data
[Key Metrics Table — P/E, market cap, etc.]      ← Structured data
[AI Comparison Summary — 2‑3 paragraphs]        ← AI generated
[Dividend Analysis]                             ← Mix of data + AI narrative
[Growth Metrics Chart]                          ← Structured data
[AI Investment Considerations]                  ← AI generated
[FAQ Section]                                   ← AI generated from data
[Schema Markup]                                  ← Auto‑generated

Note: Roughly 60‑70 % of each page is structured data rendered by the template. The AI fills the remaining 30‑40 % that needs natural language — summaries, analysis, and FAQs.

Benefits of the hybrid approach

  • Uniqueness: Every page has different data and different narrative, so Google doesn’t flag it as duplicate content.
  • Accuracy: The AI generates text based on the actual financial data passed in the prompt, not from its training data. This grounds the content in facts and reduces hallucinations.

The Prompt Architecture

I can’t share my exact production prompts (they’re in the full blueprint), but here’s the general approach.

1. Context injection

Every prompt starts with the actual data for that specific stock pair. The AI isn’t generating from scratch — it’s analyzing and narrating data it’s been given.

You are analyzing {STOCK_A} vs {STOCK_B}.

Here is the current financial data:
- {STOCK_A} P/E: {pe_a}, Market Cap: {mcap_a}, Dividend Yield: {div_a}
- {STOCK_B} P/E: {pe_b}, Market Cap: {mcap_b}, Dividend Yield: {div_b}

Write a 2‑paragraph comparison focusing on...

2. Variation instructions

To prevent all pages from sounding the same, I include randomized style directives: vary sentence length, alternate starting with stock A or stock B, and use different comparison frameworks (value vs growth, income vs appreciation, etc.).

3. Output constraints

  • Word‑count limits
  • Formatting requirements (e.g., markdown headings, bullet lists)
  • Explicit “do‑not‑include” rules (no financial‑advice disclaimer in the body, no “as an AI” self‑references, no generic filler phrases)

4. Quality gates

After generation, each piece of content runs through automated checks:

  • Minimum uniqueness score against other generated pages
  • Readability score (e.g., Flesch‑Kincaid)
  • Factual consistency against the source data
  • Keyword‑density checks

What Google’s Helpful Content Update Means for This

Google’s official stance: AI‑generated content isn’t automatically bad. Low‑quality content is bad, regardless of how it’s made.

What I’ve observed across my 287 k pages

Indexed pages tend to haveNot‑indexed pages tend to have
Unique data pointsGeneric narrative that could apply to any stock pair
Specific analysis tied to that dataThin analysis that merely restates numbers
Proper schema markupPatterns that are too similar across pages
Answers to a real search query a human would typeNo clear search intent addressed

Lesson: The AI content must actually say something specific.

  • Thin: “Stock A has a higher P/E than Stock B.”
  • Useful: “Stock A’s P/E of 35 suggests the market expects significant growth, which makes sense given its 40 % revenue increase last quarter, while Stock B’s P/E of 12 reflects a more mature business with stable but slower growth.”

When the narrative provides context, interpretation, and actionable insight, Google treats it as helpful content.

Multilingual Generation

One of the biggest advantages of programmatic SEO is going multilingual cheaply. Here’s how I handle it:

ComponentApproach
Template strings (headers, labels, button text)Translated once by a human translator and stored in locale files (≈ 200‑300 strings per language).
AI narrative sectionsGenerated directly in the target language (not translated from English). The prompt is in English, but I instruct the model to output in the target language with the data injected, which yields more natural‑sounding content.
DataRemains the same across locales (numbers, ticker symbols, percentages). Formatting (date formats, number separators) is handled by the template based on locale.

Result: 12 languages with minimal per‑language effort. The heavy lifting is in building the system; each additional language typically takes 2‑3 days of work.

Cost Breakdown

For anyone wondering about the economics:

ItemCost
Local GPU (one‑time, used RTX 3090)~ $700
Electricity for generation runs~ $5 / batch
Supabase (free tier + small paid)$25 / mo
Hosting (DigitalOcean Spaces)$5 / mo
Cloudflare CDNFree tier
Domain$12 / year

Monthly recurring total: ~ $30 / mo

Compared to paying for API calls at scale or hiring writers, the local LLM pays for itself after generating content for roughly 5 k–10 k pages.

Mistakes I Made

  1. Starting with too many pages – I generated content for 287 k pages before confirming Google would index them. I should have begun with ~5 k, gotten them indexed, then scaled.
  2. Not enough variation in prompts – The first pass used identical prompt structures for every page. The output was technically unique but structurally identical, which Google flagged. Adding randomized style directives in the second pass made a big difference.
  3. Ignoring readability – Early AI output was dense and clinical. Real financial analysis varies between technical detail and accessible explanations, so I had to explicitly prompt for this variation.
  4. No quality gate initially – I generated everything in batch and published it all. Implementing automated quality checks before publishing (catching the bottom 10 % of AI output) prevents thin‑content flags.

The System Today

After iterating, my current pipeline looks like this:

  1. Data refresh – Pull latest financial data via yfinance (daily cron job).
  2. Content generation – Run Llama 3 on pages with stale or missing narrative (weekly).
  3. Quality check – Automated scoring for uniqueness, readability, and factual accuracy.
  4. Build – Astro generates static HTML for all pages.
  5. Deploy – Push to CDN.

The whole thing runs on a single machine. Total human time per week: ~2 hours of monitoring and occasional prompt tweaking.

If you want the full technical details—the exact prompt templates, the quality‑scoring system, the Astro project structure, and the complete deployment pipeline—check out the Programmatic SEO Blueprint. It includes MIT‑licensed code examples you can adapt for your own projects.

Follow for more on building AI‑powered content systems at scale.

0 views
Back to Blog

Related posts

Read more »