Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
NVIDIA_NIM_API_KEY=""


# Anthropic Config (native Claude Messages API at api.anthropic.com; no protocol conversion)
ANTHROPIC_API_KEY=""


# OpenAI Config (GPT models over Chat Completions at api.openai.com/v1)
OPENAI_API_KEY=""


# OpenRouter Config
OPENROUTER_API_KEY=""

Expand Down Expand Up @@ -116,7 +124,7 @@ OLLAMA_BASE_URL="http://localhost:11434"

# All Claude model requests are mapped to these models, plain model is fallback
# Format: provider_type/model/name
# Valid providers: "nvidia_nim" | "open_router" | "gemini" | "vertex" | "deepseek" | "mistral" | "mistral_codestral" | "opencode" | "opencode_go" | "vercel" | "bedrock" | "huggingface" | "cohere" | "github_models" | "wafer" | "kimi" | "kimi_code" | "minimax" | "cerebras" | "groq" | "sambanova" | "fireworks" | "cloudflare" | "zai" | "ollama_cloud" | "tokenrouter" | "lmstudio" | "llamacpp" | "ollama"
# Valid providers: "nvidia_nim" | "anthropic_api" | "openai_api" | "open_router" | "gemini" | "vertex" | "deepseek" | "mistral" | "mistral_codestral" | "opencode" | "opencode_go" | "vercel" | "bedrock" | "huggingface" | "cohere" | "github_models" | "wafer" | "kimi" | "kimi_code" | "minimax" | "cerebras" | "groq" | "sambanova" | "fireworks" | "cloudflare" | "zai" | "ollama_cloud" | "tokenrouter" | "lmstudio" | "llamacpp" | "ollama"
MODEL_FABLE=
MODEL_OPUS=
MODEL_SONNET=
Expand All @@ -127,6 +135,8 @@ MODEL="nvidia_nim/nvidia/nemotron-3-super-120b-a12b"
# Optional live smoke model overrides. Provider smoke runs once per configured
# provider even when MODEL/MODEL_* route to a different provider.
CODEFA_SMOKE_MODEL_NVIDIA_NIM=
CODEFA_SMOKE_MODEL_ANTHROPIC_API=
CODEFA_SMOKE_MODEL_OPENAI_API=
CODEFA_SMOKE_MODEL_OPEN_ROUTER=
CODEFA_SMOKE_MODEL_MISTRAL=
CODEFA_SMOKE_MODEL_MISTRAL_REASONING=
Expand Down Expand Up @@ -176,6 +186,8 @@ REASONING_HAIKU=inherit
# Provider config
# Per-provider proxy support: http and socks5, example: "http://username:password@host:port"
NVIDIA_NIM_PROXY=""
ANTHROPIC_PROXY=""
OPENAI_PROXY=""
OPENROUTER_PROXY=""
MISTRAL_PROXY=""
CODESTRAL_PROXY=""
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [v1.3.0] - 2026-10-29
- **Native Anthropic provider (`anthropic_api/...`)**: Uses `ANTHROPIC_API_KEY` and sends requests straight to the Claude Messages API with no conversion, so thinking signatures, prompt caching, server tools (web search/fetch), `anthropic-beta` flags, and exact usage all work. Before any output reaches the client it retries on overload, and it automatically corrects requests the API rejects (beta flags, thinking type, effort, invalid thinking signatures).
- **OpenAI provider (`openai_api/...`)**: Uses `OPENAI_API_KEY` for GPT models over Chat Completions. It sends `max_completion_tokens`, maps reasoning effort to OpenAI's levels, and learns which parameters each model rejects (`reasoning_effort`, `temperature`, token fields) and drops them. The model list hides non-chat models, and quota exhaustion is reported instead of retried.
- **Terminal launcher fixes**: `codefa claude` / `codefa codex` start one shared server detached from the terminal (no browser pop-up, no longer killed when another session exits, 45s startup window). Server output is saved to `~/.codefa/logs/server-console.log`, and the actual startup error is shown if the server fails. New `codefa status` and `codefa stop` commands.
- **Admin dashboard redesign**: Providers are grouped into cloud and local with search, a configured-only filter, and status badges. The provider dialog is accessible, the log viewer is improved, and narrow windows are supported. Fixes several XSS-prone `innerHTML` uses and log-polling bugs.

## [v1.2.50] - 2026-07-30
- **Automated GitHub Releases**: Integrated GitHub Actions release workflow and full `CHANGELOG.md` documentation.
- **Vibrant Gradient Logo**: Updated `assets/codefa.svg` with modern electric blue (`#2563eb` -> `#38bdf8`) gradient.
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,22 @@ 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](https://build.nvidia.com) | Accelerated NIM microservices | `nvidia_nim/meta/llama-3.3-70b-instruct` |
| [Anthropic](https://console.anthropic.com) | Native Claude Messages API (no conversion: thinking, caching, server tools) | `anthropic_api/claude-sonnet-4-5` |
| [OpenAI](https://platform.openai.com) | OpenAI GPT models (Chat Completions) | `openai_api/gpt-5` |
| [OpenRouter](https://openrouter.ai) | Unified multi-provider gateway | `open_router/auto` |
| [Gemini](https://ai.google.dev) | Google Gemini API | `gemini/gemini-2.5-flash` |
| [Vertex AI](https://cloud.google.com/vertex-ai) | Google Cloud Vertex AI | `vertex/gemini-2.5-flash` |
Expand Down Expand Up @@ -121,6 +127,13 @@ codefa-init # Initialize ~/.codefa/.env config
| [llama.cpp](https://github.com/ggerganov/llama.cpp) | Local llama.cpp server | `llamacpp/local-model` |
| [Ollama](https://ollama.com) | 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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "codefa"
version = "1.2.52"
version = "1.3.0"
description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"
readme = "README.md"
requires-python = ">=3.14.0"
Expand Down
3 changes: 3 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ prompt_confirm() {
if [ "$auto_yes" -eq 1 ]; then
return 0
fi
if [ ! -t 1 ]; then
return 0
fi
tty_path=""
if [ -c /dev/tty ]; then
tty_path="/dev/tty"
Expand Down
Loading
Loading