Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ Aetherix Local OpenCode Proxy Gateway

License Stars Forks Node.js version


A portable, ultra-fast OpenAI-compatible API Gateway designed to run fully on your local machine. It automatically manages your local OpenCode daemon background process, translates standard chat completion prompts, and exposes a premium glassmorphic playground dashboard.

With this setup, your local PC acts as a secure, high-speed AI inference instanceโ€”allowing you to call OpenCode's free model catalog dynamically locally, or share them securely across the internet.


๐ŸŒŒ System Architecture Flow

                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚    Client App (Cursor / Continue IDE)   โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚ (1) POST /v1/chat/completions (Port 4000)
                                           โ–ผ
                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚    Aetherix Local Gateway Proxy (:4000) โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚ (2) Auto-spawns & communicates
                                           โ–ผ
                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚     Local OpenCode Serve CLI (:3333)    โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚ (3) Executes on free models
                                           โ–ผ
                                 ๐Ÿค– [Dynamic Active Models]

โœจ Core Features

  • ๐Ÿ”Œ Frictionless OpenAI Compatibility: Drop-in replacement for standard OpenAI client libraries. Just point your baseURL to http://localhost:4000/v1.
  • ๐Ÿง  Zero-Config Daemon Management: The gateway automatically starts and monitors the local opencode serve process on boot. It gracefully shuts down the background daemon when terminated.
  • ๐ŸŒ Secure Sharing (Tunneling): Want to expose your local models to another computer or mobile device? Expose it securely to the world with a single command.
  • โšก Intuitively Bypassed Local Auth: Localhost requests bypass API-key checks automatically to save developer configuration steps.
  • ๐Ÿ”„ 100% Dynamic Model Detection: Models list is never hardcoded! The server queries opencode models in real-time and serves available models dynamically. When OpenCode adds or removes a model, it automatically updates without code edits.
  • ๐ŸŽ›๏ธ Generation Parameter Control: Adjust model Creativity (Temperature) and Max Token Limits directly from the local dashboard settings before prompting.
  • ๐Ÿ”ฎ Premium Glassmorphism Dashboard: Exposes a gorgeous, dark-themed dashboard at root http://localhost:4000 with real-time status indicators and a built-in playground chat client.

๐Ÿ› ๏ธ Prerequisites

Important

OpenCode Account and CLI Auth Required:

  1. Node.js (v18.0.0 or higher) must be installed.
  2. OpenCode CLI must be installed:
    • macOS/Linux: curl -sSf https://opencode.ai/install.sh | sh
    • Windows: Install the CLI executable from the official OpenCode site.
  3. Login session (Optional): If needed, authenticate your CLI locally before running:
    opencode login

๐Ÿ“ฅ Setup & Installation

1. Clone & Install

git clone https://github.com/yousufkidiya17/opencode-local-proxy.git
cd opencode-local-proxy

2. Configure Environment (Optional)

Run the automated setups to install all dependencies and verify environment paths:

  • Windows: Double-click or run setup.bat in CMD/PowerShell.
  • macOS/Linux: Run bash setup.sh in your terminal.

๐Ÿš€ Running the Gateway

Start both the proxy gateway and background daemon with one command:

npm start

Once started:

  • Local API endpoint is live at: http://localhost:4000/v1
  • Premium Dashboard UI is live at: http://localhost:4000

๐ŸŒ Instant Remote Sharing

To share your local models with another device (or a friend across the internet) run:

npm run share

This spawns a secure public tunnel via Localtunnel. Simply copy the generated public URL (e.g. https://aetherix-ai-tunnel.loca.lt) and use it in your remote configs.


โš™๏ธ Advanced Configuration (.env)

You can create a .env file in the root directory to customize parameters:

Variable Default Value Description
PORT 4000 Port of the local gateway proxy server
OPENCODE_PORT 3333 Port of the local OpenCode daemon server
API_KEY aetherix-sk-master-9f3a7b2e1d Token required for remote/non-localhost connections
STRICT_AUTH false Set to true to require authentication headers even for localhost

๐Ÿงฉ IDE Integrations

VS Code (Continue Extension)

Add the following blocks to your ~/.continue/config.json configuration file:

{
  "models": [
    {
      "title": "Local DeepSeek Free",
      "provider": "openai",
      "model": "opencode/deepseek-v4-flash-free",
      "apiBase": "http://localhost:4000/v1",
      "apiKey": "aetherix-sk-master-9f3a7b2e1d"
    },
    {
      "title": "Local Big Pickle",
      "provider": "openai",
      "model": "opencode/big-pickle",
      "apiBase": "http://localhost:4000/v1",
      "apiKey": "aetherix-sk-master-9f3a7b2e1d"
    }
  ]
}

Cursor Editor

  1. Navigate to Cursor Settings > Models.
  2. Scroll to OpenAI API Key and click Override OpenAI Base URL.
  3. Set the override base URL to http://localhost:4000/v1.
  4. Enter the default key aetherix-sk-master-9f3a7b2e1d.
  5. Under model selectors, add your desired targets: opencode/deepseek-v4-flash-free, opencode/big-pickle.

๐Ÿ“œ SDK Snippets

Python (OpenAI Library)

from openai import OpenAI

# Connect directly to your local instance
client = OpenAI(
    base_url="http://localhost:4000/v1",
    api_key="aetherix-sk-master-9f3a7b2e1d"
)

response = client.chat.completions.create(
    model="opencode/big-pickle",
    messages=[{"role": "user", "content": "Explain Quicksort algorithm in short."}],
    temperature=0.5,
    max_tokens=1024
)

print(response.choices[0].message.content)

Node.js (OpenAI SDK)

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "http://localhost:4000/v1",
  apiKey: "aetherix-sk-master-9f3a7b2e1d"
});

const chatCompletion = await client.chat.completions.create({
  model: "opencode/deepseek-v4-flash-free",
  messages: [{ role: "user", content: "Tell me a space joke." }],
  temperature=0.8
});

console.log(chatCompletion.choices[0].message.content);

๐Ÿ“„ License

Licensed under the MIT License. Created by Aetherix Core.

About

A portable OpenAI-compatible API gateway proxying free OpenCode AI models locally on your PC, with a premium glassmorphic dashboard & playground.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages