Open app

AI Models & Generation Pipeline

A precise look at the AI engines behind theStacc - a Claude writing engine that plans then writes, an OpenAI image engine, how images and status work, and the timeouts and retries that keep generation reliable.

This is the technical companion to How the AI works. If you want the plain-English overview, start there. This article goes one level deeper: which engines do what, the exact steps a blog post moves through, and the timeouts, retries, and status signals that keep generation reliable. You never configure any of this - it is here so you understand what is happening behind the scenes.

The writing engine#

Long-form writing - blog posts, content plans, and the brand and analysis work behind them - runs on Claude (a Sonnet-class model from Anthropic). It is the engine that does the heavy reasoning.

For a blog post, the engine does not simply start typing. It follows a strict two-step flow:

  1. Plan the post. First it calls an internal plan_blog_post step that produces the title, a meta description, a full section-by-section outline (H2 and H3 headings with key points), an image plan, an estimated word count, and a set of SEO tags. Locking the structure in first is what keeps posts organised and on-topic instead of meandering.
  2. Write the post. Then it calls a write_blog_post step that produces the complete article as clean HTML - headings, paragraphs, lists, internal-link markers, and image placeholders - matched to the plan it just made.

A few things worth knowing about how the writing engine is tuned:

  • It runs at a low-creativity, consistent setting. The engine is deliberately configured for steady, predictable output rather than wild improvisation, so two posts on the same brief come out comparable in quality and tone.
  • It is bounded. Each generation gets a fixed number of internal steps to finish. If it can't complete a post in that budget, it stops cleanly and marks the post as failed (with a Retry option) rather than looping forever.
  • It has a hard 45-minute ceiling. A single blog generation is capped at 45 minutes end to end. That window is generous on purpose - it leaves room for roughly 30 minutes of automatic API retry (see Resilient retries below) on top of the normal planning, writing, and image work.

Your content plan also feeds the writing engine the context it needs: your business profile, brand voice, the keyword for the day, your other recently published titles (so the engine avoids repeating itself), and any compliance requirements for regulated industries. That context is what makes each post specific to your business instead of generic.

The image engine#

Images - hero images and in-article illustrations - are produced by a dedicated OpenAI image model. (theStacc migrated to it from Google's Gemini image model in May 2026.) Every image is generated fresh for its placement; nothing is pulled from a stock library or the web.

Aspect ratios#

The image plan decides what each image should show and its shape. Supported aspect ratios are:

  • 16:9 - the default, used for wide hero images and most in-article visuals
  • 4:3
  • 1:1 - square
  • 3:4 - portrait

Each image is sized to its slot so it fits its destination cleanly, without awkward cropping or stretching.

Format, filenames, and where images live#

Every generated image goes through the same finishing steps so your published pages stay fast and tidy:

  • Converted to WebP. Images are generated as PNG and then converted to WebP, which is typically 30-50% smaller with no visible quality loss. Smaller images mean faster page loads and better Core Web Vitals scores - the page-speed signals search engines care about. If the conversion ever fails for a particular image, theStacc falls back to PNG so a publish is never blocked.
  • Stored in cloud storage, served as public URLs. Finished images are uploaded to secure cloud storage and served from a stable public URL, so they load reliably wherever your post is published.
  • SEO-friendly filenames. Instead of an opaque string of characters, each image gets a readable, descriptive filename derived from what the image depicts (for example solar-installation-rooftop-...webp). This helps with image SEO and makes mirrored images readable on your own site.

How a blog post is generated, start to finish#

Here is the full pipeline for a single post:

  1. Plan. The writing engine produces the title, outline, image plan, and tags.
  2. Write. The writing engine produces the full HTML article, with placeholders (IMAGE_1, IMAGE_2, and so on) wherever an image should appear. At this point the text is saved and becomes visible to you immediately, even though the images aren't ready yet.
  3. Generate images in parallel. Once the text is saved, theStacc generates all the planned images at the same time (in parallel) rather than one after another, which keeps generation fast. As each image finishes, it replaces its matching placeholder in the article.
  4. Pick the featured image. The featured image is chosen automatically - it is the post's hero image, or, if there isn't a dedicated hero, the first image that generated successfully.
  5. Ready for review. When the images are done, the post moves to a ready-for-review state and (if your project is set to auto-publish) hands off to the publishing pipeline.

Because the text is saved before the images, you can start reading and editing a post while its visuals are still being produced.

If some images fail#

Image generation is the part most likely to hit a transient hiccup. theStacc handles a partial failure gracefully: the text and any images that did succeed are all kept, the post still moves to ready-for-review, and you get a Retry images option that regenerates only the missing images. Retrying images does not re-run the writing engine, so you don't pay for or wait on the article being rewritten - and your saved text is never overwritten.

Generation status and progress#

While a post generates, theStacc tracks its progress and surfaces it to you so you are never staring at a blank screen. As generation moves through its stages, the status message updates roughly like this:

  • Planned - "Blog planned, writing content..."
  • Writing - "Content ready, generating images..."
  • Generating images - "Generating 3/4 images..." (the count climbs as images finish)
  • Complete - "Blog post generated successfully"

The dashboard polls for these updates as the post is built, so the progress you see reflects what is actually happening. Alongside the status message, theStacc tracks the post's word count, how many images have been generated so far (images_generated), and how many are planned in total (images_total), so you can watch the post come together.

Resilient retries when the AI is busy#

AI services occasionally get busy and return a temporary "overloaded" or rate-limit response. theStacc treats these as transient and retries automatically, with escalating waits between attempts, for up to about 30 minutes before giving up. During that time, your post's status updates to a message like "AI service busy, retrying..." (with the attempt count and elapsed time) so you can see it is working, not stuck.

Not every error is retried. A genuinely permanent problem - for example an authentication or account-configuration issue - is not retried, because waiting wouldn't help. In that case the post fails quickly and shows a clear message instead of spinning for half an hour.

This 30-minute retry budget is exactly why the overall generation timeout is set at 45 minutes - the extra headroom lets theStacc ride out a long AI outage and still finish your post once the service recovers.

For the full picture of how failures are caught and recovered, see AI Error Recovery & Retries.

Stuck-generation detection#

Very rarely, a generation can stall - for example if a worker process is interrupted mid-run by a deploy or a crash. To make sure a post never sits in limbo, theStacc watches for posts that have been in the generating state for longer than 45 minutes. Any post that crosses that line is automatically flipped to a failed state with a Retry option, so it surfaces to you quickly instead of appearing to hang indefinitely. This safety sweep runs both when you open a generating post and on a background schedule, so a stuck post gets cleaned up either way.

Live data behind the scenes#

The AI engines don't work from guesses alone - planning and tracking are grounded in real signals:

  • Content planning reflects real keyword and search demand, so the topics theStacc picks map to what people are actually searching for, not random ideas.
  • Local ranking data powers your "near me" and Map Pack tracking. For Local SEO keywords, theStacc records real search volume and difficulty alongside live ranking positions (your Maps rank, Local Pack rank, and organic rank) and when they were last checked - so your local reports reflect what searchers actually see.