Shows live params, Exact/session defaults, last patch, and a brief why-priority note without calling the LLM. Co-authored-by: Cursor <cursoragent@cursor.com>
113 lines
5.1 KiB
Markdown
113 lines
5.1 KiB
Markdown
# Swarm Assistent
|
|
|
|
SwarmUI extension for **collaborative Krea 2** prompting via **Ollama**: chat + board (Generate | Refs tabs), LoRA chips, **persona presets** (`Config/personas/`), **vector memory**, model cards with Civitai fetch, img2img/inpaint, slash commands, auto Generate.
|
|
|
|
**Version 0.7.3** — Exact KV; silent apply+Generate when user asks; composer **Собрать + Gen**; block model-card previews; critique needs vision + JSON.
|
|
|
|
## Layout
|
|
|
|
- **Left — Board tabs:** **Generate** (full-height live view) | **Refs** (reference grid + badge `N · vision M`)
|
|
- **Splitter:** drag to resize panes
|
|
- **Right:** Chat | Cards; persona / pack / Ollama chat model; settings gear (memory model + skills)
|
|
- **Chips / slash:** loaded from `Config/_base/ui.json` (persona can override)
|
|
|
|
## Config (bundled + overlay)
|
|
|
|
```
|
|
Config/
|
|
_base/ # defaults (assistant, ui, models/krea2, exact.json, core, packs, skills, memory-seed, identity)
|
|
personas/<id>/ # sparse preset: persona/voice/likes/dislikes/rules + optional exact.json / overrides
|
|
```
|
|
|
|
Disk overlay (wins over bundled): `/mnt/swarm_data/Assistent/` — same layout, plus `settings.json`, `taste.json`, `personas.json` (legacy prompt overlay), `ollama-roles.json`, `memory/assistent.sqlite`.
|
|
|
|
Copy `personas/cinema/` → `noir/`, edit only differing JSON files.
|
|
|
|
## Exact memory (KV)
|
|
|
|
- `Config/_base/exact.json` — canonical generation defaults, profiles (turbo/raw), aspect table, short facts
|
|
- Persona / disk overlays merge via DeepMerge (matching keys overwrite)
|
|
- Always injected into the system prompt; UI fills **empty** SwarmUI fields from Exact (no LLM call)
|
|
- Chat-session overrides (`session_exact`) last until persona change or clear chat — not written to disk
|
|
- Priority: core contract → current user → session_exact → exact (+ persona) → live fields → vector `memory_hits`
|
|
|
|
## Vector memory
|
|
|
|
- SQLite + Ollama `/api/embed` (default `nomic-embed-text`, pick in ⚙)
|
|
- First chat seeds `Config/_base/memory-seed/` (pointers + pitfalls; numbers live in Exact)
|
|
- Agents upsert via patch `memory_upsert` / `memory_forget`
|
|
- Cards ingest on save; retrieve → `memory_hits` in live context (inventory slimmed)
|
|
- Soft notes only — Exact and the user beat RAG for params
|
|
|
|
## UX
|
|
|
|
- **Send to Assistent** under Generate/History → Ref + Assistent tab
|
|
- Enter sends; Shift+Enter newline; Interrupt cancels chat epoch
|
|
- Manual **Apply + Generate** / `/gen` always generate; Auto-generate checkbox only for LLM auto-path
|
|
- Civitai Confirm required (unless auto-download)
|
|
|
|
### Slash commands (client-side, no LLM)
|
|
|
|
| Command | Effect |
|
|
| --- | --- |
|
|
| `/help` | List commands |
|
|
| `/debug` | Short dump: prompt, params, Exact/session, why |
|
|
| `/gen` | Generate now |
|
|
| `/look generate\|refN` | Attach that board window + ask the LLM to look |
|
|
| `/init` `/mask` `/clear` | Same as board buttons |
|
|
| `/interrupt` | Stop generation / cancel chat |
|
|
| `/aspect 16:9` | Set size from the official 1K table |
|
|
| `/seed lock\|random` | Lock or randomize seed |
|
|
| `/vary` | New seed, same prompt (+ generate if auto) |
|
|
| `/pack write\|critique\|…` | Switch pack |
|
|
| `/civitai <query>` | Ask LLM to search Civitai |
|
|
| `/inventory` | Rescan models + refresh LoRA list |
|
|
|
|
## Requirements
|
|
|
|
- SwarmUI with a **Krea 2** checkpoint selected
|
|
- Ollama on `http://127.0.0.1:11434` **on the GPU VM** (gpu-rent `LLM_RUNTIME=ollama`)
|
|
- Chat model + memory embed (`use: memory` in `ollama-models.yaml`; gpu-rent creates CPU variant)
|
|
- Optional: Civitai API key in SwarmUI User Settings
|
|
|
|
## Install
|
|
|
|
```yaml
|
|
swarmui:
|
|
- url: https://gitea.hsrv.site/mrleo1nid/swarm-assistent.git
|
|
ref: main
|
|
dir: swarm-assistent
|
|
requires: ollama
|
|
```
|
|
|
|
Restart / rebuild SwarmUI after clone. gpu-rent: `seed-extensions` + restart.
|
|
|
|
## Packs & skills
|
|
|
|
**Packs** (one active): `write_prompt`, `critique_image`, `compose_scene`, `fix_params`, `inpaint_edit`, `describe_ref`, `catalog_card`.
|
|
|
|
**Skills** (checkboxes): `prompting`, `creativity_sliders`, `memory` — procedures; encyclopedia numbers live in Exact, soft notes in memory-seed / RAG.
|
|
|
|
**Personas:** `neutral`, `lewd`, `aggressive`, `cinema`, `terse` under `Config/personas/`.
|
|
|
|
## API routes
|
|
|
|
| Route | Role |
|
|
| --- | --- |
|
|
| `AssistentListModels` | Ollama tags → `models` (chat) + `memory_models` |
|
|
| `AssistentGetConfig` | Merged preset for persona (ui, packs, skills, identity) |
|
|
| `AssistentGetSettings` / `AssistentSaveSettings` | Overlay settings (skills, embed_model) |
|
|
| `AssistentListInventory` | LoRA / checkpoint / wildcard inventory |
|
|
| `AssistentListPersonas` | Persona catalog |
|
|
| `AssistentGetPacks` | Prompt pack texts |
|
|
| `AssistentGetCard` / `AssistentSaveCard` | `.assistent.json` cards (+ memory ingest) |
|
|
| `AssistentGetCardMeta` | Local sidecar + optional Civitai by-hash |
|
|
| `AssistentEnqueueWanted` | Wanted YAML queue |
|
|
| `AssistentGetTaste` / `AssistentSaveTaste` | Persistent taste profile |
|
|
| `AssistentSearchCivitai` | Civitai LoRA search |
|
|
| `AssistentChat` / `AssistentChatWS` | Chat (+ memory retrieve + Civitai hop) |
|
|
|
|
## License
|
|
|
|
MIT
|