deniz.in

Markets

Weather

Loading weather

· via Vercel blog

Vercel AI Gateway adds extraction models for structured fields from text, images and PDFs

Vercel's AI Gateway now supports extraction models, starting with ScaleDown Extract-1, which returns structured fields such as invoice numbers and contact lists from text, images and PDFs.

Vercel AI Gateway adds extraction models for structured fields from text, images and PDFs

Vercel has added extraction models to its AI Gateway, expanding the platform beyond chat and generation into a job many applications actually need: pulling specific values out of messy content and handing them back as structured fields. According to the Vercel changelog, the first model available is ScaleDown Extract-1, which can locate things like invoice numbers or contact lists in text, images and PDFs and return them in a form application code can consume directly.

How the extraction model works

Developers describe the data they want as named fields, each carrying a type and a short natural-language instruction explaining what to look for. Extract-1 supports two field shapes: single text values and lists of text values. Every key defined in the request produces a matching entry in the response, and when the model cannot find a value, that field comes back as null instead of failing the whole call — a sensible behaviour for documents where some information is simply absent.

Vercel says the model also returns a confidence score between 0 and 1 for each match, down to individual items inside lists, which makes it possible to single out low-confidence results for human verification. For plain text input, Extract-1 can additionally return character offsets that locate each match within the source, so answers can be checked against the original document rather than taken on trust.

Available through the AI SDK

For now, extraction is exposed only through the AI SDK rather than as a general-purpose HTTP interface. It requires version 7.0.176 or later of the ai package and relies on an experimental_extract function together with the model identifier scaledown/extract-1.

The interface follows the SDK's existing conventions. A state parameter carries the content to analyse — either a plain string or an array of parts — while a fields object describes the desired output. In one of Vercel's examples, a short invoice string yields an invoice number and a list of contact names; in another, a PDF invoice is read from disk and passed as a file part with the application/pdf media type, and the model returns the issuing vendor, the total and the line items.

Operationally, extraction calls show up in the gateway's existing logs and spend tracking, so usage and cost for this new model type land in the same accounting as the rest of an application's AI traffic.

Why it matters

Turning unstructured documents into clean, typed fields has long been one of the highest-volume practical uses of language models, and it has usually been done indirectly: developers prompt a chat model, wrap the output in a JSON schema, and then cope with malformed or half-invented responses. A purpose-built extraction model that returns fields, per-match confidence scores and source offsets turns that workaround into a first-class API primitive. The confidence scores matter especially, because they give teams a principled basis for deciding which results can flow straight into a database and which need a person to look at them.

Routing the capability through AI Gateway also folds document processing into the platform's unified logging, spend limits and provider abstraction. The constraints are worth flagging: the API is experimental, it is tied to the AI SDK, and ScaleDown is the only provider at launch, so anyone building on it today is depending on Vercel's roadmap for broader availability and portability.

  • #vercel
  • #ai-gateway
  • #ai-sdk
  • #structured-data
  • #document-processing

Related posts