Skip to main content
Engineering

Batch Extraction with vLLM Over Crawled Pages

Crawl pages with fastCRW, then batch structured extraction through a self-hosted vLLM server. The throughput math and cost per 1,000 pages, worked from first principles.

fastcrw
By RecepDecember 1, 202610 min read

By the fastCRW team · Crawl and pricing figures verified 2026-08-21 · vLLM behavior verified against the vLLM project docs · benchmark your own GPU and model before quoting throughput internally.

Batch extraction with vLLM over crawled pages

Batch extraction with vLLM means separating the two jobs that structured web extraction actually contains: fetching and cleaning pages, and running an LLM over them at volume. fastCRW does the first job well and does not try to do the second at scale — its own LLM extraction path is single-URL and managed, not a bulk batch endpoint. For a job that is 50,000 pages, not 50, running your own vLLM server over crawled markdown is usually cheaper and faster than any per-page hosted extraction call, and the trade-off is that you now own a GPU deployment instead of an API call.

This post covers the split architecture end to end: crawl with fastCRW, hand the markdown to vLLM in one of its two batch modes, and work out what a run actually costs per 1,000 pages using your own measured throughput, not a borrowed number.

Why split crawling from extraction

Crawling and LLM extraction have different scaling shapes, and forcing them through one API call wastes both. Crawling is I/O-bound: network latency, renderer escalation, and anti-bot handling dominate, and the bottleneck is concurrent connections, not compute. LLM extraction is compute-bound: the bottleneck is GPU memory and token throughput, and it batches best when hundreds of prompts queue up together, not when they arrive one request at a time.

fastCRW's own /v1/extract and JSON-schema scrape are built for the first shape — a single URL, a schema, one managed-LLM call, billed per request. There is no multi-URL batch-extract endpoint. That is a deliberate boundary covered in structured extraction with a JSON schema, and it is exactly the boundary this pipeline works around: use fastCRW for what it does well (fetch and clean at scale, cheaply, in parallel), and hand the resulting markdown to a batch inference engine built for the second shape.

Stage one: crawl to clean markdown

Start every batch job with a bounded crawl. POST /v1/crawl runs an async breadth-first crawl from a seed URL and returns a job ID; poll GET /v1/crawl/:id until it completes. Each page comes back as clean markdown with the navigation, ads, and boilerplate already stripped — that matters here more than usual, because every token you feed vLLM is a token you pay GPU time for, and raw HTML is mostly tokens you do not want.

curl -X POST https://api.fastcrw.com/v1/crawl \
  -H "Authorization: Bearer crw_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/products",
    "maxDepth": 2,
    "limit": 500,
    "scrapeOptions": { "formats": ["markdown"] }
  }'

# poll:
curl https://api.fastcrw.com/v1/crawl/<crawl_id> \
  -H "Authorization: Bearer crw_live_..."

A crawl job is capped (maxDepth up to 10, page limit up to 1000), so a 50,000-page batch is many bounded jobs, not one unbounded sweep. Each crawled page costs 1 credit regardless of renderer, and self-hosting the engine (AGPL-3.0) removes that per-page cost entirely if you are running recurring large batches — the same trade-off covered in AGPL vs MIT/Apache scrapers. Write the crawl output to disk or object storage as it lands; stage one and stage two should not be one process, because a GPU box restarting should never mean re-crawling.

Stage two: batch inference with vLLM

vLLM has two batch modes and the right one depends on whether your extraction job is a one-shot run or a standing service.

Offline batch: LLM.generate() over a prompt list

For a one-shot job — extract a fixed set of crawled pages once — use vLLM's offline batch API. It loads the model, takes a Python list of prompts, and uses continuous batching internally to pack the GPU efficiently without you managing a request queue:

from vllm import LLM, SamplingParams
import json

llm = LLM(model="Qwen/Qwen2.5-7B-Instruct", quantization="awq")
sampling_params = SamplingParams(temperature=0, max_tokens=512)

def build_prompt(markdown: str, schema: dict) -> str:
    return (
        f"Extract JSON matching this schema:\n{json.dumps(schema)}\n\n"
        f"Page content:\n{markdown[:8000]}\n\nJSON:"
    )

pages = json.load(open("crawled_pages.json"))  # [{url, markdown}, ...]
prompts = [build_prompt(p["markdown"], schema) for p in pages]

outputs = llm.generate(prompts, sampling_params)

records = []
for page, out in zip(pages, outputs):
    try:
        records.append({"url": page["url"], **json.loads(out.outputs[0].text)})
    except json.JSONDecodeError:
        records.append({"url": page["url"], "error": "unparseable"})

This is the mode to reach for by default: it needs no server process, and vLLM's PagedAttention scheduler keeps GPU memory packed across the whole prompt list, which is where the throughput actually comes from.

Online serving: vllm serve for a standing pipeline

If extraction is a recurring job fed by scheduled crawls (see scheduled crawls with cron), run vLLM as a long-lived OpenAI-compatible server instead, and send concurrent requests from your crawl-ingest worker as pages arrive:

vllm serve Qwen/Qwen2.5-7B-Instruct --quantization awq --port 8000

Continuous batching means concurrent requests hitting this server get packed into the same in-flight batches as they arrive, without you writing a queue — but you now own uptime, autoscaling, and idle GPU cost between crawl runs. Offline batch has no idle cost because the process exits when the list is done; online serving has idle cost but no cold-start-model-load per run. Pick based on whether the job runs on a schedule with idle gaps or continuously.

Prompt batching mechanics, briefly

Continuous batching is what makes vLLM the right tool here instead of calling a model API per page in a loop. A naive loop pays the fixed per-request overhead (queueing, KV-cache allocation, first-token latency) once per page. Continuous batching folds new prompts into the currently-running GPU batch as soon as memory allows, instead of waiting for the whole batch to finish before starting the next one — so GPU utilization stays high even when prompts finish at different token lengths, which extraction prompts always do (a thin product page finishes in 100 tokens, a long article page in 800).

The practical implication for extraction jobs specifically: keep prompts short and schema-constrained. max_tokens in SamplingParams caps output length per request, and a tight schema with short field values (not open-ended summaries) keeps average output tokens low, which is the single biggest lever on throughput in this workload.

Throughput math and cost per 1,000 pages

Do not carry over a number from a blog post here — GPU, model size, quantization, and prompt length all move the answer by multiples. Measure your own throughput on a representative sample of your actual crawled pages, then use this formula:

VariableWhat it isHow to get it
Rtokens/sec throughput on your GPU, model, and quantizationtime a 200-prompt offline batch run, sum output tokens, divide by wall-clock seconds
Taverage output tokens per extractionmeasure on the same sample
Chourly cost of the GPU instanceyour cloud provider's on-demand or spot rate
  1. Pages per hour: (R / T) × 3600
  2. Cost per 1,000 pages: (1000 / pages_per_hour) × C

Two levers dominate the result, in order: T (shrink it with a tighter schema and a lower max_tokens cap — this is the cheapest win and the one most teams skip), then GPU choice (a smaller quantized model on a cheaper card frequently beats a larger model on a bigger card for structured extraction, because the task rarely needs the extra parameters a bigger model buys). Run the formula once before committing to a GPU tier; a 30-minute benchmark on a rented instance is worth more than any published number, including this one.

Where this pipeline is not the right call

Two cases where running your own vLLM box is the wrong trade:

  • Occasional or small-batch extraction. If the job is dozens or a few hundred pages a day, not thousands, the GPU idle cost and ops overhead of vLLM outweighs anything you save versus calling fastCRW's managed /v1/extract per page and letting it handle the LLM call.
  • No GPU ops capacity. vLLM is a real deployment: model weights, quantization choices, memory tuning, and a server to keep alive if you run it in serving mode. A team without infra time to own that should stay on a managed per-request extraction call even at a higher per-page price, because the managed path trades money for time you do not have to spend on GPU babysitting.

In both cases, the crawl stage does not change — you still want clean markdown, not raw HTML, feeding whichever extraction path you choose.

Reliability of the crawl stage

Everything above assumes stage one actually returns the pages you asked for. On Firecrawl's public 1,000-URL labeled dataset, fastCRW recorded 63.74% truth-recall (522 of 819 labeled URLs), ahead of Crawl4AI (59.95%) and Firecrawl (56.04%), with 87.7% scrape-success (877/1,000) and 0 thrown errors across 3,000 requests (diagnose_3way.py, 2026-05-08). Scrape p50 was 1,914 ms. A dropped or thin page at the crawl stage is a silent gap in the batch you send to vLLM — no amount of prompt engineering recovers a page that never made it into the prompt list, so recall at stage one is worth checking before you scale stage two. Full numbers at /benchmarks.

Sources

FAQ

Frequently asked questions

Why not use fastCRW's own LLM extraction for the whole batch?
fastCRW's /v1/extract and JSON-schema scrape run one URL per call through a managed LLM, billed per request. There is no multi-URL batch-extract endpoint, so for tens of thousands of pages a self-hosted batch engine like vLLM is typically cheaper and faster once you own the GPU deployment.
Should I use vLLM's offline batch mode or the OpenAI-compatible server?
Use offline batch (LLM.generate over a prompt list) for a one-shot extraction run over a fixed set of crawled pages, since the process exits when done with no idle GPU cost. Use vllm serve when extraction is a recurring job fed by scheduled crawls and needs to stay warm between runs.
How do I estimate cost per 1,000 pages before committing to a GPU?
Time a 200-prompt offline batch on your actual model and quantization to get tokens/sec throughput (R) and average output tokens per page (T). Pages per hour is (R / T) x 3600; cost per 1,000 pages is (1000 / pages_per_hour) x your GPU's hourly rate. Measure on your own hardware rather than reusing a published figure.
What is the single biggest lever on vLLM extraction throughput?
Average output tokens per extraction (T). A tight JSON schema with short field values and a low max_tokens cap in SamplingParams cuts T directly, which is usually a bigger win than upgrading GPU tier.
Does the crawl stage matter if the extraction is handled by my own vLLM box?
Yes. A page dropped or returned thin at the crawl stage never reaches the prompt list, so no batching or prompting fixes it downstream. fastCRW's measured truth-recall on Firecrawl's public labeled dataset is 63.74%, ahead of Crawl4AI and Firecrawl in the same test, which is what feeds a complete batch into vLLM in the first place.

Get Started

Try fastCRW free

Run a live request in the playground, no signup required. Or grab a free API key with 1000 free credits, no credit card.

Continue exploring

More engineering posts

View category archive