Skip to content
FoshatiPublic

About

Codefa, The High-Performance Local AI Proxy & Control Center for Coding Agents

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

codefa logo

codefa

The High-Performance Local AI Proxy & Control Center for Coding Agents

Version Python License


πŸš€ Overview

codefa is an ultra-fast, local-first proxy and management suite designed to connect autonomous AI coding agentsβ€”such as Claude Code and OpenAI Codexβ€”to any OpenAI-compatible AI provider (NVIDIA NIM, DeepSeek, OpenRouter, Mistral, Ollama, LM Studio, Kimi, MiniMax, and more).

Featuring an interactive terminal launcher, a modern responsive Admin UI on port 8090, and live HTTP access log streaming, codefa gives you total control over model routing, provider API keys, and server diagnostics.

codefa interactive terminal menu

Interactive borderless CLI selection menu in terminal


✨ Features

  • ⚑ Interactive Terminal Launcher (codefa): Arrow-key navigation (↑/↓) to seamlessly launch Claude Code, Codex CLI, or Server Only.
  • πŸ› οΈ Responsive Admin Control Panel: Beautiful glassmorphism Web UI running on http://127.0.0.1:8090/admin with full Dark & Light mode support.
  • πŸ“œ Live Server Logs Stream: Complete real-time capture of Uvicorn HTTP access logs, API payloads, and internal routing events.
  • πŸ€– Universal Coding Agent Compatibility: Pre-configured support for both Anthropic Claude Code and OpenAI Codex CLI.
  • πŸ”’ 100% Local & Secure: API keys remain strictly stored in your local ~/.codefa/.env file with zero telemetry leakage.
  • 🏎️ Optimized Performance: Built on Python 3.14, FastAPI, Loguru, and uvloop for minimal resource overhead.

πŸ“¦ Installation

1. Install Or Update

macOS / Linux

curl -fsSL https://codefa.foshati.com/install.sh | bash

Windows PowerShell

irm https://codefa.foshati.com/install.ps1 | iex

2. Start The Server

codefa server

⚑ Quick Start

1. Launching codefa

Run codefa in your terminal to open the interactive selection menu:

codefa

Use the ↑ and ↓ arrow keys to highlight your choice, then press Enter:

  • Claude Code: Launches Anthropic Claude Code CLI configured with codefa proxy.
  • Codex CLI: Launches OpenAI Codex CLI configured with codefa proxy.
  • Server Only: Starts the background proxy server and opens the Admin UI on port 8090.

Direct Subcommands

You can also bypass the menu and launch directly:

codefa claude   # Direct launcher for Claude Code
codefa codex    # Direct launcher for Codex CLI
codefa server   # Start server & open Admin UI
codefa status   # Show whether the background server is running
codefa stop     # Stop the auto-started background server
codefa-init     # Initialize ~/.codefa/.env config

codefa claude / codefa codex start one shared server in the background, detached from the terminal, if none is running. It keeps running when the client exits, so several terminals can use it at once; stop it with codefa stop. If startup fails, the real error is printed, and the full output is kept in ~/.codefa/logs/server-console.log.


## Choose A Provider

Provider Description Example Model
NVIDIA NIM Accelerated NIM microservices nvidia_nim/meta/llama-3.3-70b-instruct
Anthropic Native Claude Messages API (no conversion: thinking, caching, server tools) anthropic_api/claude-sonnet-4-5
OpenAI OpenAI GPT models (Chat Completions) openai_api/gpt-5
OpenRouter Unified multi-provider gateway open_router/auto
Gemini Google Gemini API gemini/gemini-2.5-flash
Vertex AI Google Cloud Vertex AI vertex/gemini-2.5-flash
DeepSeek DeepSeek V3 & R1 models deepseek/deepseek-chat
Mistral Mistral AI API endpoints mistral/mistral-large-latest
Mistral Codestral Codestral IDE endpoint mistral_codestral/codestral-latest
OpenCode Zen OpenCode Zen API opencode/claude-3-5-sonnet
OpenCode Go OpenCode Go API opencode_go/claude-3-5-sonnet
Vercel AI Gateway Vercel AI Gateway vercel/openai/gpt-4o
Amazon Bedrock Amazon Bedrock Mantle bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0
Hugging Face Hugging Face Router huggingface/meta-llama/Llama-3.3-70B-Instruct
Cohere Cohere API cohere/command-r-plus
GitHub Models GitHub Models endpoint github_models/gpt-4o
Wafer Wafer AI Pass wafer/claude-3-5-sonnet
Kimi Moonshot Kimi API kimi/moonshot-v1-8k
Kimi Code Kimi Code Subscription kimi_code/kimi-k1.5
MiniMax MiniMax AI API minimax/MiniMax-Text-01
Cerebras Cerebras Inference Engine cerebras/llama3.1-70b
Groq Groq LPU Inference groq/llama-3.3-70b-versatile
SambaNova SambaNova Cloud sambanova/Meta-Llama-3.3-70B-Instruct
Fireworks Fireworks AI fireworks/accounts/fireworks/models/llama-v3p3-70b-instruct
Cloudflare Workers AI catalog cloudflare/@cf/meta/llama-3.3-70b-instruct
Z.ai Z.ai GLM Coding Plan zai/glm-4
Ollama Cloud Ollama Cloud remote ollama_cloud/llama3.3
TokenRouter TokenRouter Unified Gateway tokenrouter/claude-3-5-sonnet
LM Studio Local LM Studio server lmstudio/local-model
llama.cpp Local llama.cpp server llamacpp/local-model
Ollama Local Ollama instance ollama/llama3.3:latest

First-party Claude and GPT

  • Anthropic (anthropic_api/..., key ANTHROPIC_API_KEY): requests are forwarded natively to the Claude Messages API, with no conversion. Thinking signatures, prompt caching, anthropic-beta features, exact token usage, and Anthropic's own web_search/web_fetch server tools work just as they do when calling Anthropic directly. Requests the API rejects (thinking type, effort, beta flags) are corrected and retried automatically.
  • OpenAI (openai_api/..., key OPENAI_API_KEY): GPT models over Chat Completions with named reasoning effort. Parameters a specific model rejects (for example reasoning_effort or temperature) are detected from the API error and dropped automatically, and non-chat models are hidden from model pickers.

Both support a per-provider HTTP proxy (ANTHROPIC_PROXY, OPENAI_PROXY) for regions where the APIs are not directly reachable.


🎨 Admin UI & Control Center

Access the Admin UI anytime at http://127.0.0.1:8090/admin.

Providers Configuration

Configure API keys, model choices, rate limits, and proxies for all supported AI providers in a responsive, theme-aware Web UI:

codefa Admin UI Providers page

Live Server Logs

Monitor live HTTP requests, status codes, and routing events in real time:

codefa Admin UI Live Server Logs

πŸ€– Coding Agents Integration

Claude Code

codefa automatically injects proxy environment variables for seamless integration with Anthropic Claude Code:

Claude Code CLI with codefa proxy

OpenAI Codex CLI

Run Codex CLI with custom models and local provider routing:

Codex CLI with codefa proxy
codefa Model Picker

πŸ—οΈ Architecture & Workflow

codefa acts as a local bridge between client protocol requests (Anthropic Messages API & OpenAI Responses API) and downstream AI provider endpoints:

codefa Architecture & Workflow Diagram

πŸ—‘οΈ Uninstallation

To uninstall codefa:

macOS / Linux

curl -fsSL "https://raw.githubusercontent.com/Foshati/codefa/main/scripts/uninstall.sh" | sh

Windows PowerShell

& ([scriptblock]::Create((irm "https://raw.githubusercontent.com/Foshati/codefa/main/scripts/uninstall.ps1")))

This verifies every CODEFA command is gone.


πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.

Created with ❀️ by Foshati

About

Codefa, The High-Performance Local AI Proxy & Control Center for Coding Agents

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages