@byollm/protocol 0.1.0-alpha.8 → 0.1.0-alpha.81
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/ABOUT-SHORT.md +7 -0
- package/ABOUT.md +60 -0
- package/README.md +106 -4
- package/dist/index.d.ts +1130 -132
- package/dist/index.js +1411 -329
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/ABOUT-SHORT.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
BYOLLM – Bring Your Own LLM – lets you use your own AI on websites you authorize. A small program installed on your machine lets you use your own models and subscriptions on any BYOLLM-integrated site, including new models the moment you get access – no site updates required. BYOLLM Cloud connects sites to your devices with end-to-end encryption, so no one, including us, can see your data.
|
|
2
|
+
|
|
3
|
+
<!-- lede ends here. Surfaces with room show the tail below; the welcome screen shows the lede only. -->
|
|
4
|
+
|
|
5
|
+
Sites can charge you less because you bring your own – see why that matters →. Teams can optionally share the free or metered services on their devices with people they name. Personal subscriptions are never shared.
|
|
6
|
+
|
|
7
|
+
**Learn more →**
|
package/ABOUT.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# About BYOLLM
|
|
2
|
+
|
|
3
|
+
**What BYOLLM is**
|
|
4
|
+
|
|
5
|
+
BYOLLM lets you use your own AI on websites. You install one small program on
|
|
6
|
+
your computer. Then, websites that support BYOLLM can use the AI you already
|
|
7
|
+
have — a free model running on your machine, or an AI service you already pay
|
|
8
|
+
for — instead of the website paying for AI and passing the cost to you.
|
|
9
|
+
|
|
10
|
+
**Why it matters**
|
|
11
|
+
|
|
12
|
+
For you:
|
|
13
|
+
|
|
14
|
+
- Your favorite model, everywhere you go.
|
|
15
|
+
- New models the moment you get them – not when a site gets around to adding
|
|
16
|
+
them.
|
|
17
|
+
- Encrypted end-to-end. Your prompts go to your own device; byollm.cloud can't
|
|
18
|
+
read them.
|
|
19
|
+
- Sites never learn which model you use, and your subscriptions are never
|
|
20
|
+
shared.
|
|
21
|
+
- Pay less. Sites that don't pay for AI can charge you less – or nothing.
|
|
22
|
+
|
|
23
|
+
For sites and developers:
|
|
24
|
+
|
|
25
|
+
- Zero AI bills. Your users bring their own compute.
|
|
26
|
+
- No floating money – you don't pay LLM bills up front and hope to collect
|
|
27
|
+
later, and you never ask people to prepay just to try you.
|
|
28
|
+
- Free trials that cost you nothing to offer.
|
|
29
|
+
- Ship the AI features you kept private for fear of the API bill.
|
|
30
|
+
- One small integration. Your users choose the models.
|
|
31
|
+
|
|
32
|
+
**Your device**
|
|
33
|
+
|
|
34
|
+
The `byollm` program runs on your computer. It knows which AI services you have
|
|
35
|
+
set up: free open-source models on your machine, metered services you pay per
|
|
36
|
+
use, or your own subscriptions like Claude Pro/Max. When a website you have
|
|
37
|
+
enabled sends work, your device runs it with the service you chose. Your
|
|
38
|
+
prompts are encrypted end-to-end to your own device. byollm.cloud passes them
|
|
39
|
+
along and cannot read them.
|
|
40
|
+
|
|
41
|
+
**Sites**
|
|
42
|
+
|
|
43
|
+
A website that wants to use BYOLLM says what it needs — "writing help," "chat,"
|
|
44
|
+
and so on. When you connect the site, you pick which of your services answers
|
|
45
|
+
each one. The site never learns which model you use. You can turn a site off at
|
|
46
|
+
any time, and it stops getting your work.
|
|
47
|
+
|
|
48
|
+
**Teams (optional)**
|
|
49
|
+
|
|
50
|
+
A team lets you share what runs on your devices with people you name — the free
|
|
51
|
+
open-source models on your machine, or a metered service with a spending limit
|
|
52
|
+
you set. Your subscription accounts (like Claude Pro/Max) are never shared with
|
|
53
|
+
anyone. That is a rule, not a setting.
|
|
54
|
+
|
|
55
|
+
**byollm.cloud (or your own relay)**
|
|
56
|
+
|
|
57
|
+
Many sites, many devices, many people. byollm.cloud keeps track of who has
|
|
58
|
+
allowed what and sends each job to the right device. It never sees your
|
|
59
|
+
prompts. If you would rather run this part yourself, the relay is open source —
|
|
60
|
+
you can run your own instead of using byollm.cloud.
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
> [!WARNING]
|
|
2
|
-
> **Alpha (`0.1.0-alpha.
|
|
2
|
+
> **Alpha (`0.1.0-alpha.81`) — under active development. Don't use this yet.**
|
|
3
3
|
>
|
|
4
4
|
> Install it deliberately: `npm install @byollm/protocol@alpha`.
|
|
5
5
|
>
|
|
@@ -11,12 +11,114 @@
|
|
|
11
11
|
> npm assigns `latest` on a first publish and won't let it be removed, so a
|
|
12
12
|
> bare install resolves here too. This notice is the only guard — deliberately
|
|
13
13
|
> not an npm deprecation, which would read as *abandoned* rather than *early*.
|
|
14
|
-
> Ask for `@alpha` explicitly so your lockfile records that you meant to
|
|
14
|
+
> Ask for `@alpha` explicitly so your lockfile records that you meant to.>
|
|
15
|
+
> **`alpha.15` is a breaking wire change, and it breaks daemons and relays —
|
|
16
|
+
> not app authors.** If you call `app.enqueue(...)` and read results, nothing
|
|
17
|
+
> in your code changes. If you run a daemon or an upstream, every package must
|
|
18
|
+
> move together: a mixed pair refuses on both sides, because both ends parse
|
|
19
|
+
> `.strict()`.
|
|
20
|
+
>
|
|
21
|
+
> What moved, all of it reconciling the frozen `byollm_009` with its code:
|
|
22
|
+
> `JobStub` gains `site` (the site's identity key id) and loses
|
|
23
|
+
> `audienceAllow`; `ResultRequest` gains `leaseId`; `HeartbeatResponse` loses
|
|
24
|
+
> `leases`, which nothing read; `WireErrorCode` gains `not-ready`,
|
|
25
|
+
> `clock-skew` and `forbidden`, and `403` is `forbidden` rather than
|
|
26
|
+
> `unauthorized`. `RESULT_PROVENANCE` is superseded by
|
|
27
|
+
> `PROVENANCE_NAMES_DEVICE`. See `byollm_009` Amendment A.>
|
|
28
|
+
> **`alpha.16` is a breaking wire change — daemons and relays again, not app
|
|
29
|
+
> authors.** `app.enqueue(...)` and reading results are unchanged. All five
|
|
30
|
+
> packages move together: both ends parse `.strict()`, so a mixed pair
|
|
31
|
+
> refuses.
|
|
32
|
+
>
|
|
33
|
+
> What moved, all of it Tier 2 of `cloud_008`: `model`, `backendClass` and
|
|
34
|
+
> `durationMs` come off `ResultRequest` and are sealed **inside** the result
|
|
35
|
+
> envelope as `SealedOutcome = { outcome, ran }` — so a daemon can no longer
|
|
36
|
+
> declare a model it did not sign, and a relay carries neither.
|
|
37
|
+
> `HeartbeatResponse` loses `leases` (nothing read it) and now reports real
|
|
38
|
+
> cancellations instead of an empty list. `WireErrorCode` gains `forbidden`
|
|
39
|
+
> for 403, leaving `unauthorized` at exactly 401. The relay gained a
|
|
40
|
+
> site-plane `cancel` endpoint, honours `stub.deadlineAt`, honours
|
|
41
|
+
> `stub.audience`, and remembers a refusal.>
|
|
42
|
+
> **`alpha.17` is additive** — no wire change. It exports `ReleaseReason`,
|
|
43
|
+
> which `RoutingStore.releaseLeases` names and the package did not export, so
|
|
44
|
+
> the interface was unimplementable outside this repo.>
|
|
45
|
+
> **`alpha.18` is a breaking wire change — daemons and relays, not app
|
|
46
|
+
> authors.** `app.enqueue(...)` and reading results are unchanged. All five
|
|
47
|
+
> packages move together.
|
|
48
|
+
>
|
|
49
|
+
> The **bearer token is gone**: off `PairPollResponse`, off the runner row,
|
|
50
|
+
> off the daemon's pairings file, out of the adapter's schema. It was minted,
|
|
51
|
+
> hashed and stored on two disks and never sent, looked up or compared —
|
|
52
|
+
> `REQUESTS_SIGNED_NOT_BEARER` was enforced by signatures the whole time. If
|
|
53
|
+
> you run the Supabase adapter, apply
|
|
54
|
+
> `20260819000000_drop_runner_token.sql`; `byollm_approve_pairing` now takes
|
|
55
|
+
> one argument. A pairings file written by an older daemon still loads.
|
|
56
|
+
>
|
|
57
|
+
> `model`, `backendClass` and `durationMs` moved **inside** the sealed result
|
|
58
|
+
> (`SealedOutcome = { outcome, ran }`), so a daemon cannot declare a model it
|
|
59
|
+
> did not sign and a relay carries none of them. Writing a `RoutingStore`?
|
|
60
|
+
> `releaseLeases` takes an optional `reason` and `complete` requires
|
|
61
|
+
> `leaseId`, and **an implementation that ignores either still typechecks** —
|
|
62
|
+
> run the store contract tests.>
|
|
63
|
+
> **`alpha.19` is additive on the wire and a behaviour change in every
|
|
64
|
+
> store.** `ResultResponse` gains an optional `duplicate`. Nothing is removed,
|
|
65
|
+
> so an older daemon keeps working — but the *order* two rules are checked in
|
|
66
|
+
> has changed, and a `RoutingStore` implementation must change with it.
|
|
67
|
+
>
|
|
68
|
+
> `complete` now checks **terminal state before holder**, scoped to the device
|
|
69
|
+
> that finished the job: a replay from that device is answered `duplicate:
|
|
70
|
+
> true` with a 2xx, and anyone else gets exactly the refusal they would get
|
|
71
|
+
> for a job that is not terminal. Previously `RESULT_IDEMPOTENT` held only
|
|
72
|
+
> because the lease is nulled on success, so the holder check tripped first —
|
|
73
|
+
> deleting the idempotency branch failed no test. Run the store contract
|
|
74
|
+
> tests; the compiler cannot see this.
|
|
15
75
|
>
|
|
16
76
|
> **`alpha.3` is a breaking change.** `BackendDescriptor.account` is gone —
|
|
17
77
|
> read `cost` (`free` / `metered` / `subscription`) instead. Four new MUSTs
|
|
18
78
|
> come with it; see `byollm_007`.
|
|
19
79
|
|
|
80
|
+
<!-- release-note 0.1.0-alpha.21 -->
|
|
81
|
+
> [!NOTE]
|
|
82
|
+
> **`0.1.0-alpha.20` is not a complete release — do not pin it.** Four
|
|
83
|
+
> packages published and `@byollm/server` did not: a Sigstore
|
|
84
|
+
> transparency-log 409 on its provenance attestation. The workflow's
|
|
85
|
+
> "already published" guard correctly refuses to resume a partial publish,
|
|
86
|
+
> so `0.1.0-alpha.21` is that release, whole.
|
|
87
|
+
>
|
|
88
|
+
> If you run the Supabase adapter, `alpha.21` needs
|
|
89
|
+
> `20260819010000_completed_by_lease_id.sql`: alpha.19 shipped §3.6's
|
|
90
|
+
> ordering without the column it stores the grant in.
|
|
91
|
+
|
|
92
|
+
<!-- release-note 0.1.0-alpha.40 -->
|
|
93
|
+
**`byollm install` — stop keeping a terminal open.** The daemon can now run
|
|
94
|
+
under your computer's own supervisor and restart itself if it stops: a launchd
|
|
95
|
+
agent on macOS, a `systemd --user` unit on Linux, a logon task on Windows. All
|
|
96
|
+
user-level — no root, no system directories, and `byollm uninstall` takes it
|
|
97
|
+
away. `byollm status` gained a line saying whether it is actually supervised
|
|
98
|
+
right now, including the state that matters most: installed but not running,
|
|
99
|
+
which looks fine from an app's dashboard and serves nothing.
|
|
100
|
+
|
|
101
|
+
If you are running via `npx`, install properly first (`npm install -g
|
|
102
|
+
byollm@alpha`) — `install` refuses to supervise a copy in npx's cache, because
|
|
103
|
+
npm deletes that directory and the service would fail at some later boot.
|
|
104
|
+
|
|
105
|
+
<!-- release-note 0.1.0-alpha.41 -->
|
|
106
|
+
**`onNoRunner` takes a string.** Your fallback answer is your own value, not
|
|
107
|
+
wire data, and handing back a whole result record for it was ceremony — the
|
|
108
|
+
README's own example got the shape wrong, which is how this was found.
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
const { outcome, fallback } = await job.result({
|
|
112
|
+
onNoRunner: () => runOnHostedModel(transcript),
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Whatever you return, `result()` labels it `fallback: true` — the stamp is
|
|
117
|
+
applied by the wait, not taken from you, so an answer that did not run on
|
|
118
|
+
somebody's device cannot be reported as though it did (`FALLBACK_LABELED`).
|
|
119
|
+
Both delivery channels do it, polling and Supabase Realtime. Records still
|
|
120
|
+
work; they just get labelled too.
|
|
121
|
+
|
|
20
122
|
# `@byollm/protocol`
|
|
21
123
|
|
|
22
124
|
The BYOLLM wire contract: TypeScript types, zod schemas, and the pure rules
|
|
@@ -64,10 +166,10 @@ job's owner.
|
|
|
64
166
|
import { matchAudience } from "@byollm/protocol";
|
|
65
167
|
|
|
66
168
|
matchAudience(
|
|
67
|
-
{ owner: "alice", audience: "
|
|
169
|
+
{ owner: "alice", audience: "team" },
|
|
68
170
|
{
|
|
69
171
|
owner: "bob",
|
|
70
|
-
offerScope: "
|
|
172
|
+
offerScope: "team",
|
|
71
173
|
account: "open",
|
|
72
174
|
// The daemon's OWN allowlist decides — never the server's assertion.
|
|
73
175
|
locallyAllows: (owner) => owner === "alice",
|