confide:setup
One-shot installer + optimal-default config writer for the CONFIDE local de-identification
toolkit. After running this, confide:anon (redact a transcript) and confide:red (residual
re-identification risk check) work with no further configuration.
Local-first: all detection and redaction run on the user's machine. Readiness checks and
config writing never read, print, or transmit any transcript text or PII — only booleans and
the config path.
When to use
Trigger phrasings: "set up confide", "install confide", "configure confide de-id",
"confide setup", "get confide ready to anonymize".
How to run
The entrypoint is scripts/setup.py. It imports the shared core (shared/confide_core.py)
for the canonical DEFAULTS — do not redefine preferences here.
Check readiness (default, no install):
python3 skills/setup/scripts/setup.py --check
Prints a ✓/✗ table: Python deps importable (natasha, scrubadub, phonenumbers, pymorphy2),
Ollama reachable (GET ollama_host/api/tags), the anon_model pulled, llama.cpp on PATH
(optional), and whether the config exists. Booleans only — no PII.
Install everything (best-effort, tolerates failures):
python3 skills/setup/scripts/setup.py --install # core deps + ollama pull
python3 skills/setup/scripts/setup.py --install --with-presidio # + optional EN baseline
- pip-installs:
natasha scrubadub phonenumbers pymorphy2 pymorphy2-dicts-ru "setuptools<81"
(setuptools<81 supplies pkg_resources for pymorphy2). Optional presidio-analyzer behind
--with-presidio.
- If
ollama is on PATH, runs ollama pull qwen2.5:3b.
- Each step reports ✓/✗; a failed step never aborts the others.
Write the optimal-default config (idempotent):
python3 skills/setup/scripts/setup.py --write-config # writes only if absent
python3 skills/setup/scripts/setup.py --reconfigure # overwrites with defaults
python3 skills/setup/scripts/setup.py --show # print current config
On first run with no config present, the script writes the defaults automatically.
--write-config will not clobber an existing (user-customized) config; use
--reconfigure to force-reset.
Config lives at ~/.config/confide/config.json.
Chosen optimal preferences (from SPEC.md)
Written from confide_core.DEFAULTS:
| Key |
Value |
Why |
engine |
ollama |
zero-config, Metal-accelerated, handles long docs (llama.cpp 400s on long RU) |
anon_model |
qwen2.5:3b |
fast local LLM layer for quasi-PII |
red_attacker_model |
qwen2.5:3b |
local default; it is a floor — a stronger attacker is the true ceiling |
languages |
["ru", "en"] |
bilingual corpus |
layers |
["regex", "natasha", "llm"] |
deterministic → RU NER → quasi-PII |
redaction_style |
typed_placeholder |
[PERSON], [DATE], … (reversible map kept locally, never shipped) |
privacy.local_only |
true |
raw text never leaves the machine |
privacy.cloud_apis |
false |
cloud disabled by default |
privacy.cloud_only_on_synthetic |
true |
cloud attacker only opt-in on synthetic/consented data |
ollama_host |
http://localhost:11434 |
local Ollama |
Notes
- llama.cpp is optional (reproducible engine) — detected and recorded if present, never required.
- The bigger attacker model for
confide:red is optional; the local 3b default under-reports risk.
- Importable functions for programmatic / tested use:
readiness(), ensure_config(reconfigure=False),
install(with_presidio=False), show_config().
1---
2name: setup
3description: Set up, install, and configure CONFIDE local de-identification — installs Python deps (natasha, scrubadub, phonenumbers, pymorphy2), ensures Ollama + pulls the default qwen2.5:3b model, detects optional llama.cpp, and writes the optimal-default config so confide:anon and confide:red work with zero further config. Everything is local-first; raw text never leaves the machine. Use when the user says "set up confide", "install confide", "configure confide de-id", "confide setup", or "get confide ready".
4metadata:
5 source: https://skillmd.com/skills/glebis/setup
6---
7
8# confide:setup
9
10One-shot installer + optimal-default config writer for the CONFIDE local de-identification
11toolkit. After running this, `confide:anon` (redact a transcript) and `confide:red` (residual
12re-identification risk check) work with no further configuration.
13
14**Local-first:** all detection and redaction run on the user's machine. Readiness checks and
15config writing never read, print, or transmit any transcript text or PII — only booleans and
16the config path.
17
18## When to use
19Trigger phrasings: "set up confide", "install confide", "configure confide de-id",
20"confide setup", "get confide ready to anonymize".
21
22## How to run
23
24The entrypoint is `scripts/setup.py`. It imports the shared core (`shared/confide_core.py`)
25for the canonical `DEFAULTS` — do not redefine preferences here.
26
271. **Check readiness (default, no install):**
28 ```bash
29 python3 skills/setup/scripts/setup.py --check
30 ```
31 Prints a ✓/✗ table: Python deps importable (natasha, scrubadub, phonenumbers, pymorphy2),
32 Ollama reachable (`GET ollama_host/api/tags`), the `anon_model` pulled, llama.cpp on PATH
33 (optional), and whether the config exists. Booleans only — no PII.
34
352. **Install everything (best-effort, tolerates failures):**
36 ```bash
37 python3 skills/setup/scripts/setup.py --install # core deps + ollama pull
38 python3 skills/setup/scripts/setup.py --install --with-presidio # + optional EN baseline
39 ```
40 - pip-installs: `natasha scrubadub phonenumbers pymorphy2 pymorphy2-dicts-ru "setuptools<81"`
41 (`setuptools<81` supplies `pkg_resources` for pymorphy2). Optional `presidio-analyzer` behind
42 `--with-presidio`.
43 - If `ollama` is on PATH, runs `ollama pull qwen2.5:3b`.
44 - Each step reports ✓/✗; a failed step never aborts the others.
45
463. **Write the optimal-default config (idempotent):**
47 ```bash
48 python3 skills/setup/scripts/setup.py --write-config # writes only if absent
49 python3 skills/setup/scripts/setup.py --reconfigure # overwrites with defaults
50 python3 skills/setup/scripts/setup.py --show # print current config
51 ```
52 On first run with no config present, the script writes the defaults automatically.
53 `--write-config` will **not** clobber an existing (user-customized) config; use
54 `--reconfigure` to force-reset.
55
56Config lives at `~/.config/confide/config.json`.
57
58## Chosen optimal preferences (from SPEC.md)
59
60Written from `confide_core.DEFAULTS`:
61
62| Key | Value | Why |
63|---|---|---|
64| `engine` | `ollama` | zero-config, Metal-accelerated, handles long docs (llama.cpp 400s on long RU) |
65| `anon_model` | `qwen2.5:3b` | fast local LLM layer for quasi-PII |
66| `red_attacker_model` | `qwen2.5:3b` | local default; it is a **floor** — a stronger attacker is the true ceiling |
67| `languages` | `["ru", "en"]` | bilingual corpus |
68| `layers` | `["regex", "natasha", "llm"]` | deterministic → RU NER → quasi-PII |
69| `redaction_style` | `typed_placeholder` | `[PERSON]`, `[DATE]`, … (reversible map kept locally, never shipped) |
70| `privacy.local_only` | `true` | raw text never leaves the machine |
71| `privacy.cloud_apis` | `false` | cloud disabled by default |
72| `privacy.cloud_only_on_synthetic` | `true` | cloud attacker only opt-in on synthetic/consented data |
73| `ollama_host` | `http://localhost:11434` | local Ollama |
74
75## Notes
76- llama.cpp is **optional** (reproducible engine) — detected and recorded if present, never required.
77- The bigger attacker model for `confide:red` is optional; the local 3b default under-reports risk.
78- Importable functions for programmatic / tested use: `readiness()`, `ensure_config(reconfigure=False)`,
79 `install(with_presidio=False)`, `show_config()`.