# LiteLLM-Reverse **Repository Path**: skyrocks/lite-llm-reverse ## Basic Information - **Project Name**: LiteLLM-Reverse - **Description**: No description available - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-11 - **Last Updated**: 2026-05-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LiteLLM Reverse Proxy OpenAI Responses API 到 Chat Completions API 的反向代理,专为 Codex CLI 设计。 ## 功能 - 将 OpenAI Responses API 格式转换为标准 Chat Completions API 格式 - 支持流式响应(SSE) - 支持 Tool Calling - 支持多轮对话 ## 安装 ```bash # 创建虚拟环境 python -m venv .venv source .venv/bin/activate # 安装依赖 pip install flask requests ``` ## 配置 复制配置文件模板: ```bash cp config.example.json config.json ``` 编辑 `config.json`: ```json { "upstream_url": "https://your-upstream-url/v1/chat/completions", "upstream_key": "your-api-key", "default_model": "your-model-name", "port": 5000 } ``` ## 运行 ```bash # 启动 ./start.sh # 停止 ./stop.sh # 查看日志 tail -f proxy.log ``` ## Codex CLI 配置 在 `~/.codex/config.toml` 中添加: ```toml [model_providers.custom] name = "Custom Provider" base_url = "http://localhost:5000" env_key = "CUSTOM_API_KEY" wire_api = "responses" requires_openai_auth = false [profiles.custom-profile] model = "your-model-name" model_provider = "custom" ``` ## 端点 | 端点 | 方法 | 说明 | |------|------|------| | `/responses` | POST | Responses API 主端点 | | `/v1/models` | GET | 模型列表 | | `/v1/models/` | GET | 模型详情 | | `/health` | GET | 健康检查 |