Metadata-Version: 2.4
Name: deepparallel
Version: 0.4.2
Summary: DeepParallel - a multi-model agentic coding CLI with cross-model Guardian review, served via Crowe Logic.
Author-email: Michael Crowe <michael@crowelogic.com>
License: Apache-2.0
Project-URL: Homepage, https://crowelogic.com
Keywords: deepparallel,agent,coding-agent,cli,llm,code-review,crowe-logic
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.0
Requires-Dist: rich>=14.0.0
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: tree-sitter>=0.25.0
Requires-Dist: tree-sitter-language-pack>=1.8.0
Requires-Dist: cryptography>=42.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: ruff>=0.6.0; extra == "dev"
Provides-Extra: research
Requires-Dist: numpy>=1.24; extra == "research"

# DeepParallel

A multi-model agentic coding CLI with cross-model Guardian review. Many models
check the work; you ship with a second opinion. Served via Crowe Logic.

## Install

    uv tool install deepparallel        # recommended
    # or
    pipx install deepparallel --python python3.13

Then run `deepparallel` (or the short alias `dp`).

Note: on systems with a broken Homebrew Python 3.14, bare `pipx install` may
fail to find a usable interpreter - use `uv tool install` or pin `--python`.

### From source

    uv venv
    uv pip install -p .venv -e .

## Configure

Set the backend env vars (a `.env` file in the working directory is loaded automatically):

    # default backend: azure
    AZURE_CORE_ENDPOINT=https://<resource>.openai.azure.com
    AZURE_CORE_API_KEY=<key>
    # optional overrides
    DEEPPARALLEL_API_VERSION=2024-08-01-preview

    # or route through the Crowe Logic Foundry control plane:
    DEEPPARALLEL_BACKEND=foundry
    FOUNDRY_BASE_URL=https://<control-plane>
    FOUNDRY_API_KEY=<token>

## Use

    deepparallel                 # interactive agent chat
    deepparallel run "question"  # one-shot, pipe-friendly (answer on stdout)
    deepparallel tools           # list the agent's tools
    deepparallel info            # model + backend status
    deepparallel doctor          # diagnose config + reachability
    deepparallel run --no-tools "..."   # plain chat, no tools
    deepparallel run --yes "..."        # auto-approve tool actions
    deepparallel review <file|--diff>   # cross-model review as a CI gate (Pro)
    deepparallel audit <file>           # supply-chain gate: catch hallucinated deps (Pro)
    deepparallel research conduit       # latent-relay research demo (needs [research] extra)

## Supply-chain gate

LLMs invent package names that don't exist — and attackers register those names
("slopsquatting"). `deepparallel audit <file>` extracts the dependencies a file
introduces (imports, requirements.txt, package.json) and checks each against the
real registry (PyPI / npm), flagging any the registry has never seen. Exit 0
clean, 2 if a likely-hallucinated package is found — so it gates a commit or PR.
The Guardian also runs this automatically on every edit: a hallucinated import
forces a confirmation even under `--yes`.

## Fusion (stacking models for stronger output)

`deepparallel` can stack the answerer with a separate reasoning model. All modes
compose hosted backends (no GPU/weight-merging), so they are API-call stacking.

    deepparallel run --fuse reason "hard question"     # reasoner thinks, answerer answers
    deepparallel run --fuse escalate "question"        # answer first; escalate to reasoner only if unsure
    deepparallel run --deep "question"                 # heavy: many models in parallel + a judge (slow)
    deepparallel run --dual "A,B" "question"           # compare two deployments side by side
    deepparallel run --dual "A,B" --synth "question"   # ...and synthesize a merged answer

`--fuse` also works in interactive chat. Set a default with `DEEPPARALLEL_FUSION=reason`.

## Fusion-native UX (what single-model agents cannot do)

- **Guardian review** - before an edit (`write_file` / `edit_file` / `ast_replace_symbol`)
  is applied, a second model reviews the diff and its verdict
  (`safe` / `risky: ...` / `bug: ...`) is shown in the confirm card. Advisory:
  you still approve. Toggle with `DEEPPARALLEL_GUARDIAN`; pick the reviewer with
  `DEEPPARALLEL_GUARDIAN_DEPLOYMENT`.
- **Consensus + divergence** - `run --deep` prints a `consensus:` chip from
  cross-model agreement (agreement, not correctness), and on low agreement
  lists the dissenting candidates.
- **Live dial** - in interactive chat, `/fast`, `/fuse`, `/escalate` switch the
  fusion mode mid-session (shown in the prompt); `/deep` runs the next prompt as
  a multi-model query.

## Agent and tools

`deepparallel` is an agent: it can call tools to inspect and change your project.

- Read-only (run automatically): `read_file`, `list_dir`, `glob`, `grep`,
  `ast_symbols`, `ast_show_symbol`, `web_fetch`, `web_search`, `analyze_image`.
- Mutating / executing (require confirmation): `write_file`, `edit_file`,
  `ast_replace_symbol`, `run_shell`, `run_code`, `open_path` (open a file, folder,
  or URL in the OS default app - e.g. an HTML report in the browser).

In interactive chat, type `/auto` to toggle auto-approve (tools run without
asking; edits outside the project and unknown dependencies still confirm), or
start with `deepparallel --yes`.

`web_search` needs `DEEPPARALLEL_SEARCH_API_KEY`; `analyze_image` works out of the
box on a multimodal deployment (override with `DEEPPARALLEL_VISION_DEPLOYMENT`).

In interactive chat, mutating actions prompt for y/n. In `run` (non-interactive)
they are denied unless you pass `--yes`. `ast_*` tools are multi-language via
tree-sitter; `run_code` executes in a Docker sandbox when available, else a
timeboxed local subprocess.

## Configuration reference

| Variable | Purpose | Default |
|---|---|---|
| `DEEPPARALLEL_BACKEND` | `azure` or `foundry` | `azure` |
| `AZURE_CORE_ENDPOINT` / `AZURE_CORE_API_KEY` | Azure transport | (required for azure) |
| `DEEPPARALLEL_API_VERSION` | Azure API version | `2024-08-01-preview` |
| `FOUNDRY_BASE_URL` / `FOUNDRY_API_KEY` | control-plane transport | (required for foundry) |
| `DEEPPARALLEL_TEMPERATURE` | default sampling temperature | `0.4` |
| `DEEPPARALLEL_MAX_TOKENS` | response cap (large enough to write whole files) | `8192` |
| `DEEPPARALLEL_THINK` | surface reasoning stream | `0` (answer-only) |
| `DEEPPARALLEL_TOOLS` | enable agent tools | `1` (on) |
| `DEEPPARALLEL_AUTO_APPROVE` | auto-approve mutating tools | `0` (off) |
| `DEEPPARALLEL_MAX_STEPS` | max agent tool-call rounds | `12` |
| `DEEPPARALLEL_SHELL_TIMEOUT` | run_shell timeout (s) | `120` |
| `DEEPPARALLEL_SANDBOX` | `auto` / `docker` / `subprocess` for run_code | `auto` |
| `DEEPPARALLEL_PLAIN` | force plain (non-rich) output | `0` |
| `DEEPPARALLEL_FUSION` | default fusion: `off` / `reason` / `escalate` | `off` |
| `DEEPPARALLEL_REASONER_DEPLOYMENT` | reasoner model for fusion | `DeepSeek-R1-0528` |
| `DEEPPARALLEL_PARALLEL_MODELS` | comma-separated chains for `--deep` | (three defaults) |
| `DEEPPARALLEL_JUDGE_DEPLOYMENT` | judge/synthesizer model | the primary deployment |
| `DEEPPARALLEL_SEARCH_API_KEY` | enables web_search (Brave Search API) | (unset) |
| `DEEPPARALLEL_SEARCH_URL` | search API endpoint | Brave web search |
| `DEEPPARALLEL_VISION_DEPLOYMENT` | multimodal model for analyze_image | `Llama-4-Scout` |
| `DEEPPARALLEL_GUARDIAN` | second-model review of edits before apply | `1` (on) |
| `DEEPPARALLEL_GUARDIAN_DEPLOYMENT` | the reviewer model | the reasoner |

DeepParallel is served via Crowe Logic infrastructure. https://crowelogic.com
