Skip to content

birol-dev/Keya-wrapper

Repository files navigation

Keya Wrapper

Keya Wrapper Logo

A premium, secure, multi-provider AI chat client built with Next.js & Vanilla JS.

License Node version Next.js


Features

  • Zero-Exposure Security Model: All provider calls are proxied through a secure Next.js backend. API keys never enter the browser bundle.
  • Premium Aesthetics: Harmonious dark mode design, rich typography, smooth transitions, and glassmorphism details.
  • Multi-Provider Support: Fully compatible with Google Gemini (direct integration) and OpenRouter (aggregating hundreds of models).
  • Collapsible Reasoning/Thinking: Captures and renders thinking pipelines (e.g., <think> tokens from DeepSeek or reasoning parts from Gemini) inside collapsible, premium blocks.
  • Custom User-Defined Models: Easily add your own custom models (e.g. nvidia/nemotron-3-super-120b-a12b:free) from the settings panel. Define the provider, friendly display name, system prompt compatibility, and reasoning support.
  • Multimodal File Uploads: Drag and drop text files (source code, text context) or images to extract context and interact with multimodal models.
  • Localization: Native language support for both English (EN) and Turkish (TR), togglable instantly from the sidebar.
  • Real-time Performance Metrics: Displays generation stats (time to complete, token count, and tokens per second).
  • State Persistence: Conversations, active configurations, and custom models are automatically saved in local storage with built-in migration for legacy storage models.

Tech Stack

  • Framework: Next.js 15 (App Router)
  • Frontend Logic: Vanilla JavaScript ES Modules
  • Design System: Core CSS Custom Properties with Dark / Light variables
  • Libraries:
    • marked (High-performance Markdown parser)
    • highlight.js (Syntax highlighting for code blocks)
    • dompurify (Safe client-side HTML sanitization)

Quick Start

1. Prerequisites

Make sure you have Node.js (version 18 or higher) installed on your system.

2. Clone and Install Dependencies

git clone https://github.com/your-username/keya-wrapper.git
cd keya-wrapper
npm install

3. Configure Secrets

Create a .env.local file in the root directory and add your API keys:

# OpenRouter API Key
OPENROUTER_API_KEY=your_openrouter_api_key_here

# Google Gemini API Key
GEMINI_API_KEY=your_gemini_api_key_here

Warning

Do NOT prefix these keys with NEXT_PUBLIC_. Doing so will expose them to the browser client and bypass the secure backend proxy.

4. Run Development Server

npm run dev

Open http://localhost:3000 in your browser to experience Keya Wrapper.


Adding Custom Models

To run custom models that are not included by default (like the free NVIDIA Nemotron models or new Gemini experimental weights):

  1. Click the Settings (gear) icon in the sidebar.
  2. Under the "Add Custom Model" section, fill in the details:
    • Model ID: The official model identifier (e.g., nvidia/nemotron-3-super-120b-a12b:free).
    • Friendly Name: The name shown in the UI (e.g., Nemotron 3 Super).
    • Provider: Select either OpenRouter or Google Gemini.
    • Supports System Prompt: Enable if the model accepts a system-role instructions block.
    • Supports Reasoning/Thinking: Enable if the model streams chain-of-thought tokens.
  3. Click Add Model. The model card will instantly appear grouped under the correct provider card row.
  4. Select the card and click Save Settings to begin using your model!
  5. To remove a custom model, click the Trash icon in its card.

Docker Setup

A Dockerfile is included for easy containerization.

Build the Image:

docker build -t keya-wrapper .

Run the Container:

docker run -p 3000:3000 \
  -e OPENROUTER_API_KEY=your_key \
  -e GEMINI_API_KEY=your_key \
  keya-wrapper

Cloud / Coolify Deployment

Keya Wrapper is designed to be easily deployed to Coolify or similar Node/Next.js hosting platforms:

  1. Select Node/Next.js buildpack or the Dockerfile build option.
  2. Set the destination port to 3000.
  3. Set the build command to npm run build and start command to npm run start.
  4. Configure your environment variables OPENROUTER_API_KEY and/or GEMINI_API_KEY under the application settings tab.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors