What Programming Languages Does OmniRoute Use? Core Stack Explained
TLDR: OmniRoute is built entirely in TypeScript, running on Node.js 22+ with Next.js 16 powering the web layer, React 19 handling the UI, and Electron providing the cross-platform desktop client.
The open-source OmniRoute repository (diegosouzapw/OmniRoute) is a modular AI router that relies on a unified TypeScript codebase to deliver its web API, desktop application, and command-line interface. Understanding what programming languages OmniRoute uses reveals a modern, JavaScript-centric architecture that compiles to ES Modules for execution. Every component—from the streaming engine to the prompt compression modules—is authored in TypeScript and targets Node.js version 22 or higher.
TypeScript as the Sole Primary Language
OmniRoute adopts a full-stack TypeScript strategy where all source files use .ts or .tsx extensions. The project leverages TypeScript 6 features and compiles to JavaScript for the Node.js runtime. This approach ensures type safety across the API layer, streaming handlers, and user interface without introducing polyglot complexity.
Server-Side Runtime and APIs
The backend implementation resides in src/app/api/v1/*, utilizing Next.js 16 App Router conventions. The main entry point at src/app/api/v1/chat/completions/route.ts handles OpenAI-compatible requests, validates them with Zod, and forwards them to the streaming engine. Core request processing logic lives in open-sse/handlers/chatCore.ts, where the Responses API transformer and provider executors are implemented in pure TypeScript.
Desktop Application Layer
For native desktop deployment, OmniRoute uses Electron. The entry point at electron/main.ts boots an embedded Node process that serves the same Next.js application used in the web deployment. This allows the desktop client to reuse the exact TypeScript source code powering the browser version, ensuring feature parity across platforms.
Command Line Interface
The CLI is implemented as a Node.js executable at bin/omniroute.mjs. Generated from the API schema via scripts/build/generate-cli-api.mjs, this script exposes routing and debugging commands:
# Launch the Next.js development server
npm run dev
# List available routing combos via CLI
omniroute list-combos
Data Layer and Native Dependencies
While TypeScript dominates the codebase, OmniRoute selectively incorporates native Node.js modules for performance-critical operations.
SQLite and Vector Storage
The data layer uses SQLite via the native better-sqlite3 package (optional dependency). Database connections and encryption helpers are centralized in src/lib/db/core.ts. For vector operations, the project employs sqlite-vec alongside lowdb for JSON-based storage, all accessed through TypeScript wrappers.
Optional Machine Learning Bindings
Specific deployment configurations may include optional native modules like @tensorflow/tfjs. These C++-backed dependencies are installed only when required and do not alter the primary TypeScript architecture.
Web Stack and UI Technologies
The user interface layer combines modern frontend technologies authored in TypeScript:
- Next.js 16: Provides the App Router structure under
src/app/ - React 19: Powers component logic and state management via Zustand
- Tailwind CSS v4: Handles styling across the application
- next-intl: Manages internationalization, with configuration files under
src/app/i18n/
Build, Test, and Quality Tooling
The development toolchain remains TypeScript-centric:
- Compilation: TypeScript 6 with SWC for fast transpilation
- Runners: Support for both
tsxandbunexecution environments - Testing: Vitest for unit testing, Playwright for end-to-end testing, and Stryker for mutation testing
- Linting: ESLint and Prettier enforce code standards, with Husky managing pre-commit hooks
Summary
- Primary Language: TypeScript (
.ts/.tsx) across web, desktop, and CLI - Runtime: Node.js ≥22 with ES Modules
- Web Framework: Next.js 16 App Router with React 19 frontend
- Desktop: Electron wrapping the Next.js application
- Database: SQLite via native
better-sqlite3bindings - CLI: Node.js executable generated at
bin/omniroute.mjs - Testing: Vitest and Playwright for comprehensive coverage
Frequently Asked Questions
Is OmniRoute written purely in TypeScript?
Yes. According to the source code in diegosouzapw/OmniRoute, every layer—from the API routes in src/app/api/v1/ to the streaming engine in open-sse/handlers/ and the Electron main process—is authored in TypeScript. Optional native dependencies exist for SQLite and ML operations, but all application logic is TypeScript.
What Node.js version does OmniRoute require?
The project requires Node.js version 22 or higher, as declared in package.json. This version baseline ensures compatibility with modern ES Module features and the undici HTTP client used throughout the provider integrations.
Does OmniRoute use any compiled native languages like C++ or Rust?
The core architecture uses TypeScript exclusively, but the project optionally leverages native Node.js modules such as better-sqlite3 (C++) for database performance and @tensorflow/tfjs (C++ bindings) for machine learning. These are optional dependencies installed only when specific features are enabled.
What framework powers the OmniRoute user interface?
The UI is built with React 19 and styled using Tailwind CSS v4, all served through Next.js 16. Electron wraps this web stack to create the desktop application, allowing the TypeScript React components to render natively on Windows, macOS, and Linux.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →