Skip to content

ThinkEx-OSS/filerouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileRouter

FileRouter

FileRouter SDK on npm FileRouter documentation GitHub stars Join Discord

Durable document parsing across providers.

FileRouter gives you one TypeScript SDK and CLI for durable document parsing across providers. Choose a parser, compare the same document across parsers, or call providers directly with your own keys.

What FileRouter handles

Each parser has its own SDK, input rules, options, async job flow, and response shape. Supporting more than one usually means rebuilding the same document pipeline. FileRouter handles that work behind one interface:

  • Inputs: pass a file path, URL, File, Blob, buffer, or stream.
  • Provider adapters: keep each provider's authentication and options separate without changing the rest of your app.
  • Long-running jobs: hosted processing manages uploads, provider submission, polling, timeouts, result storage, and cleanup.
  • Consistent results: work with the same page numbering, outputs, timing, warnings, and errors across providers.
  • Side-by-side comparisons: parse a document with multiple providers at once and keep each success or failure in one result.

Start with one parser today. Switching or comparing later is a configuration change, not another document integration.

Get started

Install the SDK:

npm install @file_router/sdk

Parse a document with the hosted API:

import { FileRouterClient } from "@file_router/sdk"

const client = new FileRouterClient({
  apiKey: process.env.FILEROUTER_API_KEY,
})

const result = await client.parse("https://example.com/report.pdf", {
  provider: "llamaparse",
  outputs: ["markdown"],
})

console.log(result.outputs.markdown)

Or use the CLI:

npx @file_router/cli@latest login
npx @file_router/cli@latest parse report.pdf

Hosted or direct

Hosted API Direct with your keys
Best for The fastest setup Keeping provider calls in your runtime
Authentication One FileRouter API key Your provider API keys
Document sent through FileRouter, then the selected provider The selected provider only
TypeScript FileRouterClient FileRouter
CLI Default after filerouter login Add --local

Direct TypeScript example:

import { FileRouter } from "@file_router/sdk"
import { llamaparse } from "@file_router/sdk/llamaparse"

const router = new FileRouter({
  providers: { llamaparse: llamaparse() },
})

const result = await router.parse("./report.pdf", {
  provider: "llamaparse",
  outputs: ["markdown"],
})

Adapters

  • LlamaParse for layout-aware document parsing.
  • Mistral OCR for OCR with structured document output.
  • Datalab for document conversion and extraction.

More adapters are coming.

Development

FileRouter requires Node.js 22.14 or newer.

vp install
pnpm dev

Run the checks before pushing changes:

pnpm check
pnpm test

Community

FileRouter is open source under the MIT License.

About

One TypeScript SDK for durable document parsing across providers: optimize for accuracy, reliability, latency, and cost.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors