OpenDecision
OpenDecision answers typed questions about text, JSON, documents, and images. It runs locally and returns structured values.
Measured on CPU with short inputs and the default models. Longer inputs and simultaneous requests can use more memory. Memory details.
Text context is 512 tokens for Choice, Score, and Relation, or 8,192 tokens for yes/no (Noul), including the question text sent to the model. Tokens are pieces of words. Images are resized to 224 × 224 pixels, with 64 tokens per caption. The document API splits longer documents into passages. Input limits.
Text decisions
Route a customer request
I was charged twice and I need this fixed before my meeting this afternoon.
| Question | Answer |
|---|---|
| Which department should handle this? | billing |
| Is this request urgent? | Yes |
API call: 231 ms for both questions.
Read an insurance claim
The sample claim includes policy facts, medical records, bills, and employer records.
| Question | Answer |
|---|---|
| Are the medical expenses documented? | established |
| Is a serious injury documented? | refuted |
| Are documents still outstanding? | established |
These insurance answers come from the saved claim benchmark.
More text and document examples · Document API
Image decisions
Ask questions about a photo and combine the answers into an action.



Times are medians of five local HTTP calls on an Apple M3 with the models loaded. Each payload received one warmup call. The timer includes sending the request and reading the response. Measurement details.
These are recorded results from SigLIP2. The actions are simulated. The rules use a yes/no threshold of 0.5 and require a winning Choice probability of at least 0.6.
See more images, questions, and answers · Image API and setup
Install
With pip:
With uv:
Continue to the get started guide
What it provides
| Type | Use | Result |
|---|---|---|
Choice |
Select one option. | Option name and probabilities |
Noul |
Test one statement. | A score from 0 to 1 |
Score |
Use an ordered scale. | Weighted score and probabilities |
Relation |
Compare evidence with a statement and its opposite. | supports, contradicts, unknown, or conflicted |
| Document decisions | Ask questions about text or JSON. | Answers and source passages |
| Image decisions | Ask questions about a photo. | Answers and rule decisions |
See code examples for each primitive
Start here
- Get started: install the package, run a Python example, and start the API.
- Primitives: use
Choice,Noul,Score, andRelation. - Image examples: photos, questions, returned answers, and combined rules.
- Image decisions: install image support and send API requests.
- Document decisions: ask questions about long text or JSON and select a yes/no mode.
- Evidence and rules: rank evidence and combine facts with rules.
- Examples: run the Doom demo and review the insurance and GDPR examples.
Interfaces
| Interface | Use |
|---|---|
| Python | Call OpenDecision in the same process as the application. |
POST /v1/systemone |
Send state and typed questions to the API. |
POST /v1/documents/decide |
Send a document and typed questions to the API. |
| TypeSafe-compatible endpoint | Use a compatible TypeSafe SDK client with a local server. |
Basic example
from opendecision import OpenDecisionEngine
engine = OpenDecisionEngine()
result = engine.choice(
state="The customer was charged twice.",
instructions="Which team should handle this request?",
criteria={
"billing": "Payments, invoices, refunds, and duplicate charges",
"technical": "Software bugs",
"sales": "Pricing and purchases",
},
)
print(result["choice"])
# billing
Doom demo
OpenDecision chooses actions for a bot in ViZDoom's Deadly Corridor. This is the Skill 5 recording.