Side-by-side scripts that run the same task through Interfaze and Parallel so you can compare latency and output quality. Everything goes through the latest Vercel AI SDK (v6) — Parallel's OpenAI-compatible Chat API plugs into @ai-sdk/openai via a custom baseURL, while Parallel's Extract API uses the official parallel-web SDK.
- Node.js 20 LTS or newer
- API keys for the providers you want to test:
INTERFAZE_API_KEY— interfaze.aiPARALLEL_API_KEY— platform.parallel.ai
yarn installCreate a .env at the repo root with your keys:
INTERFAZE_API_KEY="..."
PARALLEL_API_KEY="..."tsx's --env-file=.env flag loads them at runtime — no dotenv import needed.
Both scripts run the two providers concurrently with Promise.all, print timings, and write the full responses to JSON files in the repo root.
Asks both providers to research the founders of a company and return a typed object (name, LinkedIn, X profile, email, work history). Uses generateText + Output.object({ schema }), the v6 replacement for the now-deprecated generateObject.
tsx --env-file=.env compare/parallel/structured_dataOutputs:
response_interfaze.json— full Vercel AI SDK result from Interfazeresponse_parallel.json— full Vercel AI SDK result from Parallel (coremodel)
Swap Parallel's model in the script between speed, lite, base, and core to trade latency for research depth — see Parallel's model table.
Scrapes a public LinkedIn profile for work experiences. Parallel runs through its dedicated Extract API (markdown excerpts focused on an objective); Interfaze runs through generateText + a Zod schema.
tsx --env-file=.env compare/parallel/extractOutputs:
response_parallel_extract.json— rawExtractResponsewith excerptsresponse_interfaze_extract.json— full AI SDK result withoutput.experiences[]
The shapes differ on purpose — each API is asked to do what it does natively. To force structured output for Parallel too, pipe its excerpts through another generateText call with the same schema.
compare/parallel/
structured_data.ts # Chat API comparison
extract.ts # Extract API vs AI SDK comparison
Response JSON files are written to the repo root and are not committed (.gitignore).
- Interfaze: standard
@ai-sdk/openaiwithbaseURL: "https://api.interfaze.ai/v1". - Parallel Chat: same
@ai-sdk/openaiprovider withbaseURL: "https://api.parallel.ai"— OpenAI-compatible, sogenerateTextandOutput.objectwork unchanged. Note that Parallel ignorestools,temperature,reasoning_effort, etc. (compatibility table). - Parallel Extract: official
parallel-webSDK vianew Parallel({ apiKey }).extract({ urls, objective }).
- Create a new file under
compare/<topic>/. - Import
createOpenAIfrom@ai-sdk/openaiandgenerateText+Outputfromai. - Wrap each provider call in the
run(label, model, outFile)helper pattern used instructured_data.tsso you get consistent timing and JSON dumps. - Drive everything through
Promise.allso both providers run in parallel.