Skip to content

Commit 34b3961

Browse files
authored
Merge pull request #103 from matdev83/main
Sync
2 parents 585c101 + 8bcd0c1 commit 34b3961

File tree

1 file changed

+61
-65
lines changed

1 file changed

+61
-65
lines changed

README.md

Lines changed: 61 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This project is a swiss-army knife for anyone working with language models and a
44

55
## Contents
66

7+
- [Use Cases](#use-cases)
78
- [Killer Features](#killer-features)
89
- [Supported APIs (Front-Ends) and Providers (Back-Ends)](#supported-apis-front-ends-and-providers-back-ends)
910
- [Gemini Backends Overview](#gemini-backends-overview)
@@ -16,8 +17,8 @@ This project is a swiss-army knife for anyone working with language models and a
1617
- [Popular Scenarios](#popular-scenarios)
1718
- [Errors and Troubleshooting](#errors-and-troubleshooting)
1819
- [Support](#support)
20+
- [License](#license)
1921
- [Changelog](#changelog)
20-
- [License](#license)
2122

2223
## Use Cases
2324

@@ -39,7 +40,7 @@ This project is a swiss-army knife for anyone working with language models and a
3940
- Multiple front-ends, many providers: exposes OpenAI, Anthropic, and Gemini APIs while routing to OpenAI, Anthropic, Gemini, OpenRouter, ZAI, Qwen, and more
4041
- OpenAI compatibility: drop-in `/v1/chat/completions` for most clients and coding agents
4142
- Streaming everywhere: consistent streaming and non‑streaming support across providers
42-
- Gemini OAuth personal gateway: use Googles free personal OAuth (CLI-style) through an OpenAI-compatible endpoint
43+
- Gemini OAuth personal gateway: use Google's free personal OAuth (CLI-style) through an OpenAI-compatible endpoint
4344

4445
### Reliability
4546

@@ -63,7 +64,7 @@ This project is a swiss-army knife for anyone working with language models and a
6364

6465
- Wire capture and audit: optional request/response capture file plus usage tracking
6566

66-
## Supported LLM APIs
67+
## Supported APIs (Front-Ends) and Providers (Back-Ends)
6768

6869
These are ready out of the box. Front-ends are the client-facing APIs the proxy exposes; back-ends are the providers the proxy calls.
6970

@@ -91,6 +92,55 @@ These are ready out of the box. Front-ends are the client-facing APIs the proxy
9192
| `zai-coding-plan` | ZAI Coding Plan | `ZAI_API_KEY` | Works with any supported front-end and coding agent |
9293
| `qwen-oauth` | Alibaba Qwen | Local `oauth_creds.json` | Qwen CLI OAuth; OpenAI-compatible endpoint |
9394

95+
## Gemini Backends Overview
96+
97+
Choose the Gemini integration that fits your environment.
98+
99+
| Backend | Authentication | Cost | Best for |
100+
| - | - | - | - |
101+
| `gemini` | API key (`GEMINI_API_KEY`) | Metered (pay-per-use) | Production apps, high-volume usage |
102+
| `gemini-cli-oauth-personal` | OAuth (no API key) | Free tier with limits | Local development, testing, personal use |
103+
| `gemini-cli-cloud-project` | OAuth + `GOOGLE_CLOUD_PROJECT` (ADC/service account) | Billed to your GCP project | Enterprise, team workflows, central billing |
104+
105+
Notes
106+
107+
- Personal OAuth uses credentials from the local Google CLI/Code Assist-style flow and does not require a `GEMINI_API_KEY`.
108+
- Cloud Project requires `GOOGLE_CLOUD_PROJECT` and Application Default Credentials (or a service account file).
109+
110+
Quick setup
111+
112+
For `gemini` (API key)
113+
114+
```bash
115+
export GEMINI_API_KEY="AIza..."
116+
python -m src.core.cli --default-backend gemini
117+
```
118+
119+
For `gemini-cli-oauth-personal` (free personal OAuth)
120+
121+
```bash
122+
# Install and authenticate with the Google Gemini CLI (one-time):
123+
gemini auth
124+
125+
# Then start the proxy using the personal OAuth backend
126+
python -m src.core.cli --default-backend gemini-cli-oauth-personal
127+
```
128+
129+
For `gemini-cli-cloud-project` (GCP-billed)
130+
131+
```bash
132+
export GOOGLE_CLOUD_PROJECT="your-project-id"
133+
134+
# Provide Application Default Credentials via one of the following:
135+
# Option A: User credentials (interactive)
136+
gcloud auth application-default login
137+
138+
# Option B: Service account file
139+
export GOOGLE_APPLICATION_CREDENTIALS="/absolute/path/to/service-account.json"
140+
141+
python -m src.core.cli --default-backend gemini-cli-cloud-project
142+
```
143+
94144
## Quick Start
95145

96146
1) Export provider keys (only for the back-ends you plan to use)
@@ -114,12 +164,7 @@ python -m src.core.cli --default-backend openai
114164
Useful flags
115165

116166
- `--host 0.0.0.0` and `--port 8000` to change bind address
117-
- `--config config/config.example.yaml` to load a saved config
118-
119-
### Configuration Format
120-
- Configuration files are YAML-only. JSON configs are deprecated and not supported by the loader.
121-
- Keep `pyproject.toml` for packaging/tooling, and JSON for wire-capture logs only.
122-
- On startup, the server validates YAML files and refuses to start on syntax/schema errors.
167+
- `--config config/config.example.yaml` to load a saved config
123168
- `--capture-file wire.log` to record requests/replies (see Debugging)
124169
- `--disable-auth` for local only (forces host=127.0.0.1)
125170

@@ -168,66 +213,13 @@ Write outbound requests and inbound replies/streams to a rotating file for troub
168213
- Content rewriting: REPLACE/PREPEND/APPEND rules on inbound/outbound content
169214
- Context window enforcement: per-model token limits with friendly errors
170215

171-
## Gemini Backends Overview
172-
173-
Choose the Gemini integration that fits your environment.
174-
175-
| Backend | Authentication | Cost | Best for |
176-
| - | - | - | - |
177-
| `gemini` | API key (`GEMINI_API_KEY`) | Metered (pay-per-use) | Production apps, high-volume usage |
178-
| `gemini-cli-oauth-personal` | OAuth (no API key) | Free tier with limits | Local development, testing, personal use |
179-
| `gemini-cli-cloud-project` | OAuth + `GOOGLE_CLOUD_PROJECT` (ADC/service account) | Billed to your GCP project | Enterprise, team workflows, central billing |
180-
181-
Notes
182-
183-
- Personal OAuth uses credentials from the local Google CLI/Code Assist-style flow and does not require a `GEMINI_API_KEY`.
184-
- Cloud Project requires `GOOGLE_CLOUD_PROJECT` and Application Default Credentials (or a service account file).
185-
186-
Quick setup
187-
188-
For `gemini` (API key)
189-
190-
```bash
191-
export GEMINI_API_KEY="AIza..."
192-
python -m src.core.cli --default-backend gemini
193-
```
194-
195-
For `gemini-cli-oauth-personal` (free personal OAuth)
196-
197-
```bash
198-
# Install and authenticate with the Google Gemini CLI (one-time):
199-
gemini auth
200-
201-
# Then start the proxy using the personal OAuth backend
202-
python -m src.core.cli --default-backend gemini-cli-oauth-personal
203-
```
204-
205-
For `gemini-cli-cloud-project` (GCP-billed)
206-
207-
```bash
208-
export GOOGLE_CLOUD_PROJECT="your-project-id"
209-
210-
# Provide Application Default Credentials via one of the following:
211-
# Option A: User credentials (interactive)
212-
gcloud auth application-default login
213-
214-
# Option B: Service account file
215-
export GOOGLE_APPLICATION_CREDENTIALS="/absolute/path/to/service-account.json"
216-
217-
python -m src.core.cli --default-backend gemini-cli-cloud-project
218-
```
219-
220216
## Example Config (minimal)
221217

222218
```yaml
223219
# config.yaml
224220
backends:
225221
openai:
226222
type: openai
227-
228-
## License
229-
230-
This project is licensed under the GNU Affero General Public License v3.0 (or later). See the `LICENSE` file for the full text.
231223
default_backend: openai
232224
proxy:
233225
host: 0.0.0.0
@@ -239,7 +231,7 @@ auth:
239231
240232
Run: `python -m src.core.cli --config config.yaml`
241233

242-
## Popular Usage Scenarios
234+
## Popular Scenarios
243235

244236
### Claude Code with any model/provider
245237

@@ -284,8 +276,12 @@ Then launch `claude`. You can switch models during a session:
284276

285277
## Support
286278

287-
- Issues: open a ticket in the repository’s issue tracker
279+
- Issues: open a ticket in the repository's issue tracker
280+
281+
## License
282+
283+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
288284

289285
## Changelog
290286

291-
- See the full change history in [CHANGELOG.md](CHANGELOG.md)
287+
See the full change history in [CHANGELOG.md](CHANGELOG.md)

0 commit comments

Comments
 (0)