📝 Update README with improved usage instructions and configuration details

This commit is contained in:
2026-04-19 12:22:16 +08:00
parent 0b906016bc
commit 906947ce91
+22 -8
View File
@@ -5,27 +5,41 @@ HTTP proxy for LLM APIs with streaming support and chunk processing.
## Usage
```bash
./llm-proxy
./llm-proxy Start the proxy
./llm-proxy -h Show help
```
## Configuration
| Variable | Description | Default |
|----------|-------------|---------|
| `UPSTREAM_URL` | Upstream LLM API URL | `https://api.openai.com/v1/chat/completions` |
| `LISTEN_ADDR` | Listen address | `:8080` |
| `API_KEY` | Upstream API key | - |
| `INSECURE` | Skip TLS verification | `false` |
Configuration file (optional): `llm-proxy.toml`
Environment variables take priority over config file.
| Variable | Alternative | Description | Default |
|----------|-------------|-------------|---------|
| `UPSTREAM_URL` | `OPENAI_API_BASE` | Upstream LLM API URL | `https://api.openai.com/v1/chat/completions` |
| `LISTEN_ADDR` | - | Listen address | `127.0.0.1:8080` |
| `API_KEY` | `OPENAI_API_KEY` | Upstream API key | - |
| `INSECURE` | - | Skip TLS verification | `false` |
## Example
```bash
# Via environment variables
UPSTREAM_URL=https://api.openai.com/v1/chat/completions \
API_KEY=sk-... \
LISTEN_ADDR=:8080 \
LISTEN_ADDR=127.0.0.1:8080 \
./llm-proxy
```
```toml
# Via config file (llm-proxy.toml)
upstream_url = "https://api.openai.com/v1/chat/completions"
listen_addr = "127.0.0.1:8080"
api_key = "sk-..."
insecure = false
```
## Endpoints
- `GET /health` - Health check