@thomas-huang/caosi 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,16 @@
1
+ <p align="center">
2
+ <img src="assets/logo/caosi-icon.svg" width="88" height="88" alt="caosi">
3
+ </p>
4
+
1
5
  # caosi
2
6
 
3
7
  [中文](README.zh-CN.md)
4
8
 
5
9
  Keep using Claude Code, Codex, or Gemini CLI. Point them at your own upstream — no client switch.
6
10
 
7
- Set the Base URL to `http://127.0.0.1:9999/{provider_name}`. Same protocol is passed through; caosi converts when they differ.
11
+ Set the Base URL to `http://127.0.0.1:9999/{provider_name}`. OpenAI Chat, OpenAI Responses, Claude Messages, and Gemini convert in every direction; same protocol is passed through.
8
12
 
9
- - A single static binary
13
+ - A single static binary. No Docker.
10
14
  - npm ships the binaries: no install script, nothing fetched from GitHub
11
15
  - macOS, Linux, and Windows
12
16
 
@@ -23,7 +27,7 @@ npm install -g @thomas-huang/caosi
23
27
  caosi --version
24
28
  ```
25
29
 
26
- Needs Node.js 18+ on macOS, Linux, or Windows (amd64). The npm package includes native binaries; there is no install script and nothing is fetched from GitHub at install time.
30
+ Needs Node.js 18+ on macOS or Linux (amd64 and arm64), or Windows (amd64). The npm package includes native binaries; there is no install script and nothing is fetched from GitHub at install time.
27
31
 
28
32
  ## Run
29
33
 
@@ -89,15 +93,18 @@ export GEMINI_API_BASE=http://127.0.0.1:9999/openrouter
89
93
  | `claude_messages` | Claude Messages |
90
94
  | `gemini` | Gemini generateContent |
91
95
 
92
- - `model` is optional: when set, it replaces the client's model name on the upstream request.
96
+ - `model` is optional: when set, it replaces the client's model name on the upstream request, including when the protocols already match.
93
97
  - `headers` is optional extra request headers (for example OpenRouter).
94
98
  - `base_url` is a prefix. caosi does not strip `/v1`. Use the root the upstream actually expects (`https://openrouter.ai/api`, not `https://openrouter.ai/api/v1`).
95
99
 
100
+ Same protocol is copied through. Different protocols remap the body: text, system instruction, tools, thinking, Thinking Signature, in-message images, documents, audio, and video, and Usage Details (reasoning / cache-read / cache-create token counts) are kept when the other protocol can express them; otherwise that part is dropped and the rest is sent. caosi does not fetch URLs or Files API objects (`file_id`, `fileUri`). Dedicated image, files, audio, video, and embeddings paths stay 404.
101
+
96
102
  ## Listen, health, reload
97
103
 
98
104
  - Loopback only: `127.0.0.1` (or `::1` via `--listen`). Default port `9999` (`--port`).
99
- - `GET /health`
105
+ - `GET /health` returns JSON with the current Provider Names.
100
106
  - Saving `providers.jsonc` hot-reloads; a bad file keeps the last good config.
107
+ - Request and JSON-response bodies over 32MiB are rejected (413).
101
108
  - Flags: `--config-dir`, `--port`, `--listen`, `--log-level`, `--version`.
102
109
 
103
110
  ## What it does not do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thomas-huang/caosi",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Local converter between LLM client protocols and named upstream providers",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/thomas-huang/caosi",
Binary file
Binary file
Binary file
Binary file
Binary file