Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
20d1fc2
feat: turn counter display page, session terminals, cache fix, CI wor…
ArkNill Apr 15, 2026
ad68276
feat: multi-CLI display — CC, Codex, Gemini session integration
ArkNill Apr 15, 2026
fb97183
chore: sanitize for public release
ArkNill Apr 15, 2026
94ba69d
fix: CI install mcp only on Python 3.10+ (mcp requires >=3.10)
ArkNill Apr 15, 2026
7b268e6
docs: expand README, add Korean docs, llms.txt, llms-full.txt
ArkNill Apr 15, 2026
8414961
fix: skip MCP tests on Python 3.9 (mcp package requires >=3.10)
ArkNill Apr 15, 2026
ca8b691
fix: replace em dash with ASCII dash for Windows cp949 compatibility
ArkNill Apr 15, 2026
6292772
feat: add 'llm-relay serve' command for one-line dashboard startup
ArkNill Apr 15, 2026
17a3464
chore: remove FeatureFlags intercept code from public release
ArkNill Apr 15, 2026
1692281
chore: generalize tool cap comments (remove internal flag references)
ArkNill Apr 15, 2026
62941c2
chore: bump version to 0.2.0
ArkNill Apr 15, 2026
bc68bf0
fix: restore config_ flag names in test fixtures (filter-repo side ef…
ArkNill Apr 15, 2026
bed66cc
chore: remove FeatureFlags detector and config_ flag parsing for publ…
ArkNill Apr 15, 2026
745d52b
chore: bump version to 0.3.0 (clean public release)
ArkNill Apr 15, 2026
bf3a734
chore: remove project-config from tracking, add to .gitignore
ArkNill Apr 15, 2026
9e14ece
chore: unify branding to llm-relay, remove all legacy names
ArkNill Apr 15, 2026
9cda7a4
docs: add project motivation and link to hidden problem analysis
ArkNill Apr 15, 2026
baae54a
docs: sanitize design doc for public release (remove internal referen…
ArkNill Apr 15, 2026
9990d67
chore: remove internal references (multi-CLI, workstation, personal i…
ArkNill Apr 15, 2026
5782577
docs: fix detector count 8→7 after detector cleanup, remove inflation…
ArkNill Apr 15, 2026
76179b8
feat: alive filter for /turns endpoint + shared liveness helpers
ArkNill Apr 20, 2026
f36e264
feat: add multi-provider session history capture (v0.4.0)
ArkNill Apr 23, 2026
c235682
feat: i18n support — browser locale detection with en/ko
cnighswonger Apr 23, 2026
7cd3626
feat: v0.5.0 — context composition analysis, TUI monitor, connection …
ArkNill Apr 24, 2026
3b93274
feat: i18n support — browser locale detection with en/ko (#3)
ArkNill Apr 24, 2026
e80fbb5
fix: update zone label assertion to match i18n default (en)
ArkNill Apr 24, 2026
6e9d7ee
docs: update README/llms.txt for v0.5.0, add CHANGELOG, upgrade to Beta
ArkNill Apr 24, 2026
5253f0a
fix: repair history test mock leaks and ruff lint
ArkNill Apr 26, 2026
bdc0985
feat: dashboard Context Health section with composition on /turns
ArkNill Apr 26, 2026
7ff44fa
feat: duplicate read details, SNR recommendation, threshold warnings
ArkNill Apr 26, 2026
0b2abe7
feat: v0.6.0 — per-turn composition chart, Context Health, SNR warnings
ArkNill Apr 26, 2026
55127d2
feat: delegation detail slide-out panel + auto-refresh + favicon fix
cnighswonger Apr 24, 2026
114c4f8
feat: active session counts + activity indicators on CLI status tiles
cnighswonger Apr 24, 2026
af56600
feat: configurable Codex sandbox mode via LLM_RELAY_CODEX_SANDBOX
cnighswonger Apr 24, 2026
fcb88ff
fix: update test to match new command flag order
cnighswonger Apr 24, 2026
24bec14
fix: read LLM_RELAY_CODEX_SANDBOX per invocation, not at module load
cnighswonger Apr 24, 2026
8779883
feat: configurable Codex sandbox mode via LLM_RELAY_CODEX_SANDBOX (#5)
ArkNill Apr 26, 2026
863c89c
feat: delegation detail slide-out panel + dashboard UX fixes (#4)
ArkNill Apr 26, 2026
4482bff
fix: sync pyproject.toml version to 0.6.0
ArkNill Apr 26, 2026
1e05908
feat(db): add quota, error, cache, TTL query functions + ephemeral mi…
ArkNill Apr 26, 2026
90a26db
feat(proxy): extract ephemeral TTL tier tokens from SSE and non-strea…
ArkNill Apr 26, 2026
373c44b
feat(api+ui): surface quota, errors, cache, TTL in dashboard and display
ArkNill Apr 26, 2026
67e9945
test: add 28 tests for surfaced data + fix existing mocks
ArkNill Apr 26, 2026
bbf225d
chore: bump version to 0.7.0, update CHANGELOG
ArkNill Apr 26, 2026
0c1bfb1
fix: dashboard + history empty-state messages cite wrong env var
cnighswonger Apr 26, 2026
767807b
fix: dashboard Korean leak + history page lang declaration
cnighswonger Apr 26, 2026
770d3b9
feat: add 'llm-relay init' one-command setup
ArkNill Apr 26, 2026
65644fa
docs: update README with llm-relay init as primary quick start
ArkNill Apr 26, 2026
605ca80
chore: bump to 0.7.1 (includes llm-relay init)
ArkNill Apr 26, 2026
75c8581
Merge pull request #7 from cnighswonger/fix/dashboard-history-env-var…
ArkNill Apr 26, 2026
8201a7d
Merge pull request #8 from cnighswonger/fix/dashboard-history-i18n-leaks
ArkNill Apr 26, 2026
2508668
docs: add monitoring feature + API endpoints table to README
ArkNill Apr 26, 2026
c8af9fd
fix: add Windows compatibility across proxy, display, and diagnostics
ArkNill Apr 28, 2026
23e1662
chore: bump version to 0.7.2
ArkNill Apr 28, 2026
e37a09f
fix: wrap long recommendation strings to satisfy ruff E501 (120 char …
ArkNill Apr 28, 2026
16d8bfc
fix: reject non-API paths in catch-all proxy to prevent connection hangs
ArkNill Apr 28, 2026
c6e4726
feat: Docker-only deployment — no more native pip proxy
ArkNill Apr 28, 2026
8992db5
fix: remove backslash line continuation in curl example (Windows CMD …
ArkNill Apr 28, 2026
570051e
feat: add connect/disconnect commands for Claude Code, Codex, and Gemini
ArkNill Apr 28, 2026
5dbdc51
fix: skip liveness filtering in Docker (/.dockerenv detection)
ArkNill Apr 28, 2026
6374ed7
fix: enable CC session mount by default in docker-compose
ArkNill Apr 28, 2026
6ad1017
fix: unify default port to 8083 across Docker, native, and CLI
ArkNill Apr 28, 2026
1f959a8
fix: unify __version__ from pyproject.toml via importlib.metadata
ArkNill Apr 28, 2026
65e50c7
fix: block native serve on Windows with explanation
ArkNill Apr 28, 2026
9661af8
feat: inject GH App token for Codex when invoked via cli_delegate
cnighswonger Apr 26, 2026
5030e84
feat: surface term_name on /turns + dashboard render + preserve custo…
cnighswonger Apr 28, 2026
170ea78
feat: anthropic-status tile on dashboard with proxied 60s-cached upst…
cnighswonger Apr 28, 2026
a0bacd1
refactor: detect module cleanup, align scanner with current API
ArkNill Apr 29, 2026
d008f06
feat: expand setup init with platform detection and connect commands
ArkNill Apr 29, 2026
aeac1d6
feat: composition analysis — per-tool stats, file-based CLI parsing, …
ArkNill Apr 29, 2026
0314c9a
feat: cross-platform process inspection, display refactor with livene…
ArkNill Apr 29, 2026
e25b5ee
feat: display UI — composition pie chart, cache hit rate, alive sessi…
ArkNill Apr 29, 2026
c01d3e7
refactor: rename CC_RELAY_/CC_TOKEN_ env vars to LLM_RELAY_/LLM_TOKEN…
ArkNill Apr 29, 2026
b1758f6
feat: 2-tier env — .env.public (tracked defaults) + .env.local (gitig…
ArkNill Apr 29, 2026
f762ad1
docs: update README, design doc, llms.txt, add CLAUDE.md with privacy…
ArkNill Apr 29, 2026
89226ea
chore: bump version to 0.9.0 (LLM_ env var rename, breaking)
ArkNill Apr 29, 2026
2990439
fix: restore Docker-first README, apply LLM_ env var rename
ArkNill Apr 29, 2026
5467457
fix: restore public Dockerfile (no vendor dependency, port 8083)
ArkNill Apr 29, 2026
7cac92d
refactor: complete CC_/cc-relay/.cc-relay rename to LLM_/llm-relay/.l…
ArkNill Apr 29, 2026
e60cc24
chore: bump version to 0.9.0
ArkNill Apr 29, 2026
6275dde
fix: use ~/.llm-relay/ as default GH token script path (provider-agno…
ArkNill Apr 29, 2026
c8d904f
Merge PR #9: feat: inject GH App token for Codex via cli_delegate
ArkNill Apr 29, 2026
cc20850
Merge PR #10: feat: surface term_name on /turns + dashboard render + …
ArkNill Apr 29, 2026
8524572
Merge PR #11: feat: anthropic-status tile on dashboard (proxied + 60s…
ArkNill Apr 29, 2026
f99f3c3
feat: add OpenAI and Gemini status tiles on dashboard (3-provider mon…
ArkNill Apr 29, 2026
6c1af89
feat: API param validation (_ParamError→400), env var caching, _compa…
ArkNill Apr 29, 2026
16b990e
feat: OpenAI+Gemini status tiles, dashboard error banner on connectio…
ArkNill Apr 29, 2026
b1594ac
feat: 2-column responsive dashboard layout, bump classifiers to Beta
ArkNill Apr 29, 2026
0334db7
chore: bump version to 0.9.1
ArkNill Apr 29, 2026
ac3a9e9
refactor: remove unused detector and dead code paths
ArkNill Apr 29, 2026
f334023
fix: i18n leaks in dashboard / history / display (regression of PR #8…
cnighswonger Apr 29, 2026
7d0247b
fix: i18n leaks in dashboard / history / display (regression of PR #8…
cnighswonger Apr 29, 2026
a0cbb86
fix: i18n leaks in backend zone classifiers (api/routes.py, api/displ…
cnighswonger Apr 29, 2026
1811a6b
fix: CI lint + test fallout from i18n change
cnighswonger Apr 29, 2026
a35b593
feat: v0.9.2 — zone A↔B alignment, Codex 400K unification, display en…
ArkNill Apr 29, 2026
0e51dc5
fix: Codex session reuse — reset metrics on task_started, self-accumu…
ArkNill Apr 29, 2026
d0b126a
Merge pull request #12 from cnighswonger/fix/i18n-leaks-v091
ArkNill Apr 30, 2026
bf8fc34
Merge remote-tracking branch 'origin/main' into fix/i18n-leaks-backend
ArkNill Apr 30, 2026
2daba67
Merge pull request #13 from cnighswonger/fix/i18n-leaks-backend
ArkNill Apr 30, 2026
6e9b436
feat: i18n backend — t() translation layer with en/ko message catalog
ArkNill Apr 30, 2026
228b940
fix: auto-load .env.public on native uvicorn startup
ArkNill Apr 30, 2026
2881806
docs: add i18n feature, update MCP tool count to 8
ArkNill Apr 30, 2026
4f9f5c7
docs: cross-verify and fix version/MCP count inconsistencies
ArkNill Apr 30, 2026
ea3ee86
fix(dashboard): polish Context Health spacing and API status banner w…
cnighswonger Apr 30, 2026
ced1197
Merge pull request #14 from cnighswonger/feat/dashboard-css-polish-up…
ArkNill May 4, 2026
03a0fc3
feat(i18n): export SUPPORTED_LANGS constant and add i18n test suite
ArkNill May 4, 2026
f9c9512
fix(detect): remove stale GrowthBook detector import
ArkNill May 4, 2026
851b0d7
fix(proxy): align module version to 0.9.2
ArkNill May 4, 2026
d365b10
chore: ruff lint fixes — remove unused imports
ArkNill May 4, 2026
c61faa7
fix(dashboard): escape user-facing innerHTML to prevent XSS
ArkNill May 4, 2026
0b45422
fix(api): validate input types on POST /session-terminal
ArkNill May 4, 2026
d4617c7
docs: fix endpoint/tool/detector count discrepancies
ArkNill May 4, 2026
fb25e62
fix(api): replace raw exception strings with generic error messages
ArkNill May 4, 2026
0cb92b1
refactor: migrate CCPULSE_ env vars to LLM_RELAY_ prefix
ArkNill May 4, 2026
76818b3
chore: add missing __init__.py to recover, guard, cost modules
ArkNill May 4, 2026
e573218
docs: cross-verify all docs — fix detector count and update status
ArkNill May 4, 2026
cb7543b
chore: add CLAUDE.md and PLAN.txt to .gitignore
ArkNill May 4, 2026
277cb4a
docs: fix .env.example reference to .env.public
ArkNill May 4, 2026
d3c8dc6
fix(dashboard): status-text shrinks correctly when sibling text grows
May 5, 2026
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
29 changes: 29 additions & 0 deletions .env.public
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# llm-relay public environment defaults (git tracked)
# Shared by Docker (docker-compose.yml) and systemd (llm-relay-api.service).
# Local overrides go in .env.local (gitignored).

# ── Core ──────────────────────────────────────────────────────────
LLM_RELAY_UPSTREAM=https://api.anthropic.com

# ── Feature toggles ──────────────────────────────────────────────
LLM_RELAY_GB_INTERCEPT=0
LLM_RELAY_CACHE_FIX=0
LLM_RELAY_SCAN_ENABLED=0
LLM_RELAY_TOKPRESS=0
LLM_RELAY_SSE_PARSE_USAGE=1

# ── Session history (composition pie chart, SNR, duplicate reads) ─
LLM_RELAY_HISTORY=1
LLM_RELAY_HISTORY_RAW=0

# ── Internationalization (en/ko, browser auto-detect on web) ─────
LLM_RELAY_LANG=en

# ── Turn counter thresholds (CC) ─────────────────────────────────
# Zone A — absolute token count, aligned with Zone B (50/70/90/100% of 1M)
LLM_TOKEN_A_YELLOW=500000
LLM_TOKEN_A_ORANGE=700000
LLM_TOKEN_A_RED=900000
LLM_TOKEN_A_HARD=1000000
# Zone B — context window ceiling (for ratio calculation)
LLM_TOKEN_CEILING=1000000
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install ruff
- run: ruff check src/

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
if python -c "import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)"; then
pip install -e ".[dev]"
else
pip install -e ".[cli,proxy]" pytest ruff
fi
- run: pytest tests/ -v --tb=short

build:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install build
- run: python -m build
49 changes: 49 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker

on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Image tag (e.g., 0.8.0)"
required: true

permissions:
contents: read
packages: write

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/arknill/llm-relay
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}

- uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,30 @@ dist/
build/
.venv/
.env
.env.local
*.db
*.sqlite
.pytest_cache/
.ruff_cache/
.mypy_cache/
vendor/

# Project instruction files (LOCAL-ONLY — NEVER COMMIT)
CLAUDE.md
PLAN.txt

# GrowthBook intercept (LOCAL-ONLY — DO NOT COMMIT)
src/llm_relay/proxy/growthbook_intercept.py

# Investigation/evidence/audit files (local-only analysis)
docs/investigation-*
docs/audit-*
docs/evidence-*/

# Backup files
docker-compose.yml.bak*

# Credential files
*.key
*.pem
oauth_creds.json
25 changes: 0 additions & 25 deletions CHANGELOG.legacy.md

This file was deleted.

105 changes: 105 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Changelog

All notable changes to llm-relay are documented here.

## [0.9.2] - 2026-04-30

### Added
- **I18n**: Lightweight en/ko locale support via `i18n.py` message catalog (27 keys)
- Backend: `t()` translation function wired into all zone classifiers (routes.py, display.py, mcp/server.py)
- Frontend: `msg()` helper with browser `navigator.language` auto-detection (dashboard, display, history)
- API: `/api/v1/i18n?lang=ko` endpoint for frontend message loading
- Env: `LLM_RELAY_LANG` (default `en`)
- **MCP tool**: `session_history` — conversation replay with turn filtering (8 tools total)
- **Auto-load .env**: Native uvicorn startup now reads `.env.public` → `.env.local` automatically (Docker `env_file` parity)

### Fixed
- Hardcoded Korean zone labels replaced with i18n `t()` calls (PR #12/#13 by @cnighswonger)
- Composition pie chart missing after native restart (LLM_RELAY_HISTORY not loaded without .env autoload)

## [0.9.1] - 2026-04-29

### Added
- **Zone A↔B alignment**: Recalibrated CC/Codex dual-zone thresholds
- **Codex 400K unification**: Official context window constants
- **Display enhancements**: Placeholders, font normalization, dead code removal
- 3-provider status tiles (Anthropic/OpenAI/Gemini) on dashboard
- `term_name` surfacing on `/turns` + dashboard render
- GH App token injection for Codex via `cli_delegate`
- API parameter validation (`_ParamError` → 400)

## [0.7.1] - 2026-04-26

### Added
- **`llm-relay init`**: One-command setup — auto-detects CLIs, configures Claude Code proxy + MCP, initializes DB, starts server, runs health check. Options: `--dry-run`, `--skip-server`, `--port`
- Updated README with `llm-relay init` as primary quick start
- 18 new tests for init module

## [0.7.0] - 2026-04-26

### Added
- **Quota monitoring**: `/api/v1/quota` endpoint surfaces Q5h/Q7d utilization and overage status from stored ratelimit headers
- **Error rate tracking**: `/api/v1/errors` endpoint with 2xx/4xx/5xx/429 breakdown and error rate percentage
- **Cache hit rate**: `/api/v1/cache` endpoint and per-session `cache_hit_rate` field in `/turns/{id}` and `/display` responses
- **TTL tier detection**: `/api/v1/ttl` endpoint detects 1h/5m/mixed ephemeral cache tiers from SSE `message_start` events
- **Dashboard API Health section**: 4-card grid showing quota, error rate, cache hit rate, and TTL tier with 30s auto-refresh
- **Display page badges**: Cache hit rate and TTL tier badges on session cards
- Ephemeral token extraction from SSE `cache_creation.ephemeral_1h/5m_input_tokens` (streaming and non-streaming)
- DB migration: `ephemeral_1h_tokens` and `ephemeral_5m_tokens` columns on `requests` table
- 28 new tests (quota 5, error 5, cache 6, TTL 7, log_request 2, API endpoints 3)

## [0.6.0] - 2026-04-26

### Added
- **Dashboard Context Health section**: Real-time summary of SNR, duplicate reads, and tool_result% across all active sessions with per-session health cards
- **Duplicate read details**: `duplicate_reads` dict in composition API returns `{filepath: count}` instead of count-only; top file basenames shown in Display, Dashboard, and TUI
- **Duplicate read warning**: `DUPLICATE_READ_WARN_THRESHOLD` env var (default 5) triggers visual warning when any file exceeds threshold
- **SNR recommendation**: `CC_SNR_WARNING` env var (default 0.3) adds session-split recommendation message when SNR drops below threshold
- **Per-turn composition chart**: SVG stacked area chart on `/history/` session detail page showing how context composition evolves across turns, with compaction markers and hover tooltips
- **Per-turn composition API**: `GET /api/v1/history/{session_id}/composition` endpoint with automatic sampling for large sessions (>50 turns)
- `composition` field added to `/api/v1/turns` response (was only on `/api/v1/display`)
- 13 new tests (composition, turns, history)

### Fixed
- History test mock leaks: `discover_external_cli_sessions` was not mocked, causing tests to find real session files on disk
- Codex session file fallback test: path detection now works with `patch()` instead of monkey-patching
- 2 ruff lint issues in `scripts/context_composition.py`

## [0.5.0] - 2026-04-24

### Added
- **Context composition analysis**: Real-time 6-category breakdown (user/assistant/tool_use/tool_result/thinking/system) with SNR metrics and duplicate read tracking
- **`llm-relay top`**: btop-style terminal monitor using Rich Live — works over SSH without a browser
- **Connection type detection**: Automatically detects SSH, tmux, screen, mosh, tailscale, native (and combinations like ssh+tmux) from `/proc/PID/environ` + parent process tree
- **SVG pie chart** on `/display/` page showing context composition with popover tooltips
- **Connection type badges** on session cards
- **i18n support** (contributed by [@cnighswonger](https://github.com/cnighswonger)): Browser locale detection with en/ko; server override via `LLM_RELAY_LANG`
- `/api/v1/i18n` endpoint for locale-specific messages
- `scripts/context_composition.py` CLI analysis tool
- 51 new tests (composition 24, connection type 14, TUI 13)

### Changed
- Display page: prompt moved to top of session cards
- Display page: border-radius 4px, border-left 2px
- Development status upgraded from Alpha to Beta

## [0.4.0] - 2026-04-23

### Added
- **Session history capture**: Proxy-level conversation recording for CC/Codex/Gemini
- Delta/full storage with compaction detection
- `/history/` web replay viewer with compaction timeline
- 3 history API endpoints (`/api/v1/history`, `/{session_id}`, `/{session_id}/compactions`)
- `session_history` MCP tool (8th tool)
- Alive filter for `/api/v1/turns` endpoint with shared liveness helpers

### Changed
- MCP tools: 7 → 8

## [0.3.0] - 2026-04-15

### Changed
- Clean public release: removed internal references and legacy naming
- Unified branding to llm-relay
- Sanitized design documentation for public release
- Removed FeatureFlags detector (internal-only)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 QuartzUnit
Copyright (c) 2026 hmj / QuartzUnit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
93 changes: 93 additions & 0 deletions README.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# llm-relay

LLM 사용 통합 관리 — API 프록시 + 세션 진단 + 멀티 CLI 오케스트레이션

[English](README.md) | [llms.txt](llms.txt)

## 기능

- **Proxy**: API 투명 프록시 — 캐시/토큰 모니터링 + 12전략 pruning
- **Detect**: 7종 디텍터 (orphan, stuck, bloat, synthetic, cache, resume, microcompact)
- **Recover**: 세션 복구 + doctor (7개 건강 검사)
- **Guard**: 4-tier 임계값 데몬 — dual-zone(절대+비율) 분류
- **Cost**: per-1% 비용 산출 + rate-limit 헤더 분석
- **Orch**: 멀티 CLI 오케스트레이션 (Claude Code, Codex CLI, Gemini CLI)
- **Display**: 멀티 CLI 세션 모니터 — provider 배지 + 프로세스 생존 감지
- **I18n**: 다국어 지원 (영어/한국어) — 브라우저 자동 감지 + `LLM_RELAY_LANG` 환경변수
- **MCP**: stdio 전송 8개 도구 (cli_delegate, cli_status, cli_probe, orch_delegate, orch_history, relay_stats, session_turns, session_history)

## 설치

```bash
# CLI 전용 (진단, 복구, 오케스트레이션)
pip install llm-relay

# 프록시 + 웹 대시보드
pip install llm-relay[proxy]

# MCP 서버 (Python 3.10 이상)
pip install llm-relay[mcp]

# 전부
pip install llm-relay[all]
```

## 빠른 시작

### CLI 진단 (서버 불필요)

```bash
llm-relay scan # 세션 건강 검사 (7종 디텍터)
llm-relay doctor # 설정 건강 검사 (7개 항목)
llm-relay recover # 세션 컨텍스트 추출 (재개용)
```

### 웹 대시보드

```bash
# 방법 1: 직접 실행
pip install llm-relay[proxy]
uvicorn llm_relay.proxy.proxy:app --host 0.0.0.0 --port 8083

# 방법 2: Docker
cp .env.public .env # 필요에 따라 수정
docker compose up -d
```

접속 주소:
- `/dashboard/` — CLI 상태, 비용, 위임 히스토리, Turn Monitor (alive 세션만; `?include_dead=1` 로 우회)
- `/display/` — 턴 카운터 + CC/Codex/Gemini 세션 카드 (alive 필터: CC=cc_pid+TTY fallback, Codex/Gemini=fd-open)

### MCP 서버

```bash
llm-relay-mcp # stdio 전송, 8개 도구
```

### Claude Code API 프록시

```bash
# Claude Code에서 설정
export ANTHROPIC_BASE_URL=http://localhost:8080
```

## CLI 지원 현황

| CLI | 상태 |
|-----|------|
| Claude Code | 전체 지원 |
| OpenAI Codex | 전체 지원 |
| Gemini CLI | Display 지원, oauth-personal 서버사이드 403 버그 ([#25425](https://github.com/google-gemini/gemini-cli/issues/25425)) |

## 요구 사항

- Python >= 3.9
- MCP 도구는 Python >= 3.10

## 라이선스

MIT

## 생태계

[QuartzUnit](https://github.com/QuartzUnit) 오픈소스 생태계의 일부입니다.
Loading
Loading