Skip to content

Ryuk1811/Duplex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Duplex 🚄

License: AGPL v3 TypeScript React

Duplex is a highly advanced, zero-backend, client-side multiplexed LLM inference engine. It empowers developers, researchers, and prompt engineers to test, route, and benchmark multiple local and cloud-based artificial intelligence models simultaneously in real time.

Built with absolute privacy and maximum performance in mind, Duplex removes the middleman out of AI inference. By connecting your browser directly to the providers of your choice, it enables unprecedented side-by-side comparison capabilities with deep, hardware-level telemetry.


🌟 Core Architectural Blueprint

1. Parallel Inference. Zero Backend. Complete Sovereignty.

Duplex is designed as a developer-first, client-side LLM workspace that runs multiple models (local + cloud) simultaneously without intermediate server proxies or tracking nodes.

2. Direct AI Inference Pipeline

  • Direct Channel Handshake: Direct, low-latency socket connections with the foundation model APIs (OpenAI, Anthropic, Gemini, Groq, etc.).
  • Zero-Proxy Routing: Payload tokenization and streaming executed purely client-side, bypassing middleman processing layers.
  • Dynamic Telemetry Trace: Live rendering HUD displaying tokens per second (TPS), Time To First Token (TTFT), dynamic context length tracker, and DOM frame update rates (16ms throttle).

3. Browser-Based On-Device ML

  • Hardware Acceleration (WebGPU/WASM): Direct client-side inference utilizing local hardware resources directly inside the browser sandbox.
  • Sovereign Weights Loading: Run multi-billion parameter models (e.g., Llama 3 8B, Qwen, Phi) locally using INT4 quantization entirely on-device with absolute data privacy.
  • Ollama & LM Studio Bindings: Plug-and-play handshakes with local LLM daemons to integrate self-hosted GGUF weights into comparative lanes.

🌟 Key Features

  • V2 Concurrency Engine: Test frontier cloud models alongside local hardware weights synchronously. Prompt multiple distinct models with a single click and watch their response streams populate side-by-side in real-time.
  • Extensive Model Support: Out-of-the-box support for OpenAI, Anthropic, Google Gemini, Groq, Mistral, xAI (Grok), DeepSeek, OpenRouter, Together AI, Fireworks AI, Cohere, and local Ollama/LM Studio endpoints.
  • Dynamic Layout Topologies: Switch instantly between highly optimized viewing modes including Side-by-Side, Grid, Tree, and Stacked layouts. Seamlessly manage multiplex lanes with custom horizontal scroll mechanics for fluid 4+ model comparisons.
  • Absolute Privacy & Zero-Backend Architecture: Duplex operates entirely inside your browser environment. API keys are strictly used to communicate with the exact model providers or your local nodes. There are no middleware proxy logging mechanisms, trackers, or hidden servers. Your conversation data never leaves your machine unless explicitly sent to a model provider.
  • Secure Hardware Configurations: Ultra-high contrast solid settings configuration panels. Credentials are visually masked with an integrated Show/Hide Key visibility toggle, preventing layout shifts or cursor overlap bugs.
  • Internal Scroll Lexicon: A high-density 3x2 unit frame grid in the Local Lexicon directory. Showcases up to 6 articles per screen bound within a custom scrollable viewport container, preserving page dimensions while enabling fluid, touch-optimized swipe exploration.
  • Decoupled WebRTC Sync: Featuring a "Duplex Decoupled Engine" utilizing PeerJS for true peer-to-peer real-time synchronization. Share your active state securely across devices via a unique Sync ID without any centralized database.
  • Offline State Persistence: Enjoy continuous session data preservation decoupled from traditional backend network databases. Your chat history, workspaces, and telemetry logs stay entirely on your device via IndexedDB.

🚀 Deep Telemetry & Diagnostics

To satisfy both power users and builders, Duplex integrates low-level engineering metrics inside a high-fidelity cybernetic UI via the Deep Telemetry Console.

  • Granular Performance Vitals: Empirically benchmark network layers by tracking Time To First Token (TTFT), Tokens Per Second (TPS), and total network latency alongside response generation.
  • Hardware & Environment Monitoring (H-Plane): Duplex implements hardware monitoring layers detecting memory heap utilization, V-Sync rendering thread jitters, active node counts, and host location resolving to ensure your browser handles high-frequency streams gracefully.
  • Diagnostic Tracing: Emits raw multi-layer telemetry summaries detailing handshake configurations, DOM render chunks, and thread lags meant for debugging cross-origin connectivity.
  • Adaptive Viewport Scaling: Overcomes physical limitations on smaller devices through synchronized flex snap-scrolling, making massive multi-model comparisons fluid and stutter-free.

🔌 Connecting Local Models (Ollama, LM Studio)

Since Duplex operates almost entirely on the client side, connecting to a locally hosted LLM requires bypassing basic CORS (Cross-Origin Resource Sharing) blockades on your OS daemon.

Resolving CORS (Ollama example)

To allow Duplex to stream from your localhost:11434, you must start Ollama with the allowed origins parameter setup.

macOS:

launchctl setenv OLLAMA_ORIGINS "*" && ollama serve

Windows:

setx OLLAMA_ORIGINS "*" && ollama serve

Linux:

OLLAMA_ORIGINS="*" ollama serve

Once running, simply add your custom http://127.0.0.1:11434 or network endpoint directly into the Duplex settings panel. Duplex automatically tests the handshake and populates your installed local GGUF models.


⚡ Use Cases

  • AI Researchers & Prompt Engineers: Optimize your prompts against the top frontier models to objectively find the best outputs, format adherence, and lowest hallucination rates.
  • Cost / Speed Optimization: Compare the exact Token-Per-Second output and TTFT latency of your self-hosted instance (e.g., Llama-3 8B) vs. Cloud equivalents (e.g., GPT-4o-mini).
  • Offline / Edge Workers: Need to work with highly confidential data or completely offline? Run entirely offline combining Duplex and Ollama/LM Studio without any internet connectivity.
  • Collaborative Debugging: Utilize the P2P WebRTC synchronization to securely share a diagnostic session with another developer without exposing API keys.

🏗️ Architecture & Stack

  • Core Framework: React 18+ and TypeScript, utilizing a highly optimized Vite single-page application structure.
  • Styling Engine: Cybernetic, dark-mode-first developer aesthetic managed primarily via Tailwind CSS and lucide-react icons, utilizing complex animations and backdrop filters.
  • Performance Integrations: Real-time DOM reconciliation tuning to handle high-frequency byte streams securely. Dedicated Web Workers for streaming tasks to keep the main thread unblocked.
  • Networking: Native fetch with AbortControllers for stream management, and peerjs for P2P connection handling.

📄 License & Attribution

This project is open-source and free to use under the terms of the GNU Affero General Public License (AGPLv3). It represents a decentralized alternative to traditional cloud-proxied wrappers, preserving absolute workspace privacy.

⚠️ Important Note: This project is open-source and free to use but redistribution and or claiming it as your intellectual property is imminently discouraged, attribution is appreciated.


💻 Credits

  • Developer: Gurutva Murdia

About

Duplex is an advanced, strictly client-side application designed to interface with multiple Large Language Models simultaneously. Run local instances through Ollama and multiple cloud APIs in a unified, privacy-first interface.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages