@xberg-io/opencode-liter-llm 0.0.1 → 1.11.4
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/.opencode/plugins/liter-llm.js +25 -0
- package/README.md +160 -6
- package/assets/icon.svg +10 -0
- package/assets/logo.svg +78 -0
- package/package.json +24 -13
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
2
|
+
// Content-Hash: blake3:1ad3d813d05d2ed27d81f6e6848ad8cf124882181d5f4d5ca2e62e81d7bbc91c
|
|
3
|
+
// Source-Hash: blake3:ebc090c2adf1cf7f6502b7419030aa15e62a2f7db20d3f60e064f98bdefe6ecc
|
|
4
|
+
// Schema-Version: v1
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* OpenCode-specific plugin entrypoint.
|
|
8
|
+
*
|
|
9
|
+
* ai-rulez copies this source module into the generated OpenCode package.
|
|
10
|
+
* Shared skills, commands, agents, and MCP configuration belong in their normal
|
|
11
|
+
* `.ai-rulez` sources; add only OpenCode-specific tools or hooks here.
|
|
12
|
+
*
|
|
13
|
+
* To extend this plugin:
|
|
14
|
+
* 1. Import `tool` from `@opencode-ai/plugin`.
|
|
15
|
+
* 2. Define tool arguments with `tool.schema` and validate every external
|
|
16
|
+
* input.
|
|
17
|
+
* 3. Return the OpenCode hooks object from this function.
|
|
18
|
+
* 4. Preview with `ai-rulez generate --plugin --dry-run` before regenerating.
|
|
19
|
+
*
|
|
20
|
+
* Pass subprocess arguments as an array. Never interpolate external input into
|
|
21
|
+
* a shell command.
|
|
22
|
+
*/
|
|
23
|
+
const LiterLlmPlugin = async () => ({});
|
|
24
|
+
|
|
25
|
+
export default LiterLlmPlugin;
|
package/README.md
CHANGED
|
@@ -1,8 +1,162 @@
|
|
|
1
|
-
#
|
|
1
|
+
# liter-llm
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
configured on npm.
|
|
3
|
+
Universal LLM API client for 143 providers — chat, streaming, tools, embeddings, search, OCR, plus an OpenAI-compatible proxy and an MCP server, in your agent.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
<!-- ~keep TODO: add screenshot -->
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
### From the marketplace (recommended)
|
|
10
|
+
|
|
11
|
+
Pending review for official Claude marketplace.
|
|
12
|
+
|
|
13
|
+
Self-host:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
/plugin marketplace add xberg-io/liter-llm
|
|
17
|
+
/plugin install liter-llm@liter-llm
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Binary requirement
|
|
21
|
+
|
|
22
|
+
The bundled MCP launcher (`scripts/mcp-launch.sh`) resolves a `liter-llm` binary
|
|
23
|
+
automatically on first run: it reuses one already on `PATH`, then tries
|
|
24
|
+
`npx`/`uvx`, then Homebrew, then a checksum-verified prebuilt binary from the
|
|
25
|
+
tool's latest GitHub release. No manual install is required to use the MCP
|
|
26
|
+
server.
|
|
27
|
+
|
|
28
|
+
To install the CLI yourself (also gives you the proxy server):
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
brew install xberg-io/tap/liter-llm
|
|
32
|
+
# or from crates.io (compiles from source):
|
|
33
|
+
cargo install liter-llm-cli
|
|
34
|
+
# or run it without a persistent install (the CLI proxy package self-installs the binary):
|
|
35
|
+
npx @xberg-io/liter-llm-cli --help
|
|
36
|
+
uvx --from liter-llm-cli liter-llm --help
|
|
37
|
+
# or download a prebuilt binary from the latest GitHub release:
|
|
38
|
+
# https://github.com/xberg-io/liter-llm/releases/latest
|
|
39
|
+
# or install the CLI from crates.io:
|
|
40
|
+
cargo install liter-llm-cli
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Set provider API keys via environment variables (`OPENAI_API_KEY`,
|
|
44
|
+
`ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, …).
|
|
45
|
+
|
|
46
|
+
## Skills shipped
|
|
47
|
+
|
|
48
|
+
| Skill | Trigger |
|
|
49
|
+
|-------|---------|
|
|
50
|
+
| **liter-llm** | Universal LLM client surface — chat, streaming, tools, embeddings, image/audio, moderation, search, OCR, reranking — across 143 providers and 14 language bindings. Use when writing LLM code in any supported language or choosing between the SDK, proxy, and MCP server. |
|
|
51
|
+
| **calling-llms** | Use when sending chat completions and routing to a specific provider via the `provider/model` prefix. |
|
|
52
|
+
| **streaming-responses** | Use when streaming tokens incrementally over SSE or async iterators. |
|
|
53
|
+
| **tool-calling** | Use when defining functions/tools for the model to call, or requesting structured outputs. |
|
|
54
|
+
| **embeddings-and-search** | Use when generating embeddings, calling the web-search providers, or running OCR over documents. |
|
|
55
|
+
| **running-the-proxy** | Use when running the `liter-llm api` OpenAI-compatible gateway with virtual keys, rate limits, and budgets. |
|
|
56
|
+
| **using-the-mcp-server** | Use when calling LLM APIs through the 22 MCP tools, and to decide when MCP beats the CLI or SDK. |
|
|
57
|
+
|
|
58
|
+
## MCP server
|
|
59
|
+
|
|
60
|
+
The plugin auto-registers an MCP server named `liter-llm`, launched via
|
|
61
|
+
`scripts/mcp-launch.sh` (which execs `liter-llm mcp --transport stdio`). It
|
|
62
|
+
exposes 22 tools mirroring the proxy's REST endpoints:
|
|
63
|
+
|
|
64
|
+
- `chat`, `embed`, `generate_image`
|
|
65
|
+
- `speech`, `transcribe`, `moderate`
|
|
66
|
+
- `rerank`, `search`, `ocr`, `list_models`
|
|
67
|
+
- file ops (`create_file`, `list_files`, `retrieve_file`, `delete_file`, `file_content`)
|
|
68
|
+
- batch ops (`create_batch`, `list_batches`, `retrieve_batch`, `cancel_batch`)
|
|
69
|
+
- Responses API (`create_response`, `retrieve_response`, `cancel_response`)
|
|
70
|
+
|
|
71
|
+
### Launcher / auto-install
|
|
72
|
+
|
|
73
|
+
The launcher resolves a working `liter-llm` binary in this order, falling
|
|
74
|
+
through to the next on any failure (override with
|
|
75
|
+
`LITER_LLM_LAUNCHER=auto|npx|uvx|brew|download`):
|
|
76
|
+
|
|
77
|
+
1. Any working `liter-llm` already cached in the plugin's `bin/` or on `PATH`.
|
|
78
|
+
2. `npx @xberg-io/liter-llm-cli` — the published npm CLI proxy package self-installs/runs
|
|
79
|
+
the binary (probed first; falls through if not published yet).
|
|
80
|
+
3. `uvx --from liter-llm-cli liter-llm` — the published PyPI CLI proxy package
|
|
81
|
+
(probed first; falls through if not published yet).
|
|
82
|
+
4. `brew install xberg-io/tap/liter-llm` if Homebrew is available.
|
|
83
|
+
5. A checksum-verified prebuilt binary from the tool's *latest* GitHub release
|
|
84
|
+
(`liter-llm-<latest-version>-<target>.tar.gz`, verified against
|
|
85
|
+
`SHA256SUMS-<latest-version>.txt`). The tool version is resolved from the
|
|
86
|
+
GitHub API — it is independent of the plugin's own version.
|
|
87
|
+
|
|
88
|
+
The `@xberg-io/*` / `liter-llm` binding packages (NAPI-RS / PyO3) are language
|
|
89
|
+
SDKs, not the CLI. All launcher diagnostics go to stderr; stdout is the MCP
|
|
90
|
+
protocol channel.
|
|
91
|
+
|
|
92
|
+
## Proxy / CLI
|
|
93
|
+
|
|
94
|
+
The `liter-llm` CLI ships an OpenAI-compatible proxy alongside the MCP server:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
liter-llm api --config liter-llm-proxy.toml # start the proxy (22 endpoints)
|
|
98
|
+
liter-llm mcp --transport stdio # start the MCP server
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Call the proxy like OpenAI:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
curl http://localhost:4000/v1/chat/completions \
|
|
105
|
+
-H "Authorization: Bearer sk-your-key" \
|
|
106
|
+
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Configuration
|
|
110
|
+
|
|
111
|
+
The proxy auto-discovers `liter-llm-proxy.toml`; the SDK auto-discovers
|
|
112
|
+
`liter-llm.toml` from the current directory upward.
|
|
113
|
+
|
|
114
|
+
```toml
|
|
115
|
+
# liter-llm-proxy.toml
|
|
116
|
+
[server]
|
|
117
|
+
host = "0.0.0.0"
|
|
118
|
+
port = 4000
|
|
119
|
+
|
|
120
|
+
[general]
|
|
121
|
+
master_key = "${LITER_LLM_MASTER_KEY}"
|
|
122
|
+
|
|
123
|
+
[[models]]
|
|
124
|
+
name = "gpt-4o"
|
|
125
|
+
provider_model = "openai/gpt-4o"
|
|
126
|
+
api_key = "${OPENAI_API_KEY}"
|
|
127
|
+
|
|
128
|
+
[[keys]]
|
|
129
|
+
key = "sk-team-frontend"
|
|
130
|
+
models = ["gpt-4o"]
|
|
131
|
+
rpm = 60
|
|
132
|
+
budget_limit = 50.0
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
See `skills/liter-llm/SKILL.md` for the full configuration surface.
|
|
136
|
+
|
|
137
|
+
## Examples
|
|
138
|
+
|
|
139
|
+
Route a chat completion to a configured model name:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
liter-llm proxy → POST /v1/chat/completions {"model": "gpt-4o", ...}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Through the MCP server, ask the agent to:
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
Embed these five paragraphs with openai/text-embedding-3-small and rank them against my query.
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Versioning
|
|
152
|
+
|
|
153
|
+
The plugin version tracks the liter-llm core release (`Cargo.toml`). See [CHANGELOG.md](../CHANGELOG.md) for release notes.
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
MIT. Skill content references the upstream [liter-llm](https://github.com/xberg-io/liter-llm) repository.
|
|
158
|
+
|
|
159
|
+
## See also
|
|
160
|
+
|
|
161
|
+
- **Marketplace**: this repo — `/plugin marketplace add xberg-io/liter-llm`
|
|
162
|
+
- **Upstream**: [xberg-io/liter-llm](https://github.com/xberg-io/liter-llm)
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8 12.6666H13.3333" stroke="#58FBDA" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round" />
|
|
3
|
+
<path
|
|
4
|
+
d="M2.6665 11.3334L6.6665 7.33337L2.6665 3.33337"
|
|
5
|
+
stroke="#58FBDA"
|
|
6
|
+
stroke-width="1.33333"
|
|
7
|
+
stroke-linecap="round"
|
|
8
|
+
stroke-linejoin="round"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<svg width="800" height="800" viewBox="0 0 640 640" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="3" y="3" width="634" height="634" rx="127" fill="#58FBDA" />
|
|
3
|
+
<rect x="3" y="3" width="634" height="634" rx="127" stroke="#323040" stroke-width="6" />
|
|
4
|
+
<circle cx="320" cy="320" r="310" fill="#58FBDA" />
|
|
5
|
+
<path
|
|
6
|
+
d="M389.155 401.996L409.975 422.345C414.957 427.214 421.28 430.485 428.133 431.739C434.55 432.912 440.511 435.857 445.342 440.24L449.157 443.7"
|
|
7
|
+
stroke="#2E2D36"
|
|
8
|
+
stroke-width="7.67819"
|
|
9
|
+
stroke-linecap="round"
|
|
10
|
+
/>
|
|
11
|
+
<path
|
|
12
|
+
d="M348.146 415.931V466.815C348.146 478.956 352.887 490.618 361.361 499.313C369.834 508.009 374.576 519.671 374.576 531.812V535.587"
|
|
13
|
+
stroke="#2E2D36"
|
|
14
|
+
stroke-width="7.67819"
|
|
15
|
+
stroke-linecap="round"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
d="M253.878 402.343L238.967 419.661C233.522 425.984 225.972 430.123 217.712 431.311C212.091 432.12 206.755 434.302 202.179 437.665L191.199 445.733"
|
|
19
|
+
stroke="#2E2D36"
|
|
20
|
+
stroke-width="7.67819"
|
|
21
|
+
stroke-linecap="round"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
d="M324.521 75.8389C418.389 75.839 494.411 151.075 494.411 243.792C494.41 336.509 418.389 411.744 324.521 411.744C230.653 411.744 154.631 336.509 154.63 243.792C154.63 151.075 230.653 75.8389 324.521 75.8389Z"
|
|
25
|
+
fill="#79FFE6"
|
|
26
|
+
stroke="#2E2D36"
|
|
27
|
+
stroke-width="7.67819"
|
|
28
|
+
/>
|
|
29
|
+
<path
|
|
30
|
+
d="M321.021 138.481C370.893 138.481 411.275 178.538 411.275 227.892C411.275 277.246 370.893 317.303 321.021 317.303C271.149 317.303 230.767 277.246 230.767 227.892C230.767 178.538 271.149 138.481 321.021 138.481Z"
|
|
31
|
+
fill="white"
|
|
32
|
+
stroke="#2E2D36"
|
|
33
|
+
stroke-width="6.14255"
|
|
34
|
+
/>
|
|
35
|
+
<circle cx="151.379" cy="396.492" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
36
|
+
<circle cx="176.471" cy="455.8" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
37
|
+
<circle cx="220.109" cy="502.413" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
38
|
+
<circle cx="321.071" cy="563.307" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
39
|
+
<circle cx="377.998" cy="551.009" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
40
|
+
<path
|
|
41
|
+
d="M377.304 407.798V409.371C377.304 439.053 388.7 467.601 409.139 489.123"
|
|
42
|
+
stroke="#2E2D36"
|
|
43
|
+
stroke-width="7.67819"
|
|
44
|
+
stroke-linecap="round"
|
|
45
|
+
/>
|
|
46
|
+
<circle cx="419.354" cy="502.413" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
47
|
+
<circle cx="462.695" cy="455.006" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
48
|
+
<circle cx="482.332" cy="396.393" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
49
|
+
<path
|
|
50
|
+
d="M223.381 385.483C214.742 392.906 203.73 396.988 192.34 396.988H168.834"
|
|
51
|
+
stroke="#2E2D36"
|
|
52
|
+
stroke-width="7.67819"
|
|
53
|
+
stroke-linecap="round"
|
|
54
|
+
/>
|
|
55
|
+
<path
|
|
56
|
+
d="M271.532 409.484C271.532 436.174 260.868 461.757 241.911 480.545L232.555 489.817"
|
|
57
|
+
stroke="#2E2D36"
|
|
58
|
+
stroke-width="7.67819"
|
|
59
|
+
stroke-linecap="round"
|
|
60
|
+
/>
|
|
61
|
+
<path
|
|
62
|
+
d="M291.863 414.889V470.056C291.863 482.306 287.2 494.096 278.821 503.033L278.295 503.594C270.254 512.169 265.779 523.484 265.779 535.24"
|
|
63
|
+
stroke="#2E2D36"
|
|
64
|
+
stroke-width="7.67819"
|
|
65
|
+
stroke-linecap="round"
|
|
66
|
+
/>
|
|
67
|
+
<path d="M321.368 418.311V545.753" stroke="#2E2D36" stroke-width="7.67819" stroke-linecap="round" />
|
|
68
|
+
<path
|
|
69
|
+
d="M416.925 385.731C422.142 390.758 429.105 393.566 436.35 393.566H465.422"
|
|
70
|
+
stroke="#2E2D36"
|
|
71
|
+
stroke-width="7.67819"
|
|
72
|
+
stroke-linecap="round"
|
|
73
|
+
/>
|
|
74
|
+
<ellipse cx="321.021" cy="227.892" rx="51.671" ry="53.0099" fill="#2E2D36" />
|
|
75
|
+
<ellipse cx="331.286" cy="214.106" rx="18.5956" ry="19.0915" fill="white" />
|
|
76
|
+
<ellipse cx="348.493" cy="242.471" rx="8.43002" ry="8.67796" fill="white" />
|
|
77
|
+
<circle cx="264.143" cy="552.299" r="14.8269" fill="white" stroke="#2E2D36" stroke-width="4.60691" />
|
|
78
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xberg-io/opencode-liter-llm",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
"version": "1.11.4",
|
|
4
|
+
"description": "Universal LLM API client for 165 providers — chat, streaming, tools, embeddings, search, OCR, plus an OpenAI-compatible proxy and an MCP server.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"llm",
|
|
7
|
+
"openai",
|
|
8
|
+
"proxy",
|
|
9
|
+
"embeddings",
|
|
10
|
+
"mcp"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://xberg.io",
|
|
8
13
|
"repository": {
|
|
9
14
|
"type": "git",
|
|
10
|
-
"url": "
|
|
15
|
+
"url": "https://github.com/xberg-io/liter-llm"
|
|
11
16
|
},
|
|
12
|
-
"
|
|
13
|
-
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": ".opencode/plugins/liter-llm.js",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": "./.opencode/plugins/liter-llm.js"
|
|
14
22
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
]
|
|
23
|
+
"files": [
|
|
24
|
+
".opencode/",
|
|
25
|
+
"assets/",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@opencode-ai/plugin": "^1.17.8"
|
|
30
|
+
}
|
|
20
31
|
}
|