Skip to content

JigsawStack/interfaze-comparison-previews

Repository files navigation

interfaze-comparison-previews

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.

Prerequisites

Setup

yarn install

Create 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.

Run a comparison

Both scripts run the two providers concurrently with Promise.all, print timings, and write the full responses to JSON files in the repo root.

Structured research (Chat API)

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_data

Outputs:

  • response_interfaze.json — full Vercel AI SDK result from Interfaze
  • response_parallel.json — full Vercel AI SDK result from Parallel (core model)

Swap Parallel's model in the script between speed, lite, base, and core to trade latency for research depth — see Parallel's model table.

LinkedIn extraction (Extract API vs AI SDK)

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/extract

Outputs:

  • response_parallel_extract.json — raw ExtractResponse with excerpts
  • response_interfaze_extract.json — full AI SDK result with output.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.

Project layout

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).

How the providers are wired

  • Interfaze: standard @ai-sdk/openai with baseURL: "https://api.interfaze.ai/v1".
  • Parallel Chat: same @ai-sdk/openai provider with baseURL: "https://api.parallel.ai" — OpenAI-compatible, so generateText and Output.object work unchanged. Note that Parallel ignores tools, temperature, reasoning_effort, etc. (compatibility table).
  • Parallel Extract: official parallel-web SDK via new Parallel({ apiKey }).extract({ urls, objective }).

Adding a new comparison

  1. Create a new file under compare/<topic>/.
  2. Import createOpenAI from @ai-sdk/openai and generateText + Output from ai.
  3. Wrap each provider call in the run(label, model, outFile) helper pattern used in structured_data.ts so you get consistent timing and JSON dumps.
  4. Drive everything through Promise.all so both providers run in parallel.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors