@lazyingart/agintiflow 0.20.197 → 0.20.198
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/.env.example +34 -0
- package/AGENTS.md +1 -1
- package/README.md +26 -16
- package/docs/auxiliary-image-generation.md +6 -0
- package/docs/external-skill-packs.md +1 -1
- package/docs/large-codebase-engineering.md +7 -7
- package/docs/local-first-agent-runtime.md +199 -0
- package/docs/model-selection.md +29 -12
- package/docs/patch-tools.md +1 -1
- package/docs/perception-and-web-research.md +9 -6
- package/docs/productive-agent-roadmap.md +2 -2
- package/docs/self-development-supervision.md +2 -2
- package/docs/skills-and-tools.md +9 -5
- package/i18n/README.ar.md +24 -12
- package/i18n/README.de.md +24 -12
- package/i18n/README.es.md +24 -12
- package/i18n/README.fr.md +24 -12
- package/i18n/README.ja.md +24 -12
- package/i18n/README.ko.md +24 -12
- package/i18n/README.ru.md +24 -12
- package/i18n/README.vi.md +24 -12
- package/i18n/README.zh-Hans.md +24 -12
- package/i18n/README.zh-Hant.md +24 -12
- package/package.json +28 -5
- package/public/app.js +106 -277
- package/public/index.html +27 -15
- package/public/markdown-renderer.js +222 -0
- package/public/math-renderer.js +163 -0
- package/public/styles.css +48 -0
- package/references/lazyingrouter-account-login-design.md +9 -8
- package/references/model-routing-provider-design.md +25 -16
- package/references/venice-model-reference.md +6 -4
- package/scripts/fixtures/local-first-agent-eval-fixtures.mjs +93 -0
- package/scripts/local-first-agent-eval.mjs +696 -0
- package/scripts/smoke-auth.js +10 -8
- package/scripts/smoke-auxiliary-tools.js +108 -3
- package/scripts/smoke-cli-chat.js +306 -5
- package/scripts/smoke-execution-policy.js +61 -1
- package/scripts/smoke-inbox.js +416 -0
- package/scripts/smoke-local-resource-policy.js +112 -0
- package/scripts/smoke-localllm-auto-max.js +393 -0
- package/scripts/smoke-localllm-model-tiers.js +365 -0
- package/scripts/smoke-localllm-provider.js +723 -0
- package/scripts/smoke-math-rendering.js +213 -0
- package/scripts/smoke-mcp.js +108 -1
- package/scripts/smoke-model-roles.js +94 -24
- package/scripts/smoke-perception-research.js +254 -0
- package/scripts/smoke-progressive-tool-selection.js +1178 -0
- package/scripts/smoke-safe-chat.js +27 -9
- package/scripts/smoke-session-runtime.js +385 -0
- package/scripts/smoke-truthful-completion.js +234 -0
- package/scripts/smoke-web-api.js +194 -3
- package/scripts/smoke-web-ui.js +31 -11
- package/scripts/smoke-writing-specialist-routing.js +200 -0
- package/src/agent-runner.js +732 -25
- package/src/auth-onboarding.js +20 -7
- package/src/auxiliary-tools.js +139 -22
- package/src/cli.js +179 -20
- package/src/config.js +188 -34
- package/src/context-budget-controller.js +90 -5
- package/src/guardrails.js +95 -9
- package/src/i18n.js +11 -11
- package/src/interactive-cli.js +202 -70
- package/src/json-specialist.js +31 -9
- package/src/local-auto-max.js +203 -0
- package/src/local-resource-policy.js +130 -0
- package/src/model-client.js +114 -31
- package/src/model-routing.js +382 -75
- package/src/perception-tools.js +148 -18
- package/src/progressive-tool-selection.js +695 -0
- package/src/project.js +71 -61
- package/src/provider-contract.js +309 -0
- package/src/provider-runtime.js +447 -0
- package/src/safe-chat-wrapper.js +53 -23
- package/src/scs-evidence.js +9 -5
- package/src/session-runtime.js +626 -0
- package/src/session-store.js +499 -19
- package/src/task-profiles.js +1 -1
- package/src/tool-contract.js +291 -0
- package/src/web-db.js +49 -8
- package/src/writing-specialist.js +106 -34
- package/web.js +280 -138
package/.env.example
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Local-only credentials template. Copy to .env and keep it untracked.
|
|
2
|
+
# Do not commit real values.
|
|
3
|
+
|
|
4
|
+
# Default local-first text provider. Keep LocalLLM on loopback.
|
|
5
|
+
LOCALLLM_BASE_URL=http://127.0.0.1:8008/v1
|
|
6
|
+
LOCALLLM_API_KEY=local-dev-key
|
|
7
|
+
AGINTI_LOCALLLM_ROUTE_MODEL=localllm-fast
|
|
8
|
+
AGINTI_LOCALLLM_MAIN_MODEL=localllm-deep
|
|
9
|
+
AGINTI_LOCALLLM_MAX_MODEL=localllm-max
|
|
10
|
+
AGINTI_LOCALLLM_ALLOW_AUTO_MAX=false
|
|
11
|
+
AGINTI_LOCALLLM_VISION_MODEL=localllm-vision-xl
|
|
12
|
+
AGINTI_LOCALLLM_CONTEXT_TOKENS=32768
|
|
13
|
+
AGINTI_LOCALLLM_MAX_OUTPUT_TOKENS=8192
|
|
14
|
+
AGINTI_LOCALLLM_TOOL_SCHEMA_TOKENS=4096
|
|
15
|
+
|
|
16
|
+
# Auto-Max is off unless explicitly enabled. Enabled runs still require authenticated
|
|
17
|
+
# alias discovery plus a fresh RAM/swap/GPU headroom check before selecting Max.
|
|
18
|
+
# Hosted provider keys below never act as a LocalLLM failure fallback.
|
|
19
|
+
|
|
20
|
+
# Optional explicit hosted upgrades. They are never automatic fallbacks.
|
|
21
|
+
DEEPSEEK_API_KEY=
|
|
22
|
+
OPENAI_API_KEY=
|
|
23
|
+
AGINTI_ALLOW_HOSTED_IMAGE_PERCEPTION=false
|
|
24
|
+
AGINTI_ALLOW_HOSTED_WEB_RESEARCH=false
|
|
25
|
+
AGINTI_ALLOW_HOSTED_JSON_SPECIALIST=false
|
|
26
|
+
# A cross-provider writer needs both an explicit target and the permission below.
|
|
27
|
+
AGINTI_WRITING_PROVIDER=
|
|
28
|
+
AGINTI_WRITING_MODEL=
|
|
29
|
+
AGINTI_ALLOW_HOSTED_WRITING_SPECIALIST=false
|
|
30
|
+
|
|
31
|
+
# Optional local npm publish fallback. Prefer GitHub Actions Trusted Publishing.
|
|
32
|
+
NPM_TOKEN=
|
|
33
|
+
NODE_AUTH_TOKEN=
|
|
34
|
+
NPM_CONFIG_REGISTRY=https://registry.npmjs.org/
|
package/AGENTS.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- `npm run smoke:coding-tools`: verify mock workspace writes, patches, and path guardrail blocks.
|
|
21
21
|
- `npm pack --dry-run`: inspect npm package contents before release.
|
|
22
22
|
|
|
23
|
-
Use `AGENT_PROVIDER=openai`, `AGENT_PROVIDER=deepseek`, or `AGENT_PROVIDER=mock`
|
|
23
|
+
Use `AGENT_PROVIDER=localllm` for the default loopback LocalLLM runtime. Select `AGENT_PROVIDER=openai`, `AGENT_PROVIDER=deepseek`, or another hosted provider only as an explicit upgrade; saved or ambient hosted keys authenticate that choice but never select it or create a fallback. Use `AGENT_PROVIDER=mock` for deterministic offline tests.
|
|
24
24
|
|
|
25
25
|
## Coding Style & Naming Conventions
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|

|
|
14
14
|

|
|
15
15
|

|
|
16
|
-

|
|
17
17
|

|
|
18
18
|

|
|
19
19
|

|
|
@@ -49,12 +49,12 @@ Most agent tools are either a chat box with hidden state or an expensive one-mod
|
|
|
49
49
|
|
|
50
50
|
| Principle | What it means in practice |
|
|
51
51
|
| --- | --- |
|
|
52
|
-
|
|
|
52
|
+
| Local intelligence changes the architecture | The baseline uses the sibling LocalLLM gateway for private route and main lanes. Stronger hosted models remain explicit upgrades, not hidden fallbacks. |
|
|
53
53
|
| Inspectable beats mysterious | Plans, tool calls, file diffs, command output, canvas artifacts, and session events are saved and resumable. |
|
|
54
54
|
| Disciplined by default | `AGINTI.md` starts with a behavior contract: surface ambiguity, keep edits surgical, avoid speculative complexity, verify outcomes, and respect permission blockers. |
|
|
55
|
-
| Role-based models | Route, main, spare, wrapper, and auxiliary image roles are separate.
|
|
56
|
-
| Writing without agent noise | `writing_specialist` drafts novels, books, scripts, essays, and paper prose in an isolated writing-only context
|
|
57
|
-
| Visual and web evidence | `read_image`
|
|
55
|
+
| Role-based models | Route, main, spare, wrapper, and auxiliary image roles are separate. LocalLLM supplies the default fast/deep lanes; DeepSeek, OpenAI, OpenRouter, Qwen, and Venice are optional explicit routes. |
|
|
56
|
+
| Writing without agent noise | `writing_specialist` drafts novels, books, scripts, essays, and paper prose in an isolated writing-only context on the active provider. Cross-provider writing requires explicit permission; ambient keys and model arguments cannot silently switch a LocalLLM session to a hosted model. The main agent then handles files, formatting, citations, checks, and artifacts. |
|
|
57
|
+
| Visual and web evidence | `read_image` uses the loopback LocalLLM vision model in local sessions and never falls through to a hosted provider. `web_research` saves sourced snippet artifacts for local synthesis. OpenAI perception/research and wrapper second opinions require explicit provider/tool permission. |
|
|
58
58
|
| Scouts before big work | Parallel scouts can cheaply map architecture, tests, risks, symbols, and integration points before the main executor edits anything. |
|
|
59
59
|
| SCS by default | Student-Committee-Supervisor mode adds a typed gate: committee drafts, student approves/monitors, supervisor executes. Use `/scs off` or `--no-scs` only when speed matters more than validation. |
|
|
60
60
|
| AAPS for large workflows | AAPS describes top-down agentic pipeline scripts; AgInTiFlow can act as the interactive backend that validates, compiles, and executes those workflows. |
|
|
@@ -85,7 +85,9 @@ aginti init --template aaps
|
|
|
85
85
|
aginti init --template supervision
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
By default, AgInTiFlow connects to the sibling LocalLLM gateway at `http://127.0.0.1:8008/v1`, using `localllm-fast` for routing and the installed 30B-A3B Q4 `localllm-deep` for substantive coding and agent work. The Q8 `localllm-max` remains resource-gated on every new or resumed run (24 GiB available RAM, no more than 75% swap use, and 40 GiB aggregate free NVIDIA memory). The automatic Vision policy requires both a trusted image-input signal and confirmed model capability; the shipped CLI/web currently use the readiness-checked local `read_image` tool or an explicit `localllm-vision-xl` selection rather than inferring vision from prompt keywords. Routing does not load a model. Startup checks the LocalLLM service, its Ollama runtime, selected aliases, and any required Max headroom before inference. A local failure stops with an actionable error; it never silently sends the task to a hosted provider.
|
|
89
|
+
|
|
90
|
+
Hosted providers are optional, explicit upgrades. When you select DeepSeek, OpenAI, OpenRouter, Qwen, or Venice, the auth wizard can save that provider's key account-wide in `~/.agintiflow/.env` with restricted permissions. Current project `.aginti/.env` files can still override account defaults when needed. You can rerun setup any time:
|
|
89
91
|
|
|
90
92
|
```bash
|
|
91
93
|
aginti auth
|
|
@@ -100,6 +102,7 @@ Provider signup and key pages:
|
|
|
100
102
|
|
|
101
103
|
| Provider | Register / key page | API base URL used by AgInTiFlow |
|
|
102
104
|
| --- | --- | --- |
|
|
105
|
+
| LocalLLM | Local sibling service; no signup | `http://127.0.0.1:8008/v1` |
|
|
103
106
|
| DeepSeek | [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys) | `https://api.deepseek.com` |
|
|
104
107
|
| OpenRouter | [https://openrouter.ai/settings/keys](https://openrouter.ai/settings/keys) | `https://openrouter.ai/api/v1` |
|
|
105
108
|
| Venice | [https://venice.ai/settings/api](https://venice.ai/settings/api) | `https://api.venice.ai/api/v1` |
|
|
@@ -180,7 +183,7 @@ aginti --language de
|
|
|
180
183
|
| Sync reviewed skills | `aginti skillmesh status`, `aginti skillmesh sync` |
|
|
181
184
|
| Update CLI | `aginti update` |
|
|
182
185
|
|
|
183
|
-
Interactive chat supports slash completion, Up/Down selectors, a newest-first resume selector with direct Space pagination, multiline input with `Ctrl+J`, full resume history, Markdown rendering, visible run status, ASAP pipe messages during a run, and clean interruption/resume with `Ctrl+C`. Installed interactive commands also check npm for a newer AgInTiFlow release and show an update/skip selector; source checkouts and non-TTY automation are left alone.
|
|
186
|
+
Interactive chat supports slash completion, Up/Down selectors, a newest-first resume selector with direct Space pagination, multiline input with `Ctrl+J`, full resume history, Markdown rendering, visible run status, ASAP pipe messages during a run, and clean interruption/resume with `Ctrl+C`. A resumed session keeps its versioned provider/model/tool-policy snapshot; current preferences do not silently change it, and explicit changes use revision checks. Installed interactive commands also check npm for a newer AgInTiFlow release and show an update/skip selector; source checkouts and non-TTY automation are left alone.
|
|
184
187
|
|
|
185
188
|
AgInTiFlow treats `maxSteps` as an initial budget, not a silent infinite loop. By default, real-provider runs can receive a bounded extension only near the limit, only when recent tool/file/artifact evidence shows concrete progress, and never to bypass permission, package, host, or secret guardrails. Use `--dynamic-steps off` for a strict hard stop, or `--dynamic-steps on` to test the budget gate in mock/offline runs.
|
|
186
189
|
|
|
@@ -242,15 +245,15 @@ The website keeps the visual walkthrough in a carousel so this README can stay f
|
|
|
242
245
|
| File tools | `inspect_project`, `list_files`, `read_file`, `search_files`, `write_file`, `apply_patch`, `open_workspace_file`, `preview_workspace`, and `read_image`. |
|
|
243
246
|
| Shell tools | Guarded host or Docker workspace shell execution with package-install policy and command safety checks. |
|
|
244
247
|
| Browser tools | Playwright browser actions with lazy startup and optional domain allowlists. |
|
|
245
|
-
| Model routing |
|
|
248
|
+
| Model routing | LocalLLM Fast/Deep defaults, explicit and resource-gated Max, image-capability-gated Vision XL, explicit DeepSeek/OpenAI/OpenRouter/Qwen/Venice/mock routes, and optional spare/wrapper/auxiliary models. |
|
|
246
249
|
| Writing specialist | A dedicated writing-only LLM call for prose, chapters, scripts, books, essays, research-paper sections, and revisions, with formatter handoff notes for Markdown/LaTeX/Final Draft. |
|
|
247
250
|
| Patch workflow | Codex-style patch envelopes, unified diffs, exact replacements, hashes, compact diffs, and path guardrails. |
|
|
248
251
|
| Parallel scouts | Optional scout calls for architecture, implementation, review, tests, git flow, research, symbol tracing, and dependency risk. |
|
|
249
|
-
| Image reading and web research |
|
|
252
|
+
| Image reading and web research | LocalLLM sessions send pixels only to the loopback vision endpoint. `web_research` preserves source lists for the active model to synthesize. Hosted OpenAI and wrapper paths are explicit opt-ins, never credential-driven fallbacks. |
|
|
250
253
|
| SCS mode | Default Student-Committee-Supervisor quality gate with independent planning, execution, and validation roles. |
|
|
251
254
|
| AAPS adapter | Optional `@lazyingart/aaps` integration for `.aaps` workflow init, validate, parse, compile, dry-run, and run commands. |
|
|
252
255
|
| AgentLink | Local-first collaboration between AgInTi sessions through boards, typed messages, action contracts, safe summaries, and evidence bundles. |
|
|
253
|
-
| Image generation | Optional GRS AI and Venice image tools with saved manifests and canvas
|
|
256
|
+
| Image generation | Optional, default-off GRS AI and Venice image tools with saved manifests and canvas previews. Credentials authenticate the selected provider but never select or fail over providers. |
|
|
254
257
|
| Skill library | Built-in Markdown skills plus project-local `.aginti/skills/<id>/SKILL.md` skills for reusable workflow knowledge that should not be hard-coded into the runtime. |
|
|
255
258
|
| External skill packs | Whole Agent Skills repositories can be loaded as grouped packs without flattening. A sibling `../scientific-agent-skills` checkout is discovered as the `scientific` category, so commands like `aginti skills rdkit` and `aginti skills "single cell scanpy"` expose K-Dense Scientific Agent Skills when present. |
|
|
256
259
|
| Skill Mesh | Optional strict skill recording/sharing for reviewed reusable skill packs. If unused, AgInTiFlow runs normally without background sharing. |
|
|
@@ -262,11 +265,11 @@ AgInTiFlow does not treat "the model" as one global setting. It has roles:
|
|
|
262
265
|
|
|
263
266
|
| Role | Default | Purpose |
|
|
264
267
|
| --- | --- | --- |
|
|
265
|
-
| Route | `
|
|
266
|
-
| Main | `
|
|
267
|
-
| Spare | `
|
|
268
|
+
| Route | `localllm/localllm-fast` | Local planner, triage, short tasks, and routing decisions. |
|
|
269
|
+
| Main | `localllm/localllm-deep` | Local complex executor for coding, debugging, writing, research, and long tasks. |
|
|
270
|
+
| Spare | `localllm/localllm-deep` medium | Local cross-check lane; a hosted spare requires explicit selection. |
|
|
268
271
|
| Wrapper | `codex/gpt-5.5` medium | Optional external coding-agent advisor; `research_wrapper` defaults to `gpt-5.4-mini` medium for image/web second opinions. |
|
|
269
|
-
| Auxiliary | `grsai/nano-banana-2` |
|
|
272
|
+
| Auxiliary | `grsai/nano-banana-2` (off) | Explicitly enabled image generation and other non-text helper tools; no credential-driven provider failover. |
|
|
270
273
|
|
|
271
274
|
Useful selectors:
|
|
272
275
|
|
|
@@ -280,7 +283,7 @@ Useful selectors:
|
|
|
280
283
|
/venice
|
|
281
284
|
```
|
|
282
285
|
|
|
283
|
-
Venice routes can be used for optional uncensored or less restricted creative work. DeepSeek
|
|
286
|
+
Venice routes can be used for optional uncensored or less restricted creative work. DeepSeek and the other hosted providers remain explicit upgrades for tasks that benefit from them. See [docs/model-selection.md](docs/model-selection.md), [docs/local-first-agent-runtime.md](docs/local-first-agent-runtime.md), and [references/venice-model-reference.md](references/venice-model-reference.md).
|
|
284
287
|
OpenRouter is available as a first-class OpenAI-compatible provider with one key and company-grouped model buckets such as OpenRouter OpenAI, Anthropic, Google, DeepSeek, Qwen, Meta, Mistral, Moonshot, and xAI.
|
|
285
288
|
|
|
286
289
|
## AAPS And Large Workflows
|
|
@@ -356,6 +359,13 @@ Detailed runtime notes are in [docs/runtime-modes-and-autonomy.md](docs/runtime-
|
|
|
356
359
|
Common environment variables:
|
|
357
360
|
|
|
358
361
|
```bash
|
|
362
|
+
AGENT_PROVIDER=localllm
|
|
363
|
+
LOCALLLM_BASE_URL=http://127.0.0.1:8008/v1
|
|
364
|
+
LOCALLLM_API_KEY=local-dev-key
|
|
365
|
+
AGINTI_LOCALLLM_ROUTE_MODEL=localllm-fast
|
|
366
|
+
AGINTI_LOCALLLM_MAIN_MODEL=localllm-deep
|
|
367
|
+
|
|
368
|
+
# Optional explicit hosted upgrades; never automatic LocalLLM fallbacks.
|
|
359
369
|
DEEPSEEK_API_KEY=...
|
|
360
370
|
OPENAI_API_KEY=...
|
|
361
371
|
OPENROUTER_API_KEY=...
|
|
@@ -364,7 +374,6 @@ OPENROUTER_MODEL=openrouter/auto
|
|
|
364
374
|
QWEN_API_KEY=...
|
|
365
375
|
VENICE_API_KEY=...
|
|
366
376
|
GRSAI_API_KEY=...
|
|
367
|
-
AGENT_PROVIDER=deepseek
|
|
368
377
|
AGENT_ROUTING_MODE=smart
|
|
369
378
|
AGINTI_TASK_PROFILE=auto
|
|
370
379
|
AGINTI_LANGUAGE=en
|
|
@@ -398,6 +407,7 @@ More detail:
|
|
|
398
407
|
| AAPS adapter | [docs/aaps.md](docs/aaps.md) |
|
|
399
408
|
| AgentLink | [docs/agentlink.md](docs/agentlink.md) |
|
|
400
409
|
| Model selection and roles | [docs/model-selection.md](docs/model-selection.md) |
|
|
410
|
+
| Local-first provider and agent boundary | [docs/local-first-agent-runtime.md](docs/local-first-agent-runtime.md) |
|
|
401
411
|
| SCS mode | [docs/student-committee-supervisor.md](docs/student-committee-supervisor.md) |
|
|
402
412
|
| Large-codebase engineering | [docs/large-codebase-engineering.md](docs/large-codebase-engineering.md) |
|
|
403
413
|
| Runtime modes and autonomy | [docs/runtime-modes-and-autonomy.md](docs/runtime-modes-and-autonomy.md) |
|
|
@@ -7,6 +7,8 @@ AgInTiFlow separates **skills** from **tools**:
|
|
|
7
7
|
|
|
8
8
|
The optional image-generation skills are `image_generation` and `venice_image_generation`. Both use the deterministic `generate_image` tool.
|
|
9
9
|
|
|
10
|
+
Hosted image generation is off by default. Enable the auxiliary mode explicitly with `/auxiliary on`, `/auxiliary image`, the corresponding UI toggle, or `allowAuxiliaryTools=true`. Merely storing `GRSAI` or `VENICE_API_KEY` does not expose or authorize `generate_image` in an agent run.
|
|
11
|
+
|
|
10
12
|
`generate_image` is a raster-image tool. It does not produce true SVG/vector output. If a caller requests `svg`, the tool records
|
|
11
13
|
`requestedFormat: "svg"`, generates a PNG fallback with `actualFormat: "png"`, and returns a `formatNotice`. If the task truly requires
|
|
12
14
|
editable vectors, use AgInTiFlow file tools to write deterministic SVG/LaTeX/HTML instead of calling `generate_image`.
|
|
@@ -32,6 +34,8 @@ Inside interactive chat, use either spelling:
|
|
|
32
34
|
|
|
33
35
|
Keys are saved in `~/.agintiflow/.env` by default as `GRSAI` or `VENICE_API_KEY` with `0600` permissions. Project `.aginti/.env` can override them. The CLI and web app only report whether a key exists; they never return raw values.
|
|
34
36
|
|
|
37
|
+
Provider selection is independent of key discovery. The selected auxiliary provider remains GRS AI or Venice for the whole call. If its key is missing or the request fails, the tool stops visibly; it never switches to the other provider because that provider's ambient key happens to exist. When no provider is selected, the deterministic default is GRS AI.
|
|
38
|
+
|
|
35
39
|
## Runtime Flow
|
|
36
40
|
|
|
37
41
|
For image, cover, poster, illustration, photo, or logo-concept requests, the model can call:
|
|
@@ -118,3 +122,5 @@ Generated images are sent to the canvas automatically when available.
|
|
|
118
122
|
## Guardrails
|
|
119
123
|
|
|
120
124
|
Output paths must stay inside the project workspace. Secret paths, `.git`, `node_modules` writes, and oversized reference images are blocked. Reference images may be workspace files, HTTPS URLs, or data URLs.
|
|
125
|
+
|
|
126
|
+
The mode gate is enforced inside `generate_image` as well as in progressive tool exposure, so a handcrafted model tool call cannot bypass a disabled auxiliary mode.
|
|
@@ -6,7 +6,7 @@ them into AgInTiFlow's built-in `skills/` directory.
|
|
|
6
6
|
|
|
7
7
|
## Scientific Agent Skills
|
|
8
8
|
|
|
9
|
-
When
|
|
9
|
+
When a sibling `../scientific-agent-skills` checkout exists,
|
|
10
10
|
AgInTiFlow automatically discovers it as:
|
|
11
11
|
|
|
12
12
|
- pack: `scientific-agent-skills`
|
|
@@ -13,11 +13,11 @@ Local agent references informed the design:
|
|
|
13
13
|
- Claw-style `doctor` discipline: check health and environment before treating system symptoms as code bugs.
|
|
14
14
|
- Claude/Codex-style context discipline: read project instructions, manifests, entry points, and failing tests before touching broad files.
|
|
15
15
|
|
|
16
|
-
The shared pattern is not “put the whole repo in context.” It is: build a cheap map, choose the next exact evidence, edit with deterministic patches, verify, then compact what changed. AgInTiFlow
|
|
16
|
+
The shared pattern is not “put the whole repo in context.” It is: build a cheap map, choose the next exact evidence, edit with deterministic patches, verify, then compact what changed. AgInTiFlow can use bounded scout calls on the explicitly selected provider to add more independent eyes around that loop, not to replace it.
|
|
17
17
|
|
|
18
18
|
## Skill vs Tool
|
|
19
19
|
|
|
20
|
-
The `large-codebase` profile is a skill: it changes the model’s engineering behavior. It tells
|
|
20
|
+
The `large-codebase` profile is a skill: it changes the model’s engineering behavior. It tells the active main model—LocalLLM Deep by default—to orient first, plan minimally, patch incrementally, and verify.
|
|
21
21
|
|
|
22
22
|
The `inspect_project` function is a tool: it deterministically scans the workspace and returns:
|
|
23
23
|
|
|
@@ -48,7 +48,7 @@ Mature coding agents avoid keeping an entire growing project in the prompt. AgIn
|
|
|
48
48
|
- Project map: `inspect_project` summaries, language counts, source/test directories, and recommended reads.
|
|
49
49
|
- Active evidence: exact search hits, selected files, failing command output, and compact git status/diff.
|
|
50
50
|
- Patch context: only the nearby code needed for `apply_patch`, plus before/after hashes and compact diffs.
|
|
51
|
-
- Scout synthesis:
|
|
51
|
+
- Scout synthesis: bounded parallel scouts use the explicitly selected provider, then a coordinator summary is injected instead of every long transcript becoming permanent context.
|
|
52
52
|
|
|
53
53
|
This keeps the main executor sober: it knows where it is in the repo, but it still re-reads exact files before editing and validates with commands rather than trusting stale memory.
|
|
54
54
|
|
|
@@ -84,7 +84,7 @@ aginti --profile large-codebase "fix the failing tests"
|
|
|
84
84
|
|
|
85
85
|
or choose **Large codebase engineering** in the web task-profile dropdown.
|
|
86
86
|
|
|
87
|
-
Smart routing sends this profile to
|
|
87
|
+
Smart routing sends this profile to LocalLLM Deep even when the user prompt is short. Hosted providers are used only when selected explicitly; their presence in saved or ambient credentials does not activate them or create a fallback.
|
|
88
88
|
|
|
89
89
|
## Auto Profile Behavior
|
|
90
90
|
|
|
@@ -100,11 +100,11 @@ aginti "fix the Rust workspace build"
|
|
|
100
100
|
aginti "repair the Docker setup and run the Node tests"
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
These route to
|
|
103
|
+
These route to LocalLLM Deep when the complexity score is high enough.
|
|
104
104
|
|
|
105
105
|
## Parallel Scout Mode
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Complex tasks can use several short advisory calls before the main executor starts. When explicitly enabled, AgInTiFlow runs bounded scouts in parallel on the selected provider:
|
|
108
108
|
|
|
109
109
|
- Architect: decomposes the task and identifies first files/logs/commands.
|
|
110
110
|
- Implementer: predicts patch boundaries and focused checks.
|
|
@@ -139,7 +139,7 @@ aginti --no-web-search "work fully offline"
|
|
|
139
139
|
|
|
140
140
|
## Cross-Language Playbook
|
|
141
141
|
|
|
142
|
-
AgInTiFlow gives
|
|
142
|
+
AgInTiFlow gives the active executor stack-specific reminders without hardcoding a solution:
|
|
143
143
|
|
|
144
144
|
- JS/TS: inspect package scripts and lockfiles, then run focused `node`, `tsc`, or test commands.
|
|
145
145
|
- Python: inspect `pyproject.toml` or requirements, prefer project-local venv/conda/Docker, then run focused pytest/module checks.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Local-First Agent Runtime
|
|
2
|
+
|
|
3
|
+
Status: active architecture and implementation goal
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
AgInTiFlow must remain a general agent that can plan, select tools, execute guarded work, verify evidence, and finish truthfully. Its dependable baseline is the sibling LocalLLM service. DeepSeek, OpenAI, and other hosted providers remain optional upgrades, never hidden prerequisites or silent fallbacks.
|
|
8
|
+
|
|
9
|
+
The projects stay decoupled:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
AgInTiFlow orchestration
|
|
13
|
+
-> provider/capability contract
|
|
14
|
+
-> LocalLLM /v1 (baseline)
|
|
15
|
+
-> DeepSeek / OpenAI / compatible gateways (explicit upgrades)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
AgInTiFlow owns sessions, plans, permissions, tool dispatch, idempotency, context compaction, recovery, and verification. LocalLLM owns bounded stateless inference. AgInTiFlow must not depend on LocalLLM's web UI, SQLite conversations, or `/api/agent/*` management routes.
|
|
19
|
+
|
|
20
|
+
## Baseline provider contract
|
|
21
|
+
|
|
22
|
+
The canonical provider id is `localllm`. User-facing aliases `local`, `local-llm`, and `local_llm` may normalize to it, but raw engine labels such as `ollama` or `lmstudio` must not silently become LocalLLM. Saved sessions and events use the canonical id.
|
|
23
|
+
|
|
24
|
+
Default connection:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
base URL: http://127.0.0.1:8008/v1
|
|
28
|
+
placeholder key: local-dev-key
|
|
29
|
+
health: http://127.0.0.1:8008/healthz
|
|
30
|
+
models: authenticated GET /v1/models
|
|
31
|
+
route lane: localllm-fast
|
|
32
|
+
main lane: localllm-deep
|
|
33
|
+
maximum lane: localllm-max
|
|
34
|
+
vision: localllm-vision-xl
|
|
35
|
+
embedding: localllm-embed (sibling-service alias; not an AgInTi text-routing tier)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The default bearer value used by the local deployment is an interoperability placeholder, not a security boundary. Configuration must still send it as a normal bearer token and must never log it. Local endpoints remain loopback-only. A non-loopback LocalLLM base URL is rejected instead of quietly exporting prompts.
|
|
39
|
+
|
|
40
|
+
Readiness requires both `health.ok === true` and `health.ollama.ok === true`, followed by an authenticated `/v1/models` check that confirms the requested alias exists. Health alone is not sufficient.
|
|
41
|
+
|
|
42
|
+
The installed local ladder is capability- and resource-aware. `localllm-fast` handles short routing and bounded work; substantive coding and agent tasks use the 30B-A3B Q4 `localllm-deep` lane. The 30B-A3B Q8 `localllm-max` lane remains explicitly selectable, but every new or resumed Max run performs a fresh pre-inference gate after authenticated alias discovery. It requires at least 24 GiB available host RAM, swap use no higher than 75%, and 40 GiB aggregate free NVIDIA memory (Q8 weights plus working reserve). Missing GPU telemetry fails closed. Automatic Max is off by default and requires `AGINTI_LOCALLLM_ALLOW_AUTO_MAX=true`; an eligible run confirms the configured Max alias and fresh headroom before upgrading the actual model client from Deep. If the optional upgrade cannot be proven safe, it continues on Deep rather than failing. The automatic Vision policy requires both a trusted image-input signal and confirmed model capability. The shipped CLI/web currently reach vision through the local `read_image` tool or explicit `localllm-vision-xl` selection; both paths readiness-check the selected alias, and prompt keywords alone never activate Vision XL.
|
|
43
|
+
|
|
44
|
+
## Provider-neutral capabilities
|
|
45
|
+
|
|
46
|
+
Provider identity and model capability are separate. The current public provider contract normalizes `provider`, `label`, `openaiCompatible`, `local`, `requiresApiKey`, `toolProtocol`, `structuredOutput`, `supportsReasoningEffort`, and `textToolFallback`. The reusable target contract will expand that record with model- and runtime-specific fields instead of scattering provider-name checks:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
local
|
|
50
|
+
requiresApiKey
|
|
51
|
+
nativeTools
|
|
52
|
+
textToolFallback
|
|
53
|
+
jsonObject
|
|
54
|
+
strictJsonSchema
|
|
55
|
+
vision
|
|
56
|
+
embeddings
|
|
57
|
+
reasoningEffort
|
|
58
|
+
effectiveContext
|
|
59
|
+
maxOutput
|
|
60
|
+
maxConcurrency
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Current LocalLLM request policy starts conservatively:
|
|
64
|
+
|
|
65
|
+
- native OpenAI-compatible function calls are tried first and locally validated;
|
|
66
|
+
- parallel tool calls are disabled;
|
|
67
|
+
- `json_object` plus strict post-validation is preferred over recursive `oneOf`/`$defs` schemas;
|
|
68
|
+
- a bounded text-tool protocol is a fallback path, not the default;
|
|
69
|
+
- remote images are fetched only when web access is enabled and any configured domain allowlist permits them; the provider receives bounded data URLs rather than the original remote URL;
|
|
70
|
+
- cancellation closes the active HTTP request; it does not imply provider-side rollback;
|
|
71
|
+
- the main agent loop is sequential, but the general runtime does not yet enforce a provider-wide semaphore across sessions; explicitly enabled scouts and specialist batches use their own bounded concurrency.
|
|
72
|
+
|
|
73
|
+
DeepSeek and OpenAI use the same normalized interface. A stronger model may receive a larger context, broader tool set, or higher step budget, but it does not get weaker permissions or a different truthfulness contract.
|
|
74
|
+
|
|
75
|
+
## Local-model execution ladder
|
|
76
|
+
|
|
77
|
+
The runtime should choose the least expensive lane that can satisfy the request:
|
|
78
|
+
|
|
79
|
+
1. **Direct answer** — ordinary conversation or a bounded knowledge question, with no tool schemas.
|
|
80
|
+
2. **Focused agent** — one task-shaped tool bundle, a small step budget, and no separate planning call unless needed.
|
|
81
|
+
3. **Thorough agent** — explicit plan, broader task-shaped tools, evidence checks, and context compaction.
|
|
82
|
+
4. **Supervised/SCS** — high-risk or long work with separate review and truthful blocker handling.
|
|
83
|
+
|
|
84
|
+
This is progressive capability disclosure, not capability removal. A focused coding request initially needs workspace inspection, search/read, patch/write, a guarded command, and finish. It does not need browser, MCP, writing, image, AgentLink, tmux, and research schemas in the same first call. A later turn may add a capability only when task routing or observed evidence justifies it.
|
|
85
|
+
|
|
86
|
+
Suggested compact bundles:
|
|
87
|
+
|
|
88
|
+
| Bundle | Initial tools |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| Workspace/code | `inspect_project`, `list_files`, `search_files`, `read_file`, `apply_patch`, `write_file`, `run_command`, `finish` |
|
|
91
|
+
| Browser | `open_url`, `click`, `type`, `scroll`, `press`, `back`, `wait`, `finish` |
|
|
92
|
+
| Research | `web_search`, `web_research`, `finish` |
|
|
93
|
+
| Long job | `start_long_job`, `long_job_status`, `finish` |
|
|
94
|
+
| Coordination | selected AgentLink or tmux tools plus `finish` |
|
|
95
|
+
|
|
96
|
+
Disabled tools stay impossible to dispatch even if a model names them in text or JSON.
|
|
97
|
+
|
|
98
|
+
## Tool-call recovery
|
|
99
|
+
|
|
100
|
+
Every model-selected action passes the same server-side registry and argument validator. Model output is never executable authority.
|
|
101
|
+
|
|
102
|
+
For one agent step:
|
|
103
|
+
|
|
104
|
+
1. Try a simple native function call.
|
|
105
|
+
2. Reject unknown, disabled, duplicate, malformed, or over-budget calls locally.
|
|
106
|
+
3. If the provider/model is known to need repair, request one plain JSON or text-protocol repair with only the relevant tools.
|
|
107
|
+
4. Revalidate the repair from scratch.
|
|
108
|
+
5. If repair fails, return a deterministic safe blocker or use an explicitly configured stronger lane.
|
|
109
|
+
|
|
110
|
+
Never replay a mutating tool merely because a model request timed out. The persisted tool ledger must prove a call has not already completed before retrying it.
|
|
111
|
+
|
|
112
|
+
Plain assistant content with no tool call is a valid finish only when the execution policy permits a direct answer or the evidence ledger shows the requested work is already complete. Otherwise the runtime asks once for the missing action/evidence, then stops truthfully instead of pretending completion.
|
|
113
|
+
|
|
114
|
+
## Context and output budgets
|
|
115
|
+
|
|
116
|
+
Character-only history accounting is not enough because tool schemas and UTF-8 density also consume context. The request budget includes:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
system instructions
|
|
120
|
+
+ selected tool schemas
|
|
121
|
+
+ conversation and compacted evidence
|
|
122
|
+
+ current task/snapshot
|
|
123
|
+
+ output reserve
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Conservative LocalLLM defaults:
|
|
127
|
+
|
|
128
|
+
- configured request envelope: 32K total context, including messages, selected tool schemas, and output allowance;
|
|
129
|
+
- planning response: at most 2K output inside that same configured request envelope;
|
|
130
|
+
- normal agent step: an 8K output allowance and 4K tool-schema reserve leave a 20K compaction input ceiling under the default 32K envelope;
|
|
131
|
+
- final answer: at most 8K output unless the task explicitly requires more;
|
|
132
|
+
- compaction target: preserve goal, permissions, plan, unresolved blockers, file/tool evidence, and recent turns;
|
|
133
|
+
- concurrency is controlled by each execution path: the main loop is sequential, while explicitly enabled batch/helper paths may issue bounded parallel requests.
|
|
134
|
+
|
|
135
|
+
If a model returns empty visible content and no valid tool call, retry once with a compacted prompt and adequate output headroom. Repeated emptiness becomes a visible model limitation, not an infinite loop.
|
|
136
|
+
|
|
137
|
+
## Durable session runtime
|
|
138
|
+
|
|
139
|
+
Each session stores a versioned, revisioned runtime snapshot containing only safe provider, model-role, tool-policy, sandbox, context-budget, wrapper, auxiliary, and network-scope choices. It never stores API keys, bearer values, base URLs, environment maps, clients, callbacks, or abort signals.
|
|
140
|
+
|
|
141
|
+
On resume, the saved snapshot is authoritative. Current shell variables and current web preferences cannot silently replace its provider or role models. Credentials are freshly resolved for the saved provider after the snapshot is loaded. An explicit runtime change must carry the current revision; stale changes and continuations fail with a conflict before readiness checks or model-client creation. Web preferences seed new sessions only. The same contract applies to CLI, interactive, and web continuations.
|
|
142
|
+
|
|
143
|
+
Legacy sessions without a snapshot are migrated conservatively: route, main, and spare roles all inherit their saved top-level provider/model so migration cannot introduce a hosted lane. The web execution gate serializes same-process continuations; independent processes should not concurrently mutate one session.
|
|
144
|
+
|
|
145
|
+
## Hosted upgrades and privacy
|
|
146
|
+
|
|
147
|
+
Cloud escalation is opt-in and visible. A local failure must not silently send the workspace, prompt, images, tool results, or compacted history to DeepSeek/OpenAI.
|
|
148
|
+
|
|
149
|
+
An escalation policy records:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
allowed providers
|
|
153
|
+
reason for escalation
|
|
154
|
+
maximum context exported
|
|
155
|
+
whether artifacts/images may leave the host
|
|
156
|
+
whether the user approved this run or configured a durable policy
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Provider failure before any tool executes may retry or switch according to that policy. After a tool executes, failover reuses the persisted result and never repeats the action without an idempotency proof.
|
|
160
|
+
|
|
161
|
+
## Evaluation gates
|
|
162
|
+
|
|
163
|
+
Offline deterministic tests run on every change:
|
|
164
|
+
|
|
165
|
+
- LocalLLM defaults, aliases, loopback enforcement, and no-key onboarding;
|
|
166
|
+
- smart route/main selection for `localllm-fast` and `localllm-deep`;
|
|
167
|
+
- compact tool bundle size and disabled-tool rejection;
|
|
168
|
+
- valid native tool call and complete tool-result round trip;
|
|
169
|
+
- malformed arguments, unknown tool, duplicate call id, and one bounded repair;
|
|
170
|
+
- no-tool direct answer versus incomplete-work retry/blocker;
|
|
171
|
+
- timeout before output, cancellation, and no post-cancel dispatch;
|
|
172
|
+
- context calculation includes tool schemas and output reserve;
|
|
173
|
+
- no silent hosted fallback;
|
|
174
|
+
- session resume preserves provider, model, capability profile, and executed-tool ledger.
|
|
175
|
+
|
|
176
|
+
Live compatibility tests are opt-in because they load local models:
|
|
177
|
+
|
|
178
|
+
| Lane | Minimum cases |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| `localllm-pocket` / 4B (direct sibling-service compatibility alias, not an automatic AgInTi tier) | direct answer, one-tool selection, malformed-output recovery, truthful blocker |
|
|
181
|
+
| `localllm-fast` / 8B | focused code inspection/edit/test loop, cancellation, resumed turn |
|
|
182
|
+
| `localllm-deep` / 30B-A3B Q4 | multi-step plan, repair after failed tool evidence, long-context compaction |
|
|
183
|
+
| `localllm-max` / 30B-A3B Q8 | explicit opt-in, resource preflight, highest-fidelity local code task |
|
|
184
|
+
| `localllm-vision-xl` / 30B-A3B Q4 | attached-image understanding with no keyword-only activation |
|
|
185
|
+
| DeepSeek/OpenAI | same fixtures, plus explicit escalation and stronger-model quality comparison |
|
|
186
|
+
|
|
187
|
+
Record pass/fail, latency, prompt size, tool accuracy, repair count, repeated-call count, completion truthfulness, and peak context. Quality promotion requires deterministic safety gates first; a fluent answer is not evidence that work completed.
|
|
188
|
+
|
|
189
|
+
## Delivery sequence
|
|
190
|
+
|
|
191
|
+
1. Add the provider contract and make LocalLLM the credential-free local-first default.
|
|
192
|
+
2. Remove DeepSeek-only assumptions from routing, auth, specialists, CLI, web settings, and saved preferences.
|
|
193
|
+
3. Add provider-aware request budgets and progressive tool disclosure.
|
|
194
|
+
4. Add bounded native-tool repair and incomplete-work detection.
|
|
195
|
+
5. Add offline conformance fixtures, then opt-in live LocalLLM evaluations.
|
|
196
|
+
6. Add explicit cloud escalation policy and comparative quality routing.
|
|
197
|
+
7. Expose the provider-neutral agent runtime as a reusable library/API so LocalLLM may later mount AgInTi capabilities without importing AgInTiFlow UI or storage internals.
|
|
198
|
+
|
|
199
|
+
The final integration direction is dependency inversion: LocalLLM can call a packaged AgInTi runtime adapter later, and AgInTiFlow can call any conforming inference provider today. Neither repository becomes the other's internal implementation detail.
|
package/docs/model-selection.md
CHANGED
|
@@ -6,15 +6,26 @@ AgInTiFlow treats model choice as a role-based control plane. A provider supplie
|
|
|
6
6
|
|
|
7
7
|
| Role | CLI command | Default | Purpose |
|
|
8
8
|
| --- | --- | --- | --- |
|
|
9
|
-
| Route | `/route` | `
|
|
10
|
-
| Main | `/model` or `/main` | `
|
|
11
|
-
| Spare | `/spare` | `
|
|
9
|
+
| Route | `/route` | `localllm/localllm-fast` | Local fast planner, triage, short tasks, and routing decisions. |
|
|
10
|
+
| Main | `/model` or `/main` | `localllm/localllm-deep` | Local complex executor for coding, debugging, writing, and long tasks. |
|
|
11
|
+
| Spare | `/spare` | `localllm/localllm-deep` with `medium` reasoning | Local cross-check lane; hosted spares require explicit selection. |
|
|
12
12
|
| Wrapper | `/wrapper` | `codex gpt-5.5 medium` | External coding assistant when wrapper tools are enabled. |
|
|
13
|
-
| Auxiliary | `/auxiliary` | `grsai/nano-banana-2` |
|
|
13
|
+
| Auxiliary | `/auxiliary` | `grsai/nano-banana-2` (tool off) | Explicitly enabled image/media tools; Venice image models are optional. |
|
|
14
14
|
|
|
15
|
-
Smart routing
|
|
15
|
+
Smart routing sends normal work to the LocalLLM route model and complex work to the LocalLLM main model. Manual hosted provider/model selection remains available for explicit one-off upgrades. A local error fails closed instead of changing providers.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The local tier policy uses the workstation's installed aliases without treating model presence as permission to load a heavy model:
|
|
18
|
+
|
|
19
|
+
| Alias | Installed role | Automatic policy |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| `localllm-fast` | Qwen3 8B Q4 routing and bounded work | Default for simple work. |
|
|
22
|
+
| `localllm-deep` | Qwen3 30B-A3B Q4 substantive coding/agent work | Default for complex work. |
|
|
23
|
+
| `localllm-max` | Qwen3 30B-A3B Q8 highest-fidelity local text/code | Explicit selection; automatic use additionally requires opt-in, authenticated availability, fresh resource readiness, and no shared-workstation pressure. |
|
|
24
|
+
| `localllm-vision-xl` | Qwen3-VL 30B-A3B Q4 image understanding | The automatic policy requires a trusted image-input signal plus confirmed capability. The shipped CLI/web currently use readiness-checked `read_image` or explicit selection; prompt keywords alone do not activate it. |
|
|
25
|
+
|
|
26
|
+
Installed aliases are not loaded during routing. Automatic Max is off by default; set `AGINTI_LOCALLLM_ALLOW_AUTO_MAX=true` to opt in. An opted-in high-complexity run starts on Deep, confirms the Max alias through authenticated `/v1/models`, and only then samples current resources. Unknown or pressured resource state stays on Deep. Explicit Max also cannot bypass the live gate: immediately before client creation, each new or resumed run rechecks at least 24 GiB available RAM, swap use at or below 75%, and 40 GiB aggregate free NVIDIA memory. A blocked explicit gate creates no model client and performs no inference.
|
|
27
|
+
|
|
28
|
+
Long writing tasks use an additional tool boundary: `writing_specialist`. The main model still plans the run, manages files, formats Markdown/LaTeX/Final Draft output, compiles/checks artifacts, and finishes. The specialist gets only the writing brief, canon, style guide, prior draft, target, audience, constraints, and format intent, then returns prose plus a formatter handoff. It follows the active LocalLLM provider by default even when hosted keys exist. Cross-provider writing requires both an explicit target (`AGINTI_WRITING_PROVIDER` or a per-run provider override) and `AGINTI_ALLOW_HOSTED_WRITING_SPECIALIST=true` (or the equivalent per-run permission flag); language detection and ambient credentials never grant that permission.
|
|
18
29
|
|
|
19
30
|
## CLI Commands
|
|
20
31
|
|
|
@@ -23,8 +34,8 @@ aginti models
|
|
|
23
34
|
aginti --list-models
|
|
24
35
|
aginti --list-routes
|
|
25
36
|
|
|
26
|
-
# one-shot overrides
|
|
27
|
-
aginti --route-model
|
|
37
|
+
# local-first defaults and one-shot overrides
|
|
38
|
+
aginti --route-model localllm-fast --main-model localllm-deep "fix this project"
|
|
28
39
|
aginti --provider openrouter --model openrouter/auto --routing manual "try a gateway route"
|
|
29
40
|
aginti --provider openrouter --model anthropic/claude-sonnet-4.6 --routing manual "draft a design review"
|
|
30
41
|
aginti --provider venice --model venice-uncensored-1-2 --routing manual "draft a note"
|
|
@@ -43,6 +54,8 @@ Interactive commands:
|
|
|
43
54
|
/route
|
|
44
55
|
/model
|
|
45
56
|
/spare
|
|
57
|
+
/route localllm/localllm-fast
|
|
58
|
+
/model localllm/localllm-deep
|
|
46
59
|
/route deepseek/deepseek-v4-flash
|
|
47
60
|
/model deepseek/deepseek-v4-pro
|
|
48
61
|
/spare openai/gpt-5.4 medium
|
|
@@ -62,6 +75,7 @@ Provider families:
|
|
|
62
75
|
|
|
63
76
|
| Family | Models |
|
|
64
77
|
| --- | --- |
|
|
78
|
+
| LocalLLM | `localllm-fast`, `localllm-deep`, `localllm-max`, `localllm-vision-xl`; Max and Vision retain the gates above |
|
|
65
79
|
| DeepSeek | `deepseek-v4-flash`, `deepseek-v4-pro` |
|
|
66
80
|
| Venice | `venice-uncensored-1-2`, `venice-uncensored`, `gemma-4-uncensored` |
|
|
67
81
|
| OpenAI | `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.3-codex`, `gpt-5.3-codex-spark`, `gpt-5.2`; each has low/medium/high/xhigh reasoning |
|
|
@@ -90,11 +104,11 @@ Disable Venice
|
|
|
90
104
|
|
|
91
105
|
For scripts or non-interactive terminals, `/venice` uses Venice 1.2 for both roles. You can also set both roles directly with `/venice 1.2`, `/venice 1.1`, or `/venice gemma`. Use two values to set route and main separately, for example `/venice 1.2 gemma`.
|
|
92
106
|
|
|
93
|
-
Use `/venice off` to switch back to the
|
|
107
|
+
Use `/venice off` to switch back to the LocalLLM defaults:
|
|
94
108
|
|
|
95
109
|
```text
|
|
96
|
-
/route
|
|
97
|
-
/model
|
|
110
|
+
/route localllm/localllm-fast
|
|
111
|
+
/model localllm/localllm-deep
|
|
98
112
|
```
|
|
99
113
|
|
|
100
114
|
It keeps smart routing enabled. If the Venice key is missing, run `/auth venice`.
|
|
@@ -103,7 +117,8 @@ It keeps smart routing enabled. If the Venice key is missing, run `/auth venice`
|
|
|
103
117
|
|
|
104
118
|
| Bucket | Provider | Typical use |
|
|
105
119
|
| --- | --- | --- |
|
|
106
|
-
| `
|
|
120
|
+
| `localllm` | LocalLLM | Default private route/main through the sibling loopback gateway. |
|
|
121
|
+
| `deepseek` | DeepSeek | Explicit hosted route for economical stronger-model work. |
|
|
107
122
|
| `openai` | OpenAI | Spare/frontier checks, Codex-family work, and explicit manual routes. |
|
|
108
123
|
| `openrouter` | OpenRouter | OpenAI-compatible gateway with auto/free/code routers. |
|
|
109
124
|
| `openrouter-openai` | OpenRouter | OpenAI-family models through OpenRouter. |
|
|
@@ -133,6 +148,8 @@ It keeps smart routing enabled. If the Venice key is missing, run `/auth venice`
|
|
|
133
148
|
|
|
134
149
|
## Keys
|
|
135
150
|
|
|
151
|
+
The LocalLLM baseline uses `http://127.0.0.1:8008/v1` and the installation's loopback key (`local-dev-key` in the documented local setup). `AGINTI_LOCALLLM_MODEL` or `LOCALLLM_MODEL` is the shared local text override; role-specific `AGINTI_LOCALLLM_ROUTE_MODEL` and `AGINTI_LOCALLLM_MAIN_MODEL` take precedence. Optional `AGINTI_LOCALLLM_MAX_MODEL` and `AGINTI_LOCALLLM_VISION_MODEL` name the gated heavyweight aliases. LocalLLM overrides must remain loopback URLs. Generic `LLM_*` values do not redefine the local provider.
|
|
152
|
+
|
|
136
153
|
Keys are saved account-wide in `~/.agintiflow/.env` by default. Use `--project` only when the current project needs an override in ignored `.aginti/.env`:
|
|
137
154
|
|
|
138
155
|
```bash
|
package/docs/patch-tools.md
CHANGED
|
@@ -14,4 +14,4 @@ All paths must stay inside the configured workspace. Secret-like paths, `.git`,
|
|
|
14
14
|
|
|
15
15
|
For large codebases, the model should first use `list_files`, `search_files`, and `read_file` to identify the relevant files. It should then call `apply_patch`, run safe tests or linters when available, and summarize changed files and residual risk.
|
|
16
16
|
|
|
17
|
-
Smart routing treats patch/refactor/edit/database tasks as complex work, so
|
|
17
|
+
Smart routing treats patch/refactor/edit/database tasks as complex work, so the LocalLLM `localllm-deep` main lane is selected by default unless the user explicitly chooses another route.
|
|
@@ -13,13 +13,15 @@ AgInTiFlow separates visual understanding, web search, and wrapper advice so eac
|
|
|
13
13
|
|
|
14
14
|
## Defaults
|
|
15
15
|
|
|
16
|
-
- `read_image`
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- `web_research` defaults to lightweight snippet mode
|
|
21
|
-
- `web_research mode=openai`
|
|
16
|
+
- In a LocalLLM session, `read_image provider=auto` sends bounded image data to the loopback LocalLLM Chat Completions endpoint with `AGINTI_LOCALLLM_VISION_MODEL` or `localllm-vision-xl`. It does not try OpenAI or a wrapper after a local failure.
|
|
17
|
+
- In an OpenAI session, `read_image provider=auto` uses OpenAI Responses vision. A non-OpenAI session must set `allowHostedImagePerception=true` before `provider=openai` is accepted. `OPENAI_API_KEY` by itself grants no permission.
|
|
18
|
+
- Codex image reading requires both `provider=codex` and explicitly enabled wrapper tools. It is not an automatic fallback.
|
|
19
|
+
- OpenAI image reading defaults to `AGINTI_PERCEPTION_MODEL=gpt-5.4-mini` and `AGINTI_PERCEPTION_REASONING=medium`, with fallback models remaining inside the same explicitly selected OpenAI provider.
|
|
20
|
+
- `web_research` defaults to lightweight snippet mode. The active LocalLLM can synthesize those returned snippets and sources during the next agent step without a second provider call.
|
|
21
|
+
- `web_research mode=openai` is accepted only for an active OpenAI session or when `allowHostedWebResearch=true`. A denied or failed hosted synthesis is returned with `ok=false`; any preserved snippets are labeled fallback evidence rather than hosted success.
|
|
22
|
+
- `json_specialist` stays on the active provider. A different provider requires `allowHostedJsonSpecialist=true`; ambient hosted keys and model-generated provider arguments cannot escalate a LocalLLM session.
|
|
22
23
|
- `research_wrapper` defaults to `AGINTI_RESEARCH_WRAPPER_MODEL=gpt-5.4-mini` and `AGINTI_RESEARCH_WRAPPER_REASONING=medium`.
|
|
24
|
+
- Wrapper tools and auxiliary image generation are opt-in. Installed CLIs or saved provider keys do not enable them by themselves.
|
|
23
25
|
- Wrapper advice is not evidence by itself. Verify file paths, sources, hashes, and artifacts before claiming completion.
|
|
24
26
|
|
|
25
27
|
## Interactive Commands
|
|
@@ -47,5 +49,6 @@ Use `research_wrapper` when a second model should cross-check image/web/research
|
|
|
47
49
|
- Remote images require web access and respect domain allowlists.
|
|
48
50
|
- Images are capped at 10 MB and four inputs per call.
|
|
49
51
|
- Artifacts preserve hashes and metadata but never store API keys.
|
|
52
|
+
- Provider selection is credential-neutral: an ambient key authenticates only a backend that the run already selected and permitted.
|
|
50
53
|
|
|
51
54
|
See the design note in [references/multimodal-research-wrapper-design.md](../references/multimodal-research-wrapper-design.md).
|