@jossuealcala/madre 1.0.2 → 1.0.3
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/CHANGELOG.en.md +69 -1
- package/CHANGELOG.md +69 -1
- package/README.en.md +11 -15
- package/README.md +3 -3
- package/bin/madre.cjs +40 -0
- package/bin/madre.mjs +5 -0
- package/docs/REFERENCE.md +29 -3
- package/docs/SDK.md +4 -2
- package/docs/en/REFERENCE.md +29 -3
- package/docs/en/SDK.md +4 -2
- package/docs/training/README.md +28 -1
- package/docs/training/train.sh +5 -1
- package/package.json +3 -3
- package/public/app.js +1626 -151
- package/public/attribution.js +44 -1
- package/public/brands.js +20 -5
- package/public/code-tools.js +143 -0
- package/public/editor.js +20 -4
- package/public/es.js +393 -25
- package/public/hardware.js +50 -0
- package/public/index.html +5 -1
- package/public/macroverso.js +187 -96
- package/public/market-art.js +161 -0
- package/public/market-view.js +529 -0
- package/public/market.js +189 -0
- package/public/neural.js +110 -0
- package/public/nostromo-engine.js +412 -47
- package/public/power.js +100 -0
- package/public/resay.js +5 -0
- package/public/salas-mac.css +98 -14
- package/public/salas-mac.html +9 -1
- package/public/salas-mac.js +307 -30
- package/public/styles.css +838 -61
- package/public/tour.js +48 -6
- package/public/troubleshooting.js +6 -1
- package/public/wallpaper.js +275 -0
- package/src/adapters/cursor.mjs +96 -0
- package/src/adapters/gemini.mjs +10 -3
- package/src/adapters/madre.mjs +2 -1
- package/src/auth-probe.mjs +143 -12
- package/src/bridge/policy.mjs +1 -1
- package/src/capabilities.mjs +9 -0
- package/src/checkpoint.mjs +16 -1
- package/src/credentials.mjs +3 -0
- package/src/dataset.mjs +76 -4
- package/src/enlaces.mjs +208 -2
- package/src/extensions.mjs +11 -3
- package/src/i18n.mjs +16 -0
- package/src/looks.mjs +125 -2
- package/src/market-key.mjs +8 -0
- package/src/market-remote.mjs +239 -0
- package/src/models.mjs +4 -0
- package/src/module-scope.mjs +68 -0
- package/src/modules/ahp.mjs +102 -7
- package/src/modules/bishop-exam.mjs +122 -0
- package/src/modules/bishop.mjs +71 -12
- package/src/modules/enlaces.mjs +87 -6
- package/src/modules/image-studio.mjs +10 -1
- package/src/modules/intents.mjs +3 -1
- package/src/modules/local-models.mjs +124 -0
- package/src/modules/ollama.mjs +12 -3
- package/src/modules/playwright.mjs +73 -15
- package/src/modules/sdk.mjs +61 -9
- package/src/npm-launch.mjs +18 -0
- package/src/ollama.mjs +6 -5
- package/src/outbound.mjs +9 -1
- package/src/ports.mjs +4 -2
- package/src/room/control.mjs +1 -1
- package/src/room/prompt.mjs +13 -2
- package/src/room.mjs +14 -4
- package/src/router.mjs +1 -1
- package/src/runs.mjs +4 -1
- package/src/runtime-detection.mjs +9 -0
- package/src/salas.mjs +26 -0
- package/src/server.mjs +617 -48
- package/src/setup.mjs +1 -1
package/docs/en/REFERENCE.md
CHANGED
|
@@ -15,7 +15,7 @@ You need Node 22.5 or later and at least one of these CLIs with a signed-in sess
|
|
|
15
15
|
|
|
16
16
|
1. Run `npx @jossuealcala/madre` from any folder: it opens Home, with all your projects and the Coordinator at the top. The first time, a three-step assistant walks you through it: connect the agents (each with its own button to install it and sign in, right there; once for all projects), add the projects (you choose folders inside your user folder; adding does not open them) and open the ones you are going to use. `npx @jossuealcala/madre start` inside a folder still opens that project directly; if there are no agents, the project opens anyway on Connect your agents so you can install them and sign in.
|
|
17
17
|
2. The project opens at `http://127.0.0.1:4317`. Pick an agent in the selector or type `@claude …`. The chip next to `to @agente` says which mode the message goes out in; `#1 CHAT ONLY`, read-only, is the default.
|
|
18
|
-
3. To add or reconnect an AI later: Settings → Agents (the settings button in the bar, or ⌘, / Ctrl+,), where the agents live alongside the rest of the settings. Codex
|
|
18
|
+
3. To add or reconnect an AI later: Settings → Agents (the settings button in the bar, or ⌘, / Ctrl+,), where the agents live alongside the rest of the settings. Codex, Claude Code, Gemini (with your Google account) and OpenCode (with GitHub Copilot) sign in with one click; Gemini and OpenCode also accept their key right there. Under each agent, "Prefer your terminal?" unfolds the same step written as a command, for whoever prefers to do it by hand. MADRE does not store provider credentials: each session and each key goes to its own CLI's file.
|
|
19
19
|
4. With Ollama, the Local AI module (Modules, in the bar) is already on: memory is embedded locally and `@madre` appears in the row.
|
|
20
20
|
5. Settings → Memory decides who distills the memory and how often. The Memory map, from the Diagnostics header, shows what the project remembers.
|
|
21
21
|
|
|
@@ -25,13 +25,24 @@ npx @jossuealcala/madre setup # the same setup, from the terminal, if you
|
|
|
25
25
|
npx @jossuealcala/madre start --no-open --project RUTA
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
**On a server, with no screen.** MADRE listens only on `127.0.0.1` of the machine it runs on, and on purpose: it has no password, and whoever reached it could set the agents to work there. Do not open its ports to the network. To use it on a server, open it through an SSH tunnel from your computer. Home uses 4317 and every project you open takes the next free port (4318, 4319…), so the tunnel carries several; if you open more projects, add more `-L`.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# on your computer: reach the server with the tunnel
|
|
32
|
+
ssh -L 4317:127.0.0.1:4317 -L 4318:127.0.0.1:4318 -L 4319:127.0.0.1:4319 -L 4320:127.0.0.1:4320 user@server
|
|
33
|
+
# now on the server
|
|
34
|
+
npx @jossuealcala/madre --no-open
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then open `http://127.0.0.1:4317/salas` in your computer's browser. The agents are installed on the server and connected from Settings › Agents: Claude gives you a link and a code you paste right there, and Gemini and OpenCode take their key. Use your own user, not root: the agents work with the permissions of whoever runs MADRE.
|
|
38
|
+
|
|
28
39
|
**Three names.** **MADRE** is the product. **Diagnostics** is its operational voice: failures, connections, settings. **Log** is the channel the project runs on: the event record, the plan block, the `.pulse/` folder where artifacts land; those identifiers keep their old name, PULSE.
|
|
29
40
|
|
|
30
41
|
---
|
|
31
42
|
|
|
32
43
|
## THE PROJECT
|
|
33
44
|
|
|
34
|
-
**Connect your agents.** With no agents online, the project opens on Connect your agents: one card per agent with its real status and the one action that applies to it, `INSTALL` or `SIGN IN`. Everything runs on your machine, with the command in view, and the output streams to the same screen. Codex
|
|
45
|
+
**Connect your agents.** With no agents online, the project opens on Connect your agents: one card per agent with its real status and the one action that applies to it, `INSTALL` or `SIGN IN`. Everything runs on your machine, with the command in view, and the output streams to the same screen. Codex, Claude Code and Gemini sign in with one click because their CLI opens the browser (Gemini has no sign-in command: MADRE selects "Login with Google" in its settings, answers for you the yes it asks before opening the browser and stops the run as soon as the CLI saves its session; if it does not finish, its files are left as they were). OpenCode signs in with GitHub Copilot: MADRE runs `opencode auth login -p github-copilot`, picks github.com in its menu and shows the page and the device code you type on GitHub. The room only offers providers that allow this kind of access to third-party tools: never a Claude subscription (Anthropic does not allow it) and, for now, not ChatGPT or GitLab either; those and GitHub Enterprise stay in `opencode auth login`, in your terminal. Gemini and OpenCode also accept their key right there, which MADRE writes where that CLI looks for it, with the file locked to your user and without keeping a copy anywhere, only from this computer. Each card also says which account that agent signs in with and whether there is a free entry, so choosing is not a blind guess. That screen folds away as soon as an agent is ready and does not come back: it is the first contact of a project with no one inside. From then on the agents live in `⚙ CONNECTIONS`, with the same buttons and, alongside, each agent's modes, permissions and keys.
|
|
35
46
|
|
|
36
47
|
**The bar.** The brand with its heartbeat, the project root, the agents, `LIVE`, the alerts (`STOP ALL`, new version), `MODULES`, `Diagnostics`, theme and files panel. Each agent sphere carries its usage, what it has consumed: the provider's real limit when the CLI publishes it, otherwise MADRE's local window. One click expands it.
|
|
37
48
|
|
|
@@ -53,6 +64,8 @@ A second click on the chosen sphere, or the `default model ▾` chip, picks the
|
|
|
53
64
|
|
|
54
65
|
**Files.** The icon on the right opens the project tree in read-only mode. The viewer numbers lines; click and Shift+click select a range and `REVIEW WITH` sends it to an agent. With **Preview** turned on in `MODULES`, HTML, SVG and Markdown are rendered in a sealed frame instead of showing their code, with a back/reload bar and automatic reload when an agent changes the file.
|
|
55
66
|
|
|
67
|
+
**Code.** The `CODE` key in the bar opens the viewer beside the conversation as a code workspace: the project's files with their search, tabs (up to 12, still there after a reload) and, above the code, the path and the function the caret is in. ⌘P (Ctrl+P outside macOS) opens a file by its name. Switching tabs never loses what you wrote: the draft stays in its tab, marked with a dot, until you save or discard it. What an agent changed in its last `#3` EDIT turn is marked in its colour, with one card per change: **Keep** (it stops being marked), **Undo** (puts back what was there in those lines only; the rest of the turn stays) and **Ask why** (asks the agent in the conversation). A turn taken back with `UNDO`, or lines you rewrote yourself, are no longer marked. When you ask for a review of some lines, `REVIEW WITH` offers Explain, Improve, Write tests and Fix. **Side by side** puts the rendered Markdown next to the code as you write, or the HTML page reloaded when you save (the latter with Preview on). What you kept is stored in `code-reviewed.json`, next to the project's record (`GET /api/files/changes`, `POST /api/files/changes/review`).
|
|
68
|
+
|
|
56
69
|
**Theme.** Sun/moon in the bar: automatic, light or dark. The light theme does not glare; the Diagnostics screen stays phosphor.
|
|
57
70
|
|
|
58
71
|
**Language.** The project speaks **Spanish** by default. The `EN` button in the bar switches it to English and the browser remembers it; `PULSE_LANGUAGE=en` overrides the config on the next start. A language is only how things read: what was written in the ledger keeps the words it was written with, and when shown it is said again in the project's language.
|
|
@@ -139,6 +152,8 @@ Everything said outside INCOGNITO is indexed alongside the ledger, in `~/.pulse/
|
|
|
139
152
|
|
|
140
153
|
**Memory map.** The memory as a map, behind the project name: MADRE is a beating red sun, each memory a planet in the color of its type, joined by pulsing veins. You can navigate it and read it, and the only thing you can do to it is delete, with double confirmation. Eight taps on the heart activate the Temporary lock and seal the archive for ten minutes.
|
|
141
154
|
|
|
155
|
+
**Neural mode.** The **Neural** key in the header of the Memory map and the Project map draws the same network as the neurons of a brain: each memory is a point of light in the color of its type, the links are thin axons, and only the paths a pulse travels and the neuron it reaches light up. The core (and, in the Project map, the Coordinator) is the central bulb of that brain, with its stem, and it beats. Turning it on, the light runs out from the core and reaches every neuron in turn. It shows the same and costs a fraction: no surface shaded point by point, no nebula, no stars. When the computer does not give the map the frames it needs, the key invites you to try it, once a session; you choose when to use each mode. The choice is remembered for Home and every project (`pulse.neural` in `~/.pulse/looks.json`).
|
|
156
|
+
|
|
142
157
|
**@madre.** With Ollama and a chat model, the memory speaks: `@madre` answers from the whole archive with `[#n]` citations, says when the project never discussed something, does not write or run anything, and summons the agents if you ask it to. Its tokens are local and do not count. When there is a model trained on the project, it uses it.
|
|
143
158
|
|
|
144
159
|
**Settings.** Settings → Memory: who distills, who may, how often, where embedding happens, how much context recall can take up. All in `~/.pulse/config.json`, without restarting.
|
|
@@ -153,7 +168,7 @@ The project gathers training material while you work. `MEMORY` shows live how ma
|
|
|
153
168
|
|
|
154
169
|
`EXPORT DATASET` writes `train.jsonl` and `valid.jsonl` next to the ledger, redacted. The `TRAIN` card brings the commands already filled in with your project folder and the base model that fits on your machine. Training runs outside MADRE, with mlx on Apple Silicon; the recipe lives in [`docs/training/`](training/README.md). As soon as Ollama has a `madre-<proyecto>` model, `@madre` answers with it and the other CLIs are told to ask it first: the project's memory stops costing tokens.
|
|
155
170
|
|
|
156
|
-
**Ollama.** If it runs on the machine, MADRE uses it without any configuration: local smart search, local archivist, `@madre`. The Local AI module, in Modules, shows the server, models and roles, downloads the recommended ones and lets you turn off each role. `qwen2.5:7b`
|
|
171
|
+
**Ollama.** If it runs on the machine, MADRE uses it without any configuration: local smart search, local archivist, `@madre`. The Local AI module, in Modules, shows the server, models and roles, downloads the recommended ones and lets you turn off each role. The model it offers comes from your hardware, not from a fixed rule: the "Your computer" block reads the Apple chip and its shared memory, the NVIDIA card and its video memory, or the processor alone, and shows each Qwen2.5 size (0.5B to 72B) with its minimum to run and to train (for example, `qwen2.5:7b` from 12 GB and `qwen2.5:3b` from 8 GB). With several downloaded, it uses the largest; it prefers general chat models over the `-coder` ones.
|
|
157
172
|
|
|
158
173
|
---
|
|
159
174
|
|
|
@@ -233,6 +248,7 @@ In a project, the key next to the house **switches project**: its indicator says
|
|
|
233
248
|
| `POST /api/salas/forget` | Remove a project from MADRE: closes it if it is open, revokes its connections and sets its `project.json` aside as `project.forgotten.json`. Never the Coordinator's | The Home page with its `Origin`, never a process |
|
|
234
249
|
| `GET /api/tour` · `POST /api/tour` | The 1.0 tour: whether the bonjour is due, whether the person comes from 0.7.2, chapters read, where they left off, hints seen. Saved in `~/.pulse/tour.json`, one per person, not one per port | The pages on this Mac |
|
|
235
250
|
| `GET /api/looks` · `POST /api/looks` | The appearance that Home and all projects share: theme, accent, background and its two dials, bubbles and text. Saved in `~/.pulse/looks.json`, one per person; each page reads it when it opens and when it becomes visible again, and writes it when it changes. What Home chooses for its cards stays in its browser | The pages on this Mac |
|
|
251
|
+
| `GET /api/looks/wallpaper` · `PUT /api/looks/wallpaper` · `POST /api/looks/wallpaper/frame` · `DELETE /api/looks/wallpaper` | Your own wallpaper (1.0.3): one for every page, in `~/.pulse/wallpaper/`. The page fits it (2880 px on its longest side), encodes it and takes its colours for the veil, the mesh and the tint; the server keeps only a WebP, JPEG or PNG picture of up to 8 MB, recognised by its first bytes (never SVG), and serves it with its type and `nosniff`. `GET /api/looks` includes it as `custom`; each page still chooses it or not (`pulse.wallpaper` = `custom`) | The pages on this Mac |
|
|
236
252
|
| `GET /api/tour/projects` · `POST /api/tour/projects` | The 0.7.2 projects that Home cannot list (without `project.json`) and bringing one in: its folder is looked up by name in the usual folders and confirmed by the hash of its id. Projects removed on purpose do not come back | The pages on this Mac |
|
|
237
253
|
| `POST /api/override/arm` | The #3 and #4 key, checked by the project (`src/override.mjs`): what was typed, once or twice, and a pass for that agent and that mode. A message at #3 or #4 goes out only with its pass; without a remembered permission it opens one message, with it, as many as fit in its minutes. STOP ALL and a restart revoke them. Eight wrong keys in one minute return 429. The phrase's fingerprint never goes out through `GET /api/settings` or `/api/state` | The pages on this Mac |
|
|
238
254
|
| `GET /api/copilot` · `POST /api/copilot` · `POST /api/copilot/off` | The copilot: whether it is on and until when; turning it on with the `#3` key (`{ minutes, words }`, 30 to 1440 min) and turning it off. A message with `copilot: true` in `#3` goes without a pass while it lasts; when off it returns 409 with `copilotOff`. Never from a phone | The pages on this Mac |
|
|
@@ -241,6 +257,16 @@ In a project, the key next to the house **switches project**: its indicator says
|
|
|
241
257
|
| `GET /api/enlace/memories` | What this project delivers under a contract: only `travels()` and the contract's types, redacted; 404 if the contract does not serve whoever asks, 423 sealed, 429 over the cap | Another MADRE process with the channel key (`~/.pulse/credentials/enlaces.json`), without `Origin` |
|
|
242
258
|
| `POST /api/enlace/ask` | What this project asks of another; only for a turn running here (409 if not); records `enlace.received` with agent and turn | A turn's `pulse-enlaces` server, with the key |
|
|
243
259
|
| `POST /api/salas/enlaces/recall` | Check or uncheck "Always include" on a connection | The Home page, never a process |
|
|
260
|
+
| `GET /api/enlace/corpus` | (D-S15) Everything this project lets the Coordinator learn under a contract with `train`: the notes that travel, of the contract's types, up to 5,000, redacted; 404 if the contract does not allow it, 423 sealed, 429 over its cap of 6 an hour | The Coordinator's room, with the channel key, without `Origin` |
|
|
261
|
+
| `POST /api/salas/enlaces/train` | Check or uncheck "The Coordinator learns from it"; unchecking it deletes the copy Salas kept | The Home page, never a process |
|
|
262
|
+
| `GET /api/enlace/state` | (D-S16) This project's canonical Continuity (AHP+) state under a contract with `state`: objective, phase, next step, blockers, last handoff, accepted decisions and what is open, redacted; `state: null` without `.ahp/`; 404 if the contract does not allow it, 423 sealed, 429 over `perHour` | The reading room, with the channel key, without `Origin` |
|
|
263
|
+
| `POST /api/enlace/deliver` | (D-S17) Notes the reading room delivers under a contract with `deliver` (1 to 5, of the standing kinds, 600 characters); they wait in the inbox; 429 over `perHour` or with 50 waiting | The reading room, with the channel key, without `Origin` |
|
|
264
|
+
| `POST /api/enlace/ask-state`, `POST /api/enlace/send` | The asking side of the above, for the `enlace_state` and `enlace_deliver` tools of a turn running here | A process of this Mac with the key and a live turn |
|
|
265
|
+
| `GET /api/enlace/inbox` · `POST /api/enlace/inbox/decide` | (D-S17) The notes delivered to this project, and accepting or declining one; accepted, it enters the memory (`origin: 'delivered'`) | The project's page, or one of its agents in #3/#4 with the key |
|
|
266
|
+
| `POST /api/salas/enlaces/allow` | (D-S16, D-S17) Check or uncheck "It shares its state" (`state`) or "It receives delivered notes" (`deliver`) | The Home page, never a process |
|
|
267
|
+
| `POST /api/madre/shutdown` | Turn MADRE off: asks every open project to close the way Home closes one, waits up to 15 s and closes itself; answers `closed` and `stuck` | Only MADRE's own page on this computer (its own `Origin`), never a process or the phone |
|
|
268
|
+
| `GET /api/home-layout` · `POST /api/home-layout` | Home's arrangement in `~/.pulse/home.json` (widgets, project order, pinned bar, cards), the same from any port | The Home page |
|
|
269
|
+
| `GET /api/x/bishop/exam` · `POST /api/x/bishop/exam` | (D-S18) The last exam of the Coordinator's local model and whether it still holds for the model in use; starting it (it runs in the background) | The Home page |
|
|
244
270
|
| `POST /api/enlace/notice` | The Diagnostics line when signing or revoking | The project that serves Home, with the key |
|
|
245
271
|
|
|
246
272
|
Contracts live in `~/.pulse/config.json` under `enlaces` and the crossings in `enlaces.jsonl` next to each project's record.
|
package/docs/en/SDK.md
CHANGED
|
@@ -54,7 +54,7 @@ export default ({ defineModule }) => defineModule({
|
|
|
54
54
|
|
|
55
55
|
## What a module can declare
|
|
56
56
|
|
|
57
|
-
This table is **the complete contract**:
|
|
57
|
+
This table is **the complete contract**: 38 fields, not one more. Any other field you write, MADRE
|
|
58
58
|
tells you about at install time ("I didn't understand these fields") instead of silently ignoring it. A test in
|
|
59
59
|
the suite compares this table against the code, so if they ever drift apart, it's a failure.
|
|
60
60
|
|
|
@@ -66,11 +66,13 @@ the suite compares this table against the code, so if they ever drift apart, it'
|
|
|
66
66
|
| `tracks` | If your module wraps something from outside, its version isn't yours: it's that thing's. Declare `{ name, npm }` or `{ name, github }` and return the version found in `status(ctx)` as `runs: [{ name, version }]`. MADRE shows that version and looks for a newer one on its own, once a day, with the page's ↻ button to check now |
|
|
67
67
|
| `updatePlan(ctx, { latest })` | How that new version is brought to this computer: `{ command, args, display, note, after }`. MADRE shows `display` and runs nothing until the human has read it; the output lands in the room line by line. With no command, return `{ command: null, note, download }` and the page sends you to download it |
|
|
68
68
|
| `updates` | An https `{ url }` where you publish **your own module**. With that, its page gets a button that fetches the file, verifies it the same way as an installation, and replaces it if it passes. If you installed it from a file, MADRE remembers which one and you don't need to declare anything: edit it and ask for a new copy |
|
|
69
|
-
| `settings` | Default values. They live in `~/.pulse/config.json` under `modules.<idEnCamelCase>`; `enabled` is the switch |
|
|
69
|
+
| `settings` | Default values. They live in `~/.pulse/config.json` under `modules.<idEnCamelCase>`; `enabled` is the switch for every project, and `rooms` keeps what each project said, which wins. MADRE works it out for you: `ctx.settings.enabled` is already this project's |
|
|
70
70
|
| `status(ctx)` | What the card shows: `{ status: { installed, detail }, preflight: { ok, problems }, install: { display } }`. `install` is returned from here; it is not a top-level field of the module |
|
|
71
71
|
| `status(ctx)` → `runs` | What your module manages that isn't MADRE: `[{ name, version, target }]`. `version` is what you found on this computer (`null` if it isn't there), `target` is what you would install. If it matches `tracks.name`, that is the page's version |
|
|
72
72
|
| `toggle(ctx, payload)` | Replaces the default switch; `confirm: 'texto'` asks for confirmation before turning on |
|
|
73
73
|
| `onToggle(ctx, enabled)` | Reacts to the switch |
|
|
74
|
+
| `ready(ctx)` | What you ask before turning on, in one project or in all (from the Market too): `null` when ready, `{ status, body: { error } }` when not. Turning off never asks it |
|
|
75
|
+
| `footer` | Up to two keys beside MADRE's version, bottom right, while your module is on: `[{ icon: 'heart' \| 'star' \| 'link', label, text, action, url }]`. Words can be one sentence or `{ en, es }`; `url` must be https and opens in a new tab. MADRE draws it: on hover it shows `text` and a button with `action` |
|
|
74
76
|
| `slash` | `/name` commands that run on the server with your `ctx` and return `{ ok, title, text }`. The room shows them as a card and the agents read them |
|
|
75
77
|
| `toolsForTurn(ctx, turn)` | MCP servers for an agent's turn: `[{ name, command, args, env, tools, sends, brief }]`. MADRE attaches them to the CLI in its isolated run and describes `brief` to the agent. `turn` carries the agent, the mode, the lease, the folder, the port, and `turn.turn`: the id of the reply that turn will write. If your server calls back to the room on behalf of the turn, send that id; `ctx.room.runningTurn(id)` tells you whether it is still running and for which agent |
|
|
76
78
|
| `toolsForTurn` → `sends` | Which of your tools **send something outside**. The core withdraws them below `#4` AIRLOCK: the model isn't even told they exist. See below |
|
package/docs/training/README.md
CHANGED
|
@@ -36,7 +36,27 @@ python3 -c "import mlx.core as mx; print('CUDA:', mx.cuda.is_available())" # d
|
|
|
36
36
|
|
|
37
37
|
Si dice `True`, los comandos de entrenamiento de arriba (desde `cd ~/.pulse/rooms/<proyecto>`) y los pasos 3 y 4 son los mismos. Si no, no hay ruta probada en Linux todavía.
|
|
38
38
|
|
|
39
|
-
`train.sh` en esta carpeta hace lo mismo con comprobaciones
|
|
39
|
+
`train.sh` en esta carpeta hace lo mismo con comprobaciones (`bash train.sh <carpeta del proyecto> <base>`).
|
|
40
|
+
|
|
41
|
+
### Qué tamaño entrenar
|
|
42
|
+
|
|
43
|
+
No depende de una máquina en particular, sino de la memoria de la tuya. MADRE la mide (Módulos › IA local › Tu equipo) y propone el tamaño más grande que tu computadora entrena y luego corre. Los mínimos son para la computadora completa, con el sistema y el navegador abiertos:
|
|
44
|
+
|
|
45
|
+
| Modelo | Base para entrenar | Para correrlo | Para entrenarlo |
|
|
46
|
+
|---|---|---|---|
|
|
47
|
+
| Qwen2.5 0.5B | `Qwen/Qwen2.5-0.5B-Instruct` | 4 GB | 8 GB |
|
|
48
|
+
| Qwen2.5 1.5B | `Qwen/Qwen2.5-1.5B-Instruct` | 6 GB | 12 GB |
|
|
49
|
+
| Qwen2.5 3B | `mlx-community/Qwen2.5-3B-Instruct-4bit` | 8 GB | 16 GB |
|
|
50
|
+
| Qwen2.5 7B | `mlx-community/Qwen2.5-7B-Instruct-4bit` | 12 GB | 24 GB |
|
|
51
|
+
| Qwen2.5 14B | `mlx-community/Qwen2.5-14B-Instruct-4bit` | 20 GB | 36 GB |
|
|
52
|
+
| Qwen2.5 32B | `mlx-community/Qwen2.5-32B-Instruct-4bit` | 36 GB | 64 GB |
|
|
53
|
+
| Qwen2.5 72B | `mlx-community/Qwen2.5-72B-Instruct-4bit` | 64 GB | 128 GB |
|
|
54
|
+
|
|
55
|
+
- En una Mac con chip Apple la memoria es compartida: cuenta toda.
|
|
56
|
+
- Con una tarjeta NVIDIA cuenta la memoria de la tarjeta (VRAM), que rinde un tercio más porque el modelo la tiene para él solo.
|
|
57
|
+
- Sin ninguna de las dos, un modelo corre en el procesador, más lento, y no se entrena: un LoRA en procesador tarda días.
|
|
58
|
+
|
|
59
|
+
Desde 3B la base viene en 4 bits (QLoRA), y desde 7B `train.sh` agrega `--grad-checkpoint`. Una ronda de 600 iteraciones tarda de 10 a 40 minutos hasta 3B, y una hora o más por encima. El disco libre que hace falta ronda 5.5 GB por cada mil millones de parámetros, más 2 GB.
|
|
40
60
|
|
|
41
61
|
## 3 · Servir en Ollama
|
|
42
62
|
|
|
@@ -52,6 +72,13 @@ python3 llama.cpp/convert_hf_to_gguf.py fused --outfile madre.gguf --outtype q8_
|
|
|
52
72
|
cp <carpeta de MADRE>/docs/training/Modelfile . && ollama create madre-<proyecto> -f Modelfile
|
|
53
73
|
```
|
|
54
74
|
|
|
75
|
+
Con una base en 4 bits (3B en adelante) el paso cambia en tres puntos:
|
|
76
|
+
1. `mlx_lm.fuse` lleva `--de-quantize`, para que llama.cpp pueda leer el resultado.
|
|
77
|
+
2. La conversión usa `--outtype f16`.
|
|
78
|
+
3. `ollama create` lleva `--quantize q4_K_M`, que lo deja en 4 bits, el tamaño que cuenta la tabla.
|
|
79
|
+
|
|
80
|
+
La pantalla de entrenamiento de MADRE ya escribe así los comandos para el tamaño que elijas.
|
|
81
|
+
|
|
55
82
|
El nombre importa: `madre-<proyecto>` en minúsculas, con guiones. Al siguiente **REVISAR OTRA VEZ** en Módulos › IA local, `@madre` cambia a ese modelo y Lo que recuerda lo dice. El `Modelfile` viene en `docs/training/` del repositorio de MADRE y del paquete de npm.
|
|
56
83
|
|
|
57
84
|
## 4 · Evaluar antes de confiar
|
package/docs/training/train.sh
CHANGED
|
@@ -11,8 +11,12 @@ PAIRS=$(wc -l < "$ROOM/dataset/train.jsonl")
|
|
|
11
11
|
[ "$PAIRS" -ge 50 ] || { echo "only $PAIRS training pairs; let the room grow (aim for a few hundred)"; exit 3; }
|
|
12
12
|
python3 -c "import mlx_lm" 2>/dev/null || { echo "pip install mlx-lm (inside a venv) first"; exit 4; }
|
|
13
13
|
cd "$ROOM"
|
|
14
|
+
# From 7B up, recompute instead of keeping every activation: slower, and it fits the memory the
|
|
15
|
+
# room's table promises for that size (src/modules/local-models.mjs).
|
|
16
|
+
EXTRA=()
|
|
17
|
+
if [[ "$BASE" =~ -([0-9]+)B- ]] && [ "${BASH_REMATCH[1]}" -ge 7 ]; then EXTRA+=(--grad-checkpoint); fi
|
|
14
18
|
echo "training LoRA on $PAIRS pairs · base $BASE · $ITERS iterations"
|
|
15
|
-
mlx_lm.lora --model "$BASE" --train --data dataset --iters "$ITERS" --batch-size 2 --learning-rate 1e-5 --adapter-path adapters
|
|
19
|
+
mlx_lm.lora --model "$BASE" --train --data dataset --iters "$ITERS" --batch-size 2 --learning-rate 1e-5 --adapter-path adapters ${EXTRA[@]+"${EXTRA[@]}"}
|
|
16
20
|
mlx_lm.lora --model "$BASE" --adapter-path adapters --data dataset --test
|
|
17
21
|
echo
|
|
18
22
|
echo "adapters in $ROOM/adapters · next: mlx_lm.fuse, convert to GGUF, ollama create madre-<project> (see README.md)"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jossuealcala/madre",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "MADRE · one local room where the AI coding agents already on your machine (Codex, Claude Code, Gemini CLI, OpenCode) work on your project together, share one memory you can see and explore, and answer to you. Read-only by default, with per-message permission modes and checkpoints you can undo. Nothing leaves your machine on its own.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"docs/en/training"
|
|
66
66
|
],
|
|
67
67
|
"bin": {
|
|
68
|
-
"madre": "./bin/madre.
|
|
69
|
-
"pulse": "./bin/madre.
|
|
68
|
+
"madre": "./bin/madre.cjs",
|
|
69
|
+
"pulse": "./bin/madre.cjs"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=22.5.0"
|