lobstack 0.1.1 → 0.1.2
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 +9 -8
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# lobstack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Lobstack API from your terminal: one key, every model, and what each call
|
|
4
|
+
cost.
|
|
4
5
|
|
|
5
6
|
```bash
|
|
6
7
|
npx lobstack init
|
|
@@ -60,7 +61,7 @@ worse than not having it.
|
|
|
60
61
|
| | |
|
|
61
62
|
|---|---|
|
|
62
63
|
| `/model [name]` | set the model, or open the picker |
|
|
63
|
-
| `/models` | what the
|
|
64
|
+
| `/models` | what the API will serve, with prices. `auto` — Nex 1, the router — is first, priced `—` because it costs whatever it picks |
|
|
64
65
|
| `/spend [days]` | what you have actually spent, from the usage API |
|
|
65
66
|
| `/receipt` | every field of the last receipt, verbatim, plus the session tally |
|
|
66
67
|
| `/proxy [port]` | serve the OpenAI-compatible endpoint from this process |
|
|
@@ -101,11 +102,11 @@ your shell reading mouse packets as keystrokes. Nothing here needs a mouse.
|
|
|
101
102
|
|---|---|
|
|
102
103
|
| `lobstack init` | Save a key to `~/.lobstack/config.json`, mode 0600. Verifies it before writing. |
|
|
103
104
|
| `lobstack chat "<prompt>"` | One call, streamed. Answer to stdout, receipt to stderr, so `> out.txt` gives you the answer alone. |
|
|
104
|
-
| `lobstack models` | What the
|
|
105
|
+
| `lobstack models` | What the API will serve, with prices. `auto` — Nex 1 — leads the list with no price of its own. Also public at <https://www.lobstack.ai/models>. |
|
|
105
106
|
| `lobstack spend [--days 7]` | What you have spent. Needs a key with the `usage:read` scope. |
|
|
106
107
|
| `lobstack proxy [--port 8787]` | A local OpenAI-compatible endpoint. |
|
|
107
108
|
|
|
108
|
-
Flags: `--model` (default `auto
|
|
109
|
+
Flags: `--model` (default `auto`, which is **Nex 1**, the router), `--key`, `--base`, `--json`, `--force`.
|
|
109
110
|
`LOBSTACK_API_KEY` and `LOBSTACK_BASE_URL` win over the saved config.
|
|
110
111
|
|
|
111
112
|
## The proxy
|
|
@@ -157,12 +158,12 @@ window title. Escapes are removed, not rendered.
|
|
|
157
158
|
|
|
158
159
|
## Cost is read, never computed
|
|
159
160
|
|
|
160
|
-
The
|
|
161
|
+
The Lobstack API puts the price on the final SSE frame under `x_lobstack`, because on
|
|
161
162
|
a streamed response the headers are written before the provider has counted a
|
|
162
163
|
token. This CLI reads that number. It does not multiply token counts by a
|
|
163
164
|
bundled rate card — our own desktop client did exactly that, and printed
|
|
164
165
|
`$0.00` for three months next to a correct invoice, because its copy of the
|
|
165
|
-
rate card knew six models and the
|
|
166
|
+
rate card knew six models and the API serves several times that.
|
|
166
167
|
|
|
167
168
|
That is also why the UI shows no running dollar figure *during* a stream. Until
|
|
168
169
|
the last frame lands there is no price to show, so it shows elapsed time and how
|
|
@@ -170,13 +171,13 @@ much text arrived, and says the price is still coming.
|
|
|
170
171
|
|
|
171
172
|
Three rules follow, and they hold on every screen:
|
|
172
173
|
|
|
173
|
-
- `cost_usd` is `null`, never `0`, when the
|
|
174
|
+
- `cost_usd` is `null`, never `0`, when the API could not price a call. That
|
|
174
175
|
prints `unpriced`. A zero renders as "free", and writing off a real charge is
|
|
175
176
|
the most expensive way to be wrong about money. A session whose calls were all
|
|
176
177
|
unpriced shows `unpriced` as its total, not `$0.000000`; a session with some of
|
|
177
178
|
each shows the priced total and counts the rest out loud — `+1 unpriced`.
|
|
178
179
|
- `saved` means the router beat a model **you named**. `vs ceiling` means you
|
|
179
|
-
sent `auto` and the
|
|
180
|
+
sent `auto` and the API measured against the priciest model your plan
|
|
180
181
|
allows. `baseline_reason` says which, the receipt says which, and the two are
|
|
181
182
|
separate running totals that are never added together.
|
|
182
183
|
- No figure is ever truncated to fit.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lobstack",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "The Lobstack
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "The Lobstack API from your terminal: one key, every model, and what each call cost.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"lobstack": "./src/index.mjs"
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"anthropic",
|
|
21
21
|
"proxy",
|
|
22
22
|
"cli",
|
|
23
|
-
"lobstack"
|
|
23
|
+
"lobstack",
|
|
24
|
+
"lobstack-api"
|
|
24
25
|
],
|
|
25
26
|
"license": "MIT",
|
|
26
27
|
"repository": {
|