@octocodeai/freellama-mcp-server 0.6.1 → 0.7.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 +2 -2
- package/dist/index.js +4893 -2565
- package/docs/ARCHITECTURE.md +5 -3
- package/docs/CLI.md +8 -5
- package/docs/MODEL_SELECTION.md +43 -2
- package/docs/PRODUCTION.md +6 -4
- package/docs/TESTING.md +2 -1
- package/native/index.d.ts +1 -0
- package/package.json +16 -15
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -395,9 +395,11 @@ authority. Configured settings alone do not prove physical processor placement.
|
|
|
395
395
|
The shared [resource governor](https://github.com/bgauryy/FreeLlama/blob/main/packages/rust-core/src/platform/resources/mod.rs) samples local
|
|
396
396
|
available-memory estimates, load per logical CPU, OS memory pressure, active swap-out growth, and
|
|
397
397
|
thermal throttling when reported. OS memory pressure holds every local demand; active swap-out
|
|
398
|
-
growth holds new loads; CPU-load
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
growth holds new loads; the CPU-load hold applies only to CPU-assigned work (saturated cores slow
|
|
399
|
+
nothing on the GPU, so raw passthrough, which cannot know residency, is not refused for it), and to
|
|
400
|
+
all work on a host whose sampler sees no accelerator; the
|
|
401
|
+
thermal hold applies to CPU-assigned work and to cold loads (a new heat source) but not to a bounded
|
|
402
|
+
request on a runner already resident on the GPU (`ResourceDemand::is_held_by`; the assessment's
|
|
401
403
|
`held_by` lists the holds that applied). Low available RAM (below the larger of 15% or 1 GiB, clearing after two
|
|
402
404
|
healthy samples above the larger of 20% or 2 GiB) depends on the platform (`ResourcePolicy::low_memory`).
|
|
403
405
|
A new load must leave that reserve free, but never more than its own size above the 1 GiB floor.
|
package/docs/CLI.md
CHANGED
|
@@ -148,10 +148,13 @@ cache (and is the hard cap in a container), the same shortfall unloads idle runn
|
|
|
148
148
|
new load with `held_insufficient_capacity` until capacity returns, refusing with 503 at its deadline.
|
|
149
149
|
OS memory pressure holds all work where the OS reports it (macOS, and Linux when the kernel
|
|
150
150
|
exposes `/proc/pressure/memory`; Windows has no host collector yet). Active swapping and low RAM hold new loads only:
|
|
151
|
-
an already-resident runner adds no memory and stays admitted. CPU-load (one-minute load at
|
|
152
|
-
1.5 per logical CPU)
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
an already-resident runner adds no memory and stays admitted. The CPU-load hold (one-minute load at
|
|
152
|
+
or above 1.5 per logical CPU) applies only to CPU-assigned work, which decodes on those cores; GPU
|
|
153
|
+
work, loaded or not, proceeds, so another program's build never blocks a GPU model. On a host where
|
|
154
|
+
the sampler sees no accelerator (no GPU device or GPU memory), every model runs on the CPU, so the
|
|
155
|
+
hold applies to all work there. The
|
|
156
|
+
thermal-throttling hold applies to CPU-assigned work and to cold loads, a new heat source; a bounded
|
|
157
|
+
request on a runner already resident on the GPU proceeds. The receipt's `resource_admission.assessment.held_by`
|
|
155
158
|
lists the holds that applied to the request.
|
|
156
159
|
Both `serve` and `proxy` accept `--resource-telemetry-policy`:
|
|
157
160
|
|
|
@@ -231,7 +234,7 @@ Useful task options include:
|
|
|
231
234
|
- `--context-tokens` for the complete input and output context window (`num_ctx`).
|
|
232
235
|
- repeatable `--required-capability` constraints.
|
|
233
236
|
- repeatable `--image` paths for vision tasks.
|
|
234
|
-
- `--input-file`
|
|
237
|
+
- `--input-file` reads the input from a file: one item per line for `--task embedding` (batched in one request), otherwise the whole file is the prompt.
|
|
235
238
|
- `--min-confidence low|medium` to refuse insufficiently evidenced routes before generation.
|
|
236
239
|
- `--priority interactive|normal|background` for fair admission scheduling.
|
|
237
240
|
- `--max-wait-seconds` for a shorter admission/resource wait budget.
|
package/docs/MODEL_SELECTION.md
CHANGED
|
@@ -4,8 +4,9 @@ To offload a task, select an installed model with the required capabilities and
|
|
|
4
4
|
then check its memory fit under the intended concurrency. FreeLlama applies model eligibility
|
|
5
5
|
and admission; the calling agent still verifies the output.
|
|
6
6
|
|
|
7
|
-
The measurements in this guide come from
|
|
8
|
-
|
|
7
|
+
The measurements in this guide come from single machines and are not compiled into routing:
|
|
8
|
+
[Recommended starting points](#recommended-starting-points-by-form) from an Apple M2 Pro with 32 GB,
|
|
9
|
+
the sections after it from an Apple M4 Pro with 48 GB unified memory. Re-run
|
|
9
10
|
`npx @octocodeai/freellama doctor`, `models`, `bench-all`, and your quality suite on the target hardware.
|
|
10
11
|
`doctor.machine.memory_bytes` is host RAM; a discrete GPU's usable VRAM must be observed separately.
|
|
11
12
|
|
|
@@ -26,6 +27,46 @@ flowchart TD
|
|
|
26
27
|
M -->|"Yes"| B["Benchmark locally and add policy evidence"]
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
## Recommended starting points by form
|
|
31
|
+
|
|
32
|
+
Measured on an Apple M2 Pro with 32 GB, Ollama 0.40.8 and FreeLlama 0.6.1 on 2026-10-30, while
|
|
33
|
+
other builds kept the one-minute load near 14 on 12 cores. Every check had a known answer; the
|
|
34
|
+
batteries are small, so treat these as first picks to re-check on your machine, not rankings.
|
|
35
|
+
|
|
36
|
+
| Form | Model (download) | Measured | Speed (warm) | How an agent calls it |
|
|
37
|
+
|---|---|---|---|---|
|
|
38
|
+
| Text, tools, JSON, reasoning | `gpt-oss:20b` (13.8 GB) | 7/7: exact output, arithmetic, bat-and-ball, code reading, JSON extraction, tool call, 9/9 ticket routing | 1.4 s per routed ticket | `run_task {model:"gpt-oss:20b", prompt, think:"low"}`; add `tools` or `format:"json"` |
|
|
39
|
+
| Embeddings | `nomic-embed-text:v1.5` (274 MB) | Retrieval 4/4 top-1; ticket routing 9/9 from two examples per team | 51 ms per item, batched | `run_task {task:"embedding", input:[...], returnEmbeddings:true}` |
|
|
40
|
+
| Decisions (classify, route, score) | `strands-decider:2b-nvfp4` (1.3 GB) | Ticket routing 9/9, return-policy yes/no 3/3, damage rubric 2/3 | 0.17 s per question | `POST <serve>/v1/systemone {model, state, questions}`: passthrough, no MCP tool yet |
|
|
41
|
+
| OCR | `glm-ocr:latest` (2.2 GB) | 4/4 phrases from a dense report strip; 0/7 on text tasks | 11 s per strip at a 400-token cap | `run_task {task:"vision", model:"glm-ocr", prompt:"Text Recognition:", images:[...], stopOnRepetition:true}` |
|
|
42
|
+
|
|
43
|
+
`gpt-oss:20b` reasons before answering; the battery ran it with `think:"low"` and a 2,048-token
|
|
44
|
+
output cap, so leave room for the reasoning when you set `num_predict`. `glm-ocr` reads text from images only and keeps generating
|
|
45
|
+
after the visible text ends, so cap its output or set `stopOnRepetition`. The decision model needs
|
|
46
|
+
Apple silicon and answers only through Ollama's decision API; reach it through `serve` so the call
|
|
47
|
+
still passes FreeLlama's memory checks and stream cap (from 0.6.2 a busy CPU no longer refuses it).
|
|
48
|
+
|
|
49
|
+
### Classify text three ways
|
|
50
|
+
|
|
51
|
+
The same nine support tickets, routed to billing, technical or returns:
|
|
52
|
+
|
|
53
|
+
| Approach | Model | Correct | Per item | Use when |
|
|
54
|
+
|---|---|---:|---:|---|
|
|
55
|
+
| Embeddings and per-class centroids | `nomic-embed-text:v1.5` | 9/9 | 51 ms | Many items, stable classes, a few labeled examples per class |
|
|
56
|
+
| Decision model | `strands-decider:2b-nvfp4` | 9/9 | 0.5 s (first call includes the load) | You need probabilities, yes/no policy checks or rubric scores |
|
|
57
|
+
| Instruction model with JSON output | `gpt-oss:20b` | 9/9 | 1.4 s | Classes change per request or need explanation |
|
|
58
|
+
|
|
59
|
+
A decision API request names its questions; each answer comes back under the same name:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
curl -s http://127.0.0.1:11435/v1/systemone -H 'content-type: application/json' -d '{
|
|
63
|
+
"model": "strands-decider:2b-nvfp4",
|
|
64
|
+
"state": "Why did my credit card get billed two times?",
|
|
65
|
+
"questions": {"team": {"type": "choice", "instructions": "Which team handles this ticket?",
|
|
66
|
+
"criteria": {"billing": "Charges and invoices", "technical": "App errors", "returns": "Returns and refunds"}}}
|
|
67
|
+
}'
|
|
68
|
+
```
|
|
69
|
+
|
|
29
70
|
## Text, code, and vision
|
|
30
71
|
|
|
31
72
|
`qwen3.8:27b-mlx` was the strongest general model in the local evaluations. It handled coding,
|
package/docs/PRODUCTION.md
CHANGED
|
@@ -11,8 +11,8 @@ not provide tenant isolation or billing.
|
|
|
11
11
|
## Meet the prerequisites
|
|
12
12
|
|
|
13
13
|
- Install one Ollama CLI and server version. Run `freellama doctor` and resolve any mismatch.
|
|
14
|
-
- Install Node.js
|
|
15
|
-
- Use the release artifacts for your operating system, or build with Rust 1.
|
|
14
|
+
- Install Node.js 22 or later for MCP and npm distribution use.
|
|
15
|
+
- Use the release artifacts for your operating system, or build with Rust 1.89 or later.
|
|
16
16
|
- Preinstall and benchmark exact model tags. Discovery never authorizes a pull.
|
|
17
17
|
- Keep the primary and optional CPU Ollama processes on distinct loopback sockets.
|
|
18
18
|
- In a slim or distroless container, install the CA bundle (`ca-certificates`) or set
|
|
@@ -42,8 +42,10 @@ release-artifacts release`, then `yarn release:verify:publish`. The publish veri
|
|
|
42
42
|
Live E2E and hardware qualification remain separate operator checks; verify those receipts before tagging.
|
|
43
43
|
|
|
44
44
|
Attach `release/SHA256SUMS` and binaries to the release. Publish the eight `@octocodeai/freellama-native-*` packages
|
|
45
|
-
first, followed by the exact-version `@octocodeai/freellama` and `@octocodeai/freellama-mcp-server` packages.
|
|
46
|
-
|
|
45
|
+
first, followed by the exact-version `@octocodeai/freellama` and `@octocodeai/freellama-mcp-server` packages. Publish
|
|
46
|
+
the Rust crates from the same commit with `cargo publish --workspace` (it uploads `freellama-core`
|
|
47
|
+
before `freellama-cli`; run it with `--dry-run` first). Configure registry credentials (`npm login`,
|
|
48
|
+
`cargo login`) in the release environment; never store them in the repository.
|
|
47
49
|
|
|
48
50
|
## Configure Ollama explicitly
|
|
49
51
|
|
package/docs/TESTING.md
CHANGED
|
@@ -210,7 +210,8 @@ yarn release:verify:publish
|
|
|
210
210
|
Build every claimed CLI/native target in a clean environment, assemble `SHA256SUMS`, run the full
|
|
211
211
|
deterministic suite, and inspect every platform package dry run before publishing explicitly.
|
|
212
212
|
Publish the eight `@octocodeai/freellama-native-*` packages before `@octocodeai/freellama` and `@octocodeai/freellama-mcp-server`, all
|
|
213
|
-
at the exact same version
|
|
213
|
+
at the exact same version, then the crates with `cargo publish --workspace` (`--dry-run` first packages
|
|
214
|
+
and compiles both crates from their published sources). A successful local pack dry run proves package contents; it does not
|
|
214
215
|
prove registry publication or another hardware class.
|
|
215
216
|
|
|
216
217
|
## Test one layer while iterating
|
package/native/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octocodeai/freellama-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "MCP server exposing FreeLlama core as tools, via native NAPI bindings into packages/rust-core.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"coding-agent"
|
|
17
17
|
],
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=22"
|
|
20
20
|
},
|
|
21
21
|
"type": "module",
|
|
22
22
|
"main": "dist/index.js",
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"build:native": "yarn --cwd ../.. build:native"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
50
|
-
"zod": "^
|
|
49
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
50
|
+
"zod": "^4.6.7"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@octocodeai/freellama-native-darwin-arm64": "0.
|
|
54
|
-
"@octocodeai/freellama-native-darwin-x64": "0.
|
|
55
|
-
"@octocodeai/freellama-native-linux-arm64-gnu": "0.
|
|
56
|
-
"@octocodeai/freellama-native-linux-arm64-musl": "0.
|
|
57
|
-
"@octocodeai/freellama-native-linux-x64-gnu": "0.
|
|
58
|
-
"@octocodeai/freellama-native-linux-x64-musl": "0.
|
|
59
|
-
"@octocodeai/freellama-native-win32-arm64-msvc": "0.
|
|
60
|
-
"@octocodeai/freellama-native-win32-x64-msvc": "0.
|
|
53
|
+
"@octocodeai/freellama-native-darwin-arm64": "0.7.0",
|
|
54
|
+
"@octocodeai/freellama-native-darwin-x64": "0.7.0",
|
|
55
|
+
"@octocodeai/freellama-native-linux-arm64-gnu": "0.7.0",
|
|
56
|
+
"@octocodeai/freellama-native-linux-arm64-musl": "0.7.0",
|
|
57
|
+
"@octocodeai/freellama-native-linux-x64-gnu": "0.7.0",
|
|
58
|
+
"@octocodeai/freellama-native-linux-x64-musl": "0.7.0",
|
|
59
|
+
"@octocodeai/freellama-native-win32-arm64-msvc": "0.7.0",
|
|
60
|
+
"@octocodeai/freellama-native-win32-x64-msvc": "0.7.0"
|
|
61
61
|
},
|
|
62
62
|
"author": "Guy Bary",
|
|
63
63
|
"license": "Apache-2.0 OR MIT",
|
|
@@ -66,9 +66,10 @@
|
|
|
66
66
|
"registry": "https://registry.npmjs.org/"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@types/node": "^22.
|
|
69
|
+
"@types/node": "^22.20.5",
|
|
70
70
|
"esbuild": "^0.28.2",
|
|
71
|
-
"typescript": "^
|
|
72
|
-
"
|
|
71
|
+
"typescript": "^7.0.2",
|
|
72
|
+
"vite": "^8.3.5",
|
|
73
|
+
"vitest": "^5.0.5"
|
|
73
74
|
}
|
|
74
75
|
}
|