Metadata-Version: 2.4
Name: crowelm-deepcore
Version: 0.1.0
Summary: CroweLM Deepcore - a focused CLI for the CroweLM Deepcore model, served via Crowe Logic.
Author-email: Michael Crowe <michael@crowelogic.com>
License: Apache-2.0
Project-URL: Homepage, https://crowelogic.com
Keywords: crowelm,deepcore,cli,llm,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
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: ruff>=0.6.0; extra == "dev"

# CroweLM Deepcore

A focused command-line interface for the CroweLM Deepcore model, served via Crowe Logic.

## Install

    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
    DEEPCORE_API_VERSION=2024-08-01-preview

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

## Use

    deepcore                 # interactive agent chat
    deepcore run "question"  # one-shot, pipe-friendly (answer on stdout)
    deepcore tools           # list the agent's tools
    deepcore info            # model + backend status
    deepcore doctor          # diagnose config + reachability
    deepcore run --no-tools "..."   # plain chat, no tools
    deepcore run --yes "..."        # auto-approve tool actions

## Fusion (stacking models for stronger output)

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

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

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

## Agent and tools

`deepcore` 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`.

`web_search` needs `DEEPCORE_SEARCH_API_KEY`; `analyze_image` needs
`DEEPCORE_VISION_DEPLOYMENT` (a multimodal model). Both degrade gracefully
when unconfigured.

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 |
|---|---|---|
| `DEEPCORE_BACKEND` | `azure` or `foundry` | `azure` |
| `AZURE_CORE_ENDPOINT` / `AZURE_CORE_API_KEY` | Azure transport | (required for azure) |
| `DEEPCORE_API_VERSION` | Azure API version | `2024-08-01-preview` |
| `FOUNDRY_BASE_URL` / `FOUNDRY_API_KEY` | control-plane transport | (required for foundry) |
| `DEEPCORE_TEMPERATURE` | default sampling temperature | `0.4` |
| `DEEPCORE_MAX_TOKENS` | response cap | `2048` |
| `DEEPCORE_THINK` | surface reasoning stream | `0` (answer-only) |
| `DEEPCORE_TOOLS` | enable agent tools | `1` (on) |
| `DEEPCORE_AUTO_APPROVE` | auto-approve mutating tools | `0` (off) |
| `DEEPCORE_MAX_STEPS` | max agent tool-call rounds | `12` |
| `DEEPCORE_SHELL_TIMEOUT` | run_shell timeout (s) | `120` |
| `DEEPCORE_SANDBOX` | `auto` / `docker` / `subprocess` for run_code | `auto` |
| `DEEPCORE_PLAIN` | force plain (non-rich) output | `0` |
| `DEEPCORE_FUSION` | default fusion: `off` / `reason` / `escalate` | `off` |
| `DEEPCORE_REASONER_DEPLOYMENT` | reasoner model for fusion | `DeepSeek-R1-0528` |
| `DEEPCORE_PARALLEL_MODELS` | comma-separated chains for `--deep` | (three defaults) |
| `DEEPCORE_JUDGE_DEPLOYMENT` | judge/synthesizer model | the primary deployment |
| `DEEPCORE_SEARCH_API_KEY` | enables web_search (Brave Search API) | (unset) |
| `DEEPCORE_SEARCH_URL` | search API endpoint | Brave web search |
| `DEEPCORE_VISION_DEPLOYMENT` | multimodal model for analyze_image | (unset) |

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