@lihuu/dsh-ollama-cloud 0.1.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 +70 -0
- package/cordis.patch.yml +8 -0
- package/dist/index.js +837 -0
- package/lib/adapter.d.ts +111 -0
- package/lib/index.d.ts +62 -0
- package/lib/serialize.d.ts +44 -0
- package/lib/sse.d.ts +23 -0
- package/lib/translate.d.ts +32 -0
- package/lib/types.d.ts +143 -0
- package/package.json +52 -0
- package/src/adapter.ts +423 -0
- package/src/index.ts +214 -0
- package/src/serialize.ts +215 -0
- package/src/sse.ts +40 -0
- package/src/translate.ts +182 -0
- package/src/types.ts +148 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @lihuu/dsh-ollama-cloud
|
|
2
|
+
|
|
3
|
+
A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin that adds the **Ollama cloud** chat-completions provider, so the agent can use Ollama cloud models (DeepSeek, GLM, and more).
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Registers the `ollama-cloud-direct` provider route on the LLM seam
|
|
8
|
+
- Ships with a default model catalog: DeepSeek-V4-Flash (cloud), DeepSeek-V4-Pro (cloud), GLM-5.2 (cloud)
|
|
9
|
+
- Reads the API key through the harness credential seam, per request — a changed key takes effect without a restart
|
|
10
|
+
- Model ids without a `:cloud` suffix are sent as `id:cloud` (e.g. `deepseek-v4-flash` → `deepseek-v4-flash:cloud`)
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
- [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 0.1.2+
|
|
15
|
+
- An [Ollama cloud](https://ollama.com) API key
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
The package is a **bundle**: it ships its own configuration layer, so installing it into a profile activates the plugin automatically.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add @lihuu/dsh-ollama-cloud
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`dsh plugin add` appends the bundle to the profile's layer stack (`dsh.profile.bundles`), and the bundle's patch file mounts the plugin row. No manual patch editing is needed.
|
|
26
|
+
|
|
27
|
+
> If you previously mounted this plugin by hand (an `llm-ollama-cloud` row in `~/.dsh/cordis.patch.yml`), remove that row before installing the bundle — the duplicate row id fails the boot.
|
|
28
|
+
|
|
29
|
+
Restart the web service once after installing (bundle layers are composed at boot).
|
|
30
|
+
|
|
31
|
+
## Configuration
|
|
32
|
+
|
|
33
|
+
### 1. Set the API key
|
|
34
|
+
|
|
35
|
+
The plugin reads the key through the harness credential seam, per request — a changed key takes effect without a restart.
|
|
36
|
+
|
|
37
|
+
**Recommended — credentials file.** Add one line to `~/.dsh/.credentials.yaml`:
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
version: 1
|
|
41
|
+
refs:
|
|
42
|
+
OLLAMA_CLOUD_API_KEY: ollama-xxxxxxxxxxxxxxxx
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Alternative — environment variable.** Set `OLLAMA_CLOUD_API_KEY` in the environment the harness process runs under (your shell profile, a launchd unit, a process manager, etc.):
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
export OLLAMA_CLOUD_API_KEY="ollama-xxxxxxxxxxxxxxxx"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Select the provider
|
|
52
|
+
|
|
53
|
+
Choose the `ollama-cloud-direct` provider for the model (for example in the model settings or the agent's provider configuration).
|
|
54
|
+
|
|
55
|
+
## Custom model catalog
|
|
56
|
+
|
|
57
|
+
The bundle mounts the plugin with its default model catalog. To override it, add a config row in `~/.dsh/cordis.patch.yml`:
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
- id: llm-ollama-cloud
|
|
61
|
+
config:
|
|
62
|
+
models:
|
|
63
|
+
- id: deepseek-v4-flash
|
|
64
|
+
name: DeepSeek-V4-Flash
|
|
65
|
+
contextWindow: 800000
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# The llm-ollama-cloud bundle patch: mounts the Ollama cloud provider row.
|
|
2
|
+
# Applied as a profile layer when the profile lists this bundle; the row
|
|
3
|
+
# references the package by name so Node resolution finds the installed code.
|
|
4
|
+
# The API key is read from the OLLAMA_CLOUD_API_KEY credential reference
|
|
5
|
+
# (credentials file or environment) — never stored in this file.
|
|
6
|
+
- insert:
|
|
7
|
+
- id: llm-ollama-cloud
|
|
8
|
+
name: '@lihuu/dsh-ollama-cloud'
|