About Services Tools Blog Contact us

Private Model Batch Runner

Runs a Gemma model over many records on a private machine, falls back to a lighter model if busy and writes answers back. Stops if too many fail.

  • Agentic Workflows
  • Cross-sector
  • Agent skill
  • Productised
  • Hybrid
  • 2026

The problem

Enriching thousands of private records kept stalling. The remote model was busy, or the database connection dropped during a slow reply, or one bad record was retried forever. Each site also called the model in its own way, so every fix had to be made more than once.

What it does

The runner tries a heavier Gemma model on another machine over a private network, then a lighter model on the local machine. Scripts walk the unprocessed records, ask for a fixed answer layout and write the answers back. If several records fail in a row the batch stops, and a rerun carries on from the last saved record.

Outcomes

  • Every processed record has a category, summary or extracted details.
  • The log shows when a run switched from the main machine to the local fallback.
  • Records already done are skipped, so a stopped batch can resume.
  • One shared helper replaces a different model request in every part of the site.

Simplified mockup

Interactive preview with sample data. Nothing is sent to a server.

Catalogue enrichment

Idle
Stored
10
Open
10
Breaker
Closed
Shape
XML
Rows already stored are skipped, so a stopped run can resume.
Run
Primary first, then the local fallback
  1. Check hosts
  2. Walk open rows
  3. Call a model
  4. Write or stop
10 rows already stored. 10 still open. Breaker closed.
Queue
CodeItemStatusHostCategorySummary
NQ1104Oak latchdonePrimaryIronmongerySolid oak privacy latch
NQ1108Wool stair runnerdonePrimaryTextilesWool runner for a staircase
NQ1211Enamel jugdonePrimaryHousewaresCream enamel milk jug
NQ1220Brass picture lightdonePrimaryLightingSmall brass picture light
NQ1302Linen cushiondonePrimaryTextilesStonewashed linen cushion
NQ1314Stoneware planterdonePrimaryGardenGrey stoneware planter
NQ1406Beech coat hookdonePrimaryIronmongeryTwin beech coat hook
NQ1418Cotton bath sheetdonePrimaryTextilesHeavy cotton bath sheet
NQ1503Slate house signdonePrimaryGardenSlate house number plaque
NQ1519Rattan rackdonePrimaryFurnitureRattan magazine rack
NQ2104Ceramic soap dishqueuedwaiting––
NQ2116Ash picture ledgequeuedwaiting––
NQ2208Wool throwqueuedwaiting––
NQ2221Iron curtain polequeuedwaiting––
NQ2307Glass bud vasequeuedwaiting––
NQ2315Oak boot trayqueuedwaiting––
NQ2402Linen napkinsqueuedwaiting––
NQ2411Brass cabinet knobqueuedwaiting––
NQ2506Stone door stopqueuedwaiting––
NQ2514Cotton tea towelqueuedwaiting––

Hosts

both ready
Primary
Heavy
Private network, ready
Local fallback
Light
This machine, ready
Rows finished last week
Last completed pass
PassRowsFallbackStop
Monday morning1806completed
Thursday afternoon31022completed
Friday cut short408breaker

Shared prompt

XML only
Extract a category and a short summary. Output only XML. <response> <category></category> <summary></summary> </response>

If the markup is slightly off, a second parse still lifts the two fields. The database connection is closed during the call and opened again to store them.

Loop rules
RuleSetting
Retry on the primaryOnce, then the local model
Pause between rowsA short sleep
Consecutive failuresStop at five
Already writtenSkip, so a rerun resumes

How it works

  1. Check which machine and model answer before a long run starts.
  2. Walk unprocessed database or spreadsheet records with a shared instruction.
  3. Try the main machine with a short retry, then the local fallback, and record which one answered.
  4. Ask for a fixed answer layout only, and read it with a backup method if it is slightly off.
  5. Close the database link during the model call and reopen it to store the answers.
  6. Pause between records and stop after a run of failures.

Pipeline

flowchart LR
  A[Unprocessed rows] --> B[Prompt]
  B --> C[Gemma]
  C --> D[Lighter Gemma]
  D --> E[XML parse]
  E --> F[Write row]
  F --> G[Circuit breaker]