Metadata-Version: 2.4
Name: decido-ai
Version: 1.4.1
Summary: Ask questions about a document and get a probability for every answer. Open Decido models that run on your laptop; also browser-agent models.
Author: The Decido Authors
License: Apache-2.0
Project-URL: Homepage, https://getdecido.ai
Project-URL: Models, https://huggingface.co/decido-ai
Project-URL: Playground, https://getdecido.ai/playground
Project-URL: API docs, https://getdecido.ai/api
Keywords: decision,classification,calibration,llm,gguf,llama.cpp,cpu,huggingface,jev,nli,routing,triage
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: tokenizers>=0.20
Requires-Dist: huggingface_hub>=0.25
Requires-Dist: certifi
Requires-Dist: cmake>=3.18; (platform_system == "Darwin" and platform_machine != "arm64") or (platform_system == "Linux" and platform_machine != "x86_64" and platform_machine != "aarch64")
Provides-Extra: gpu
Requires-Dist: torch>=2.4; extra == "gpu"
Requires-Dist: transformers>=5.17; extra == "gpu"
Requires-Dist: accelerate; extra == "gpu"
Provides-Extra: vllm
Requires-Dist: vllm==0.31.0; extra == "vllm"
Requires-Dist: transformers>=5.17; extra == "vllm"
Requires-Dist: accelerate; extra == "vllm"
Requires-Dist: pillow>=10; extra == "vllm"
Provides-Extra: vision
Requires-Dist: pillow>=10; extra == "vision"
Provides-Extra: xl
Requires-Dist: torch>=2.6; extra == "xl"
Requires-Dist: transformers>=5.22; extra == "xl"
Requires-Dist: accelerate; extra == "xl"
Requires-Dist: peft>=0.21; extra == "xl"
Requires-Dist: triton>=3.2; extra == "xl"
Requires-Dist: safetensors; extra == "xl"
Provides-Extra: pro
Requires-Dist: vllm==0.31.0; extra == "pro"
Requires-Dist: transformers>=5.17; extra == "pro"
Requires-Dist: accelerate; extra == "pro"
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.3; python_version >= "3.10" and extra == "mcp"
Provides-Extra: server
Requires-Dist: zstandard>=0.22; extra == "server"
Provides-Extra: agent
Requires-Dist: anthropic>=2.12; extra == "agent"
Requires-Dist: httpx[http2]<1,>=0.28; extra == "agent"
Requires-Dist: browser-harness==0.1.13; python_version >= "3.11" and extra == "agent"

# decido

**Ask questions about a document or an image and get a probability for every answer.** Open models that run on your own
machine.

Give Decido some text (a support ticket, an email, a web page, a JSON record) and a few questions. It answers each one with
probabilities, for example *refund: yes 0.985 / no 0.015*. The [Decido models](https://huggingface.co/decido-ai) run
locally, so your data stays on your machine and you need no API key.

## Install
```bash
pip install decido-ai
```
Mac (Apple Silicon), Linux and Windows, Python 3.9+. Nothing to compile. GPU, image, MCP and browser-agent features need
Python 3.10+ (browser agent: 3.11+).

## Quick start
```python
from decido import Decido

m = Decido("decido-ai/decido-1-fast-1.7b")      # downloads the model once (about 2 GB)

print(m.decide(
    "Customer: I was charged twice for order 4821. Please refund one of the charges today.",
    {
        "refund":  "Is the customer asking for a refund?",
        "team":    {"q": "Which team should handle this?", "options": ["billing", "shipping", "tech"]},
        "urgency": {"q": "How urgent is it?", "scale": ["low", "normal", "urgent"]},
    },
))
# {'refund': {'yes': 0.985, 'no': 0.015},
#  'team': {'billing': 0.936, 'shipping': 0.038, 'tech': 0.026},
#  'urgency': {'low': 0.246, 'normal': 0.434, 'urgent': 0.32}}
```

Three kinds of question:

| you write | you get |
|---|---|
| `"Is it a refund request?"` | yes / no |
| `{"q": "Which team?", "options": ["billing", "shipping"]}` | one of the options |
| `{"q": "How urgent?", "scale": ["low", "normal", "urgent"]}` | a point on an ordered scale |

Options can have descriptions: `"options": {"billing": "charges and refunds", "shipping": "delivery"}`.
Text inside the document is treated as data: Decido does not follow instructions written in it.
Documents can be up to about 16,000 tokens (set `DECIDO_N_CTX` for more).

## Which model?

| you want | model | runs on |
|---|---|---|
| text, **start here** | [decido-1-fast-1.7b](https://huggingface.co/decido-ai/decido-1-fast-1.7b) | any laptop (8 GB RAM) |
| text, best accuracy for everyday use | [decido-1-26b-a4b](https://huggingface.co/decido-ai/decido-1-26b-a4b) | laptop with 32 GB+ RAM, or an NVIDIA GPU with 64 GB+ |
| images (photos, documents, screenshots, video frames) | [decido-vision-1-fast](https://huggingface.co/decido-ai/decido-vision-1-fast) | Linux + NVIDIA GPU (16 GB+) |
| a browser agent | [decido-web-v2](https://huggingface.co/decido-ai/decido-web-v2) | Linux + NVIDIA GPU (80 GB) |
| to try it without downloading | `hosted:decido-1-fast` | anywhere (free key) |

**All text models.** Accuracy = average over 6 public decision benchmarks (TypeSafe's Jev 1.13, a commercial decision API,
scores 83.9 on the same benchmarks). Speed: Apple M4 Pro, 1-page document, 5 questions, Mac GPU (the default on Macs).

| model | accuracy | speed | runs on |
|---|---:|---:|---|
| [decido-1-ultra-0.6b](https://huggingface.co/decido-ai/decido-1-ultra-0.6b) | 62.2 | 0.13 s | any laptop (4 GB RAM) |
| [decido-1-fast-1.7b](https://huggingface.co/decido-ai/decido-1-fast-1.7b) | 73.0 | 0.30 s | any laptop (8 GB RAM) |
| [decido-1-26b-a4b](https://huggingface.co/decido-ai/decido-1-26b-a4b) | 85.4 | 1.1 s | 32 GB+ RAM, or NVIDIA GPU 64 GB+ |
| [decido-1-think-26b-a4b](https://huggingface.co/decido-ai/decido-1-think-26b-a4b) | 88.7 | ~10 s per question | 32 GB+ RAM, or NVIDIA GPU |
| [decido-1-max-26b-a4b](https://huggingface.co/decido-ai/decido-1-max-26b-a4b) | 89.2 | ~11 s per question | 32 GB+ RAM |
| [decido-1-xl](https://huggingface.co/decido-ai/decido-1-xl) | 87.3 | GPU only | 4× A100 80 GB (research) |

CPU-only speeds: Ultra 0.41 s, Fast 0.64 s, Decido-1 4.1 s. Think and Max reason before answering, hence the time per
question. Run `decido models` to see every model in your terminal; test details are on each model card.

## Command line
```bash
decido run decido-ai/decido-1-fast-1.7b "Customer: charged twice, refund please" \
    -q refund="Is this a refund request?" -q team="Which team?|billing,shipping,tech"

decido pull decido-ai/decido-1-fast-1.7b      # download now, then it works offline
decido doctor                                 # check that this machine is set up
```

## Run it as a server
```bash
pip install "decido-ai[server]"
decido serve decido-ai/decido-1-fast-1.7b --port 8080
```
This starts an HTTP API at `http://127.0.0.1:8080/v1/systemone`. It uses the same request format as Jev, so Jev clients work
once you point them at this URL (in Python, `m.predict(request)` takes the same format). By default it only accepts
connections from your own machine. To share it: set `DECIDO_SERVER_KEY=<a secret>`, start it with `--host 0.0.0.0`, and
have clients send `Authorization: Bearer <secret>`.

## Hosted API (try it without downloading)
```py
from decido import Decido

m = Decido("hosted:decido-1-fast")      # get a free key at https://getdecido.ai/playground, then: export DECIDO_API_KEY=dk_...
print(m.decide("Customer: I was charged twice for order 4821. Please refund one of the charges today.",
               {"refund": "Is the customer asking for a refund?"}))
```
The free key is for trying Decido: Decido-1-Fast only, short documents, a small daily limit (current limits:
[getdecido.ai/api](https://getdecido.ai/api)). For real use, run the model yourself.

## Use it from Claude Desktop or Cursor (MCP)
```bash
pip install "decido-ai[mcp]"                  # Python 3.10+
decido pull decido-ai/decido-1-fast-1.7b
which decido                                  # Windows: where decido. Copy this path into the config below
```
Add this to Claude Desktop (Settings → Developer → Edit Config) or Cursor (`~/.cursor/mcp.json`):
```json
{"mcpServers": {"decido": {"command": "/path/to/decido", "args": ["mcp", "--model", "decido-ai/decido-1-fast-1.7b"]}}}
```
The assistant gets one tool, `decide(document, questions)`.

## Images
Ask the same kinds of questions about photos, scanned documents, receipts, charts, screenshots or video frames.
Needs Linux, an NVIDIA GPU and Python 3.10+.

| model | Decido Vision Bench: test (group mean) · new items (% right) | runs on |
|---|---:|---|
| [decido-vision-v2](https://huggingface.co/decido-ai/decido-vision-v2) | 85.2 · 90.4 | 2 NVIDIA GPUs with 80 GB (`export DECIDO_TP=2`) |
| [decido-vision-1-fast](https://huggingface.co/decido-ai/decido-vision-1-fast) | 81.8 · 89.5 | 1 NVIDIA GPU with 16 GB+ |

Jev 1.14 scores 84.4 · 86.7 on the same tests. Overall the models are about equal to Jev: better on documents, counting and
image quality, worse on perception puzzles and fall detection (details on the model cards).

```python3
# pip install "decido-ai[vllm]"
from decido import Decido

m = Decido("decido-ai/decido-vision-1-fast")
print(m.decide({"claim": "the tire is flat", "photo": "IMG_1"},
               {"flat": "Is the tire in IMG_1 flat?"},
               assets={"IMG_1": "car.jpg"}))       # a file path, bytes or a PIL image
```
- Give each image a name and mention it in the document or the question (here `IMG_1`); up to 16 images per request.
- Video: send a few frames as separate named images.
- Requests without images go to the text model Decido-1. It is downloaded on the first such request (27 GB) and runs on a
  GPU with enough free memory, else on the CPU. To choose: `Decido("decido-ai/decido-vision-1-fast",
  text_model="decido-ai/decido-1-fast-1.7b", text_device="cuda:1")` (server: `--text-model`, `--text-device`).

## Browser agents
Models that drive a web browser: at each step they choose what to click or type. They need an NVIDIA GPU.

| model | real websites (tasks finished) | Mind2Web (steps right) | time per step |
|---|---:|---:|---:|
| [decido-web-v2](https://huggingface.co/decido-ai/decido-web-v2) | **79.5%** | **78%** | 0.5 s |
| [decido-web-v2-fast](https://huggingface.co/decido-ai/decido-web-v2-fast) | 67.5% | 75% | 0.2 s |
| decido-web-v2 + Claude (`decido agent`) | **89%** | – | – |

On the same tests Jev 1.14 scores 70% and 60%, and Claude Opus 5.5 alone finishes 89% of the real-website tasks.
Older model: [decido-1-web-26b-a4b](https://huggingface.co/decido-ai/decido-1-web-26b-a4b) (v1).

**Run the browser agent** (decido-web-v2 decides each step; Claude takes the hard ones):
```bash
# 1. On the GPU machine (NVIDIA, 80 GB of GPU memory)
pip install "decido-ai[agent,vllm]"
export ANTHROPIC_API_KEY=sk-ant-...
export DECIDO_SERVER_KEY=<a secret>            # only needed if Chrome runs on another machine
decido agent serve --engine vllm --host 0.0.0.0

# 2. On the machine with Chrome (Python 3.11+; can be the same machine: then skip --host and the secret)
pip install "decido-ai[agent]"
export DECIDO_SERVER_KEY=<the same secret>
decido agent run "Find the cheapest 1 m USB-C cable and open its page" --start https://www.example-shop.com \
    --endpoint http://<gpu-machine>:8090
```
Chrome opens and the agent does the task (`--headless` hides the window). Claude handles most steps in this setup, so expect
Claude costs similar to using Claude alone; what you gain is more tasks finished (61% vs 37% for Claude alone on our hardest
test, where the v2 + Claude setup also had a larger step and time budget).

**Without Claude:** start the server with `decido agent serve --no-claude --engine vllm`. The agent then needs a small text
model for what it types: run any OpenAI-compatible server (e.g. Qwen3-4B-Instruct-2507 on vLLM) and add
`--text-url http://<host>:<port>/v1 --text-model <model name>` to `decido agent run`. Details on the
[decido-web-v2 model card](https://huggingface.co/decido-ai/decido-web-v2).

## GPU and other platforms
- **Mac (Apple Silicon):** uses the Mac GPU automatically.
- **NVIDIA GPU:** `pip install "decido-ai[gpu]"` (Python 3.10+), then `Decido(model, device="cuda")`. Faster with vLLM:
  `pip install "decido-ai[vllm]"` and `Decido(model, engine="vllm")` (Linux).
- **Intel Mac and less common Linux CPUs:** the first run compiles the runtime once (a few minutes; needs a C++ compiler).
- **Windows on ARM:** use WSL2.

## Settings
| environment variable | what it does |
|---|---|
| `HF_HOME` | where models are downloaded |
| `DECIDO_THREADS` | number of CPU threads |
| `DECIDO_N_CTX` | longest document + question, in tokens (default 16,384) |
| `DECIDO_TP` | number of GPUs to split a model over (vLLM; e.g. 2 for decido-vision-v2) |
| `DECIDO_TEXT_MODEL`, `DECIDO_TEXT_DEVICE` | vision models: which text model answers requests without images, and where it runs (`auto`, `cpu`, `cuda:1`) |
| `DECIDO_SERVER_KEY` | secret required by `decido serve` / `decido agent serve`, and sent by `decido agent run` |
| `DECIDO_API_KEY` | your key for the hosted API. Note: `decido serve` also uses it as its secret if `DECIDO_SERVER_KEY` is not set (until 2.0); unset it when you serve locally without a key |
| `DECIDO_BASE_URL` | point `hosted:` models at your own `decido serve` |
| `ANTHROPIC_API_KEY` | Claude key for `decido agent serve` (or `ANTHROPIC_VERTEX_PROJECT_ID` for Claude on Vertex AI) |

## License
Apache-2.0. Includes llama.cpp (MIT) and an agent loop based on Browser Use's jev-ultrafast (MIT). Each model's license is on
its model card.
