Skip to content

Commit b3be207

Browse files
committed
chore: v0.4.1
1 parent 6b54536 commit b3be207

File tree

13 files changed

+458
-14
lines changed

13 files changed

+458
-14
lines changed

.scripts/docs.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ async function copyWithProcessor(
116116
const sourceContent = await Deno.readTextFile(source);
117117
const destContent = await processor(sourceContent);
118118

119+
// Ensure destination directory exists before writing
120+
const dir = dest.split('/').slice(0, -1).join('/');
121+
if (dir && !Array.from(Deno.readDirSync('.')).some(d => d.name === dir && d.isDirectory)) {
122+
await Deno.mkdir(dir, { recursive: true });
123+
}
124+
119125
await Deno.writeTextFile(dest, destContent);
120126
}
121127

.scripts/release.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ harbor dev docs
1212

1313
# cd to wiki and push the docs
1414
cd ../harbor.wiki
15-
git add .
16-
git commit -m "chore: docs"
17-
git push origin master
15+
git add . || true
16+
# Commit only if there are changes
17+
if git diff-index --quiet HEAD --; then
18+
echo "No docs changes to commit"
19+
else
20+
git commit -m "chore: docs"
21+
git push origin master || true
22+
fi
1823
cd ../harbor
1924

2025
# echo "NPM Publish..."

.scripts/seed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as toml from 'jsr:@std/toml';
66
import * as path from 'jsr:@std/path';
77
import * as collections from "jsr:@std/collections/deep-merge";
88

9-
const VERSION = "0.4.0";
9+
const VERSION = "0.4.1";
1010

1111
type ValueSeed = {
1212
// Path relative to the project root
@@ -26,7 +26,7 @@ const targets: ValueSeed[] = [{
2626
},
2727
},
2828
}, {
29-
target: 'boost/pyproject.toml',
29+
target: 'services/boost/pyproject.toml',
3030
value: {
3131
project: {
3232
version: VERSION,

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@avcodes/harbor-app",
33
"private": true,
4-
"version": "0.3.41",
4+
"version": "0.4.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

app/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[package]
33
name = "harbor-app"
4-
version = "0.3.41"
4+
version = "0.4.1"
55
description = "A companion app for Harbor LLM toolkit"
66
authors = ["av"]
77
edition = "2021"

app/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2.4.0",
33
"productName": "Harbor",
4-
"version": "0.3.41",
4+
"version": "0.4.1",
55
"identifier": "com.harbor.app",
66
"build": {
77
"beforeDevCommand": "bun run dev",

boost/README.md

Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
> Handle: `boost`<br/>
2+
> URL: [http://localhost:34131/](http://localhost:34131/)
3+
4+
![splash](../docs/harbor-boost.png)
5+
6+
`boost` is an optimising LLM proxy with OpenAI-compatible API.
7+
8+
### Documentation
9+
10+
- [Features](#features)
11+
- [Starting](#starting)
12+
- [Configuration](#configuration)
13+
- [API](#api)
14+
- [Environment Variables Reference](../docs/5.2.2-Harbor-Boost-Configuration)
15+
- [Built-in Modules Reference](../docs/5.2.3-Harbor-Boost-Modules)
16+
- [Custom Modules Guide](../docs/5.2.1.-Harbor-Boost-Custom-Modules)
17+
- [Standalone Usage Guide](#standalone-usage)
18+
- [Boost Starter repo](https://github.com/av/boost-starter)
19+
20+
***
21+
22+
### Features
23+
24+
#### OpenAI-compatible API
25+
26+
Acts as a drop-in proxy for OpenAI APIs, compatible with most LLM providers and clients. Boost can be used as a "plain" proxy to combine multiple LLM backends behind a single endpoint with a single API key.
27+
28+
![Short overview of boost behavior](../docs/boost-behavior.png)
29+
30+
```bash
31+
POST http://localhost:34131/v1/chat/completions
32+
33+
{
34+
"model": "llama3.1",
35+
"messages": [{ "role": "user", "content": "Tell me about LLMs" }]
36+
}
37+
```
38+
39+
#### Modules
40+
41+
Run custom code inside or instead of a chat completion, to fetch external data, improve reasoning, perform trace inference, and more.
42+
43+
```bash
44+
POST http://localhost:34131/v1/chat/completions
45+
46+
{
47+
"model": "klmbr-llama3.1",
48+
"messages": [{ "role": "user", "content": "Suggest me a random color" }]
49+
}
50+
```
51+
52+
Boost comes with [a lot of built-in modules](../docs/5.2.3-Harbor-Boost-Modules) with various functions. You can use them directly or as a base for your own creations.
53+
54+
| [`markov`](../docs/5.2.3-Harbor-Boost-Modules#markov) | [`concept`](../docs/5.2.3-Harbor-Boost-Modules#concept) |
55+
|-|-|
56+
| ![](../docs/boost-markov.png) | ![](../docs/boost-concept.png) |
57+
58+
| [`nbs`](../docs/5.2.3-Harbor-Boost-Modules#nbs) |
59+
|-|
60+
| ![](../docs/boost-nbs.png) |
61+
62+
| [`dnd`](../docs/5.2.3-Harbor-Boost-Modules#dnd) | [`promx`](../docs/5.2.3-Harbor-Boost-Modules#promx) |
63+
|-|-|
64+
| ![](../docs/boost-dnd.png) | ![](../docs/boost-promx.png) |
65+
66+
| [`dot`](../docs/5.2.3-Harbor-Boost-Modules#dot) | [`klmbr`](../docs/5.2.3-Harbor-Boost-Modules#klmbr) | [`r0`](../docs/5.2.3-Harbor-Boost-Modules#r0) |
67+
|-|-|-|
68+
| ![](../docs/boost-dot.png) | ![](../docs/boost-klmbr.png) | ![](../docs/boost-r0.png) |
69+
70+
#### Scripting
71+
72+
Creating custom modules is a first-class feature and one of the main use-cases for Harbor Boost.
73+
74+
```python
75+
# Simplest echo module replies back
76+
# with the last message from the input
77+
def apply(llm, chat):
78+
await llm.emit_message(prompt=chat.tail.content)
79+
```
80+
81+
See the [Custom Modules](../docs/5.2.1.-Harbor-Boost-Custom-Modules) guide for more information on how to create your own modules and overview of available interfaces.
82+
83+
### Starting
84+
85+
#### Start with Harbor
86+
87+
```bash
88+
# [Optional] pre-build the image
89+
harbor build boost
90+
91+
# Start the service
92+
harbor up boost
93+
```
94+
95+
- Harbor connects `boost` with:
96+
- to all included LLM backends (`ollama`, `llamacpp`, `vllm`, etc.)
97+
- [`optillm`](../docs/2.3.33-Satellite\&colon-OptiLLM) as a backend
98+
- `webui` and `dify` frontends
99+
100+
```bash
101+
# Get the URL for the boost service
102+
harbor url boost
103+
104+
# Open default boost endpoint in the browser
105+
harbor open boost
106+
```
107+
108+
#### Start standalone
109+
110+
```bash
111+
docker run \
112+
-e "HARBOR_BOOST_OPENAI_URLS=http://172.17.0.1:11434/v1" \
113+
-e "HARBOR_BOOST_OPENAI_KEYS=sk-ollama" \
114+
-e "HARBOR_BOOST_MODULES=dot;klmbr;promx;autotemp;markov;" \
115+
-e "HARBOR_BOOST_BASE_MODELS=true" \
116+
-e "HARBOR_BOOST_API_KEY=sk-boost" \
117+
-p 34131:8000 \
118+
ghcr.io/av/harbor-boost:latest
119+
```
120+
121+
See [standalone usage](#standalone-usage) guide below.
122+
123+
### Configuration
124+
125+
[Configuration](1.-Harbor-User-Guide#configuring-services) can be performed via Harbor CLI, [`harbor config`](../docs/3.-Harbor-CLI-Reference#harbor-config), [`harbor env`](../docs/3.-Harbor-CLI-Reference#harbor-env) or the `.env` file.
126+
127+
All of the above ways are interchangeable and result in setting environment variables for the service.
128+
129+
#### Harbor CLI
130+
131+
Specific options can be set using `harbor` CLI:
132+
133+
```bash
134+
# Enable/Disable a module
135+
harbor boost modules add <module>
136+
harbor boost modules rm <module>
137+
138+
# Set a parameter
139+
harbor boost <module> <parameter>
140+
harbor boost <module> <parameter> <value>
141+
142+
# See boost/module help entries
143+
# for more info
144+
harbor boost --help
145+
harbor boost klmbr --help
146+
harbor boost rcn --help
147+
harbor boost g1 --help
148+
149+
# Additional OpenAI-compatible APIs to boost
150+
harbor boost urls add http://localhost:11434/v1
151+
harbor boost urls rm http://localhost:11434/v1
152+
harbor boost urls rm 0 # by index
153+
harobr boost urls ls
154+
155+
# Keys for the OpenAI-compatible APIs to boost. Semicolon-separated list.
156+
# ⚠️ These are index-matched with the URLs. Even if the API doesn't require a key,
157+
# you still need to provide a placeholder for it.
158+
harbor boost keys add sk-ollama
159+
harbor boost keys rm sk-ollama
160+
harbor boost keys rm 0 # by index
161+
harbor boost keys ls
162+
```
163+
164+
#### Harbor Config
165+
166+
More options are available via [`harbor config`](../docs/3.-Harbor-CLI-Reference#harbor-config).
167+
168+
```bash
169+
# See all available options
170+
harbor config ls boost
171+
172+
# Some of the available options
173+
harbor config set boost.host.port 34131
174+
harbor config set boost.api.key sk-boost
175+
harbor config set boost.api.keys sk-user1;sk-user2;sk-user3
176+
```
177+
178+
Below are additional configuration options that do not have an alias in the Harbor CLI (so you need to use [`harbor config`](../docs/3.-Harbor-CLI-Reference#harbor-config) directly). For example `harbor config set boost.intermediate_output true`.
179+
180+
#### Environment Variables
181+
182+
Most comprehensive way to configure `boost` is to use environment variables. You can set them in the `.env` file or via [`harbor env`](../docs/3.-Harbor-CLI-Reference#harbor-env).
183+
184+
```bash
185+
# Using harbor env
186+
harbor env boost HARBOR_BOOST_API_KEY_MISTRAL sk-mistral
187+
188+
# Or open one of these in your text editor
189+
open $(harbor home)/.env
190+
open $(harbor home)/services/boost/override.env
191+
```
192+
193+
See all supported environment variables in the [Environment Variables Reference](../docs/5.2.2-Harbor-Boost-Configuration).
194+
195+
There's no configuration for this module yet.
196+
197+
### API
198+
199+
`boost` works as an OpenAI-compatible API proxy. It'll query configured downstream services for which models they serve and provide "boosted" wrappers in its own API.
200+
201+
See the [http catalog](https://github.com/av/harbor/blob/main/http-catalog/boost.http) entry for some sample requests.
202+
203+
**Authorization**
204+
205+
When [configured](#boost-configuration) to require an API key, you can provide the API key in the `Authorization` header.
206+
207+
```http
208+
<!-- All three versions are accepted -->
209+
Authorization: sk-boost
210+
Authorization: bearer sk-boost
211+
Authorization: Bearer sk-boost
212+
```
213+
214+
**`GET /v1/models`**
215+
216+
List boosted models. `boost` will serve additional models as per enabled modules. For example:
217+
218+
```jsonc
219+
[
220+
{
221+
// Original, unmodified model proxy
222+
"id": "llama3.1:8b"
223+
// ...
224+
},
225+
{
226+
// LLM with klmbr technique applied
227+
"id": "klmbr-llama3.1:8b"
228+
// ...
229+
},
230+
{
231+
// LLM with rcn technique applied
232+
"id": "rcn-llama3.1:8b"
233+
// ...
234+
}
235+
]
236+
```
237+
238+
**`POST /v1/chat/completions`**
239+
240+
Chat completions endpoint.
241+
242+
- Proxies all parameters to the downstream API, so custom payloads are supported out of the box, for example `json` format for Ollama
243+
- Supports streaming completions and tool calls
244+
245+
```bash
246+
POST http://localhost:34131/v1/chat/completions
247+
248+
{
249+
"model": "llama3.1:8b",
250+
"messages": [
251+
{ "role": "user", "content": "Suggest me a random color" }
252+
],
253+
"stream": true
254+
}
255+
```
256+
257+
**`GET /events/:stream_id`**
258+
259+
Listen to a specific stream of events (associated with a single completion workflow). The stream ID is a unique identifier of the LLM instance processing the request (you may decide to advertise/pass it to the client in the workflow's code).
260+
261+
**`GET /health`**
262+
263+
Health check endpoint. Returns `{ status: 'ok' }` if the service is running.
264+
265+
### Standalone usage
266+
267+
You can run boost as a standalone Docker container. See [harbor-boost](https://github.com/av/harbor/pkgs/container/harbor-boost) package in GitHub Container Registry.
268+
269+
```bash
270+
# [Optional] pre-pull the image
271+
docker pull ghcr.io/av/harbor-boost:latest
272+
273+
# Start the container
274+
docker run \
275+
# 172.17.0.1 is the default IP of the host, when running on Linux
276+
# So, the example below is for local ollama
277+
-e "HARBOR_BOOST_OPENAI_URLS=http://172.17.0.1:11434/v1" \
278+
-e "HARBOR_BOOST_OPENAI_KEYS=sk-ollama" \
279+
# Configuration for the boost modules
280+
-e "HARBOR_BOOST_MODULES=klmbr;rcn;g1" \
281+
-e "HARBOR_BOOST_KLMBR_PERCENTAGE=60" \
282+
# [Optional] mount folder with custom modules
283+
-v /path/to/custom_modules/folder:/app/custom_modules \
284+
-p 8004:8000 \
285+
ghcr.io/av/harbor-boost:latest
286+
287+
# In the separate terminal (or detach the container)
288+
curl http://localhost:8004/health
289+
curl http://localhost:8004/v1/models
290+
```
291+
292+
You can take a look at a [`boost-starter`](https://github.com/av/boost-starter) repo for a minimal example repository to get started.
293+
294+
**Configuration**
295+
296+
See [Environment Variables Reference](../docs/5.2.2-Harbor-Boost-Configuration).

docs/2.-Services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ A Flexible Framework for Experiencing Cutting-edge LLM Inference Optimizations
7878
- <a href="https://github.com/av/harbor/wiki/2.2.2-Backend:-llama.cpp"><img src="https://github.com/ggerganov.png?size=200" alt="llama.cpp logo" width="12" height="12" /> llama.cpp</a> <span style="opacity: 0.5;">`Backend`</span><br/>
7979
LLM inference in C/C++
8080

81-
- <a href="https://github.com/av/harbor/wiki/2.2.10-Backend:-lmdeploy">lmdeploy</a> <span style="opacity: 0.5;">`Backend`, `Partial Support`</span><br/>
81+
- <a href="https://github.com/av/harbor/wiki/2.2.10-Backend:-lmdeploy"><img src="https://www.google.com/s2/favicons?domain=lmdeploy.readthedocs.io&sz=128" alt="lmdeploy logo" width="12" height="12" /> lmdeploy</a> <span style="opacity: 0.5;">`Backend`, `Partial Support`</span><br/>
8282

8383

8484
- <a href="https://github.com/av/harbor/wiki/2.2.6-Backend:-mistral.rs"><img src="https://github.com/EricLBuehler.png?size=200" alt="mistral.rs logo" width="12" height="12" /> mistral.rs</a> <span style="opacity: 0.5;">`Backend`</span><br/>

harbor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4775,7 +4775,7 @@ run_modularmax_command() {
47754775
# ========================================================================
47764776

47774777
# Globals
4778-
version="0.3.41"
4778+
version="0.4.1"
47794779
harbor_repo_url="https://github.com/av/harbor.git"
47804780
harbor_release_url="https://api.github.com/repos/av/harbor/releases/latest"
47814781
delimiter="|"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@avcodes/harbor",
3-
"version": "0.3.41",
3+
"version": "0.4.1",
44
"description": "Effortlessly run LLM backends, APIs, frontends, and services with one command.",
55
"private": false,
66
"author": "av <av@av.codes> (https://av.codes)",

0 commit comments

Comments
 (0)