Skip to main content

Determine

Determine makes AI inference feel like a normal part of Python.

The main API has only two operations:

determine.answer(...)
determine.choose(...)

Install

pip install determine

Ollama

Run an installed Ollama model directly:

import determine

determine.configure("ollama:qwen3")

name = "Jack"

print(
    determine.answer(
        "Say hello to the user."
    )
)

If you leave the model out:

determine.configure("ollama")

Determine will try to use the first installed Ollama model.

llama.cpp

Use a local GGUF directly:

import determine

determine.configure(
    "llama.cpp:/home/me/models/model.gguf"
)

print(
    determine.answer(
        "What should I do?"
    )
)

Determine automatically looks for either:

llama-cli

or:

llama cli

OpenAI-compatible APIs

Determine still supports OpenAI-compatible endpoints:

import determine

determine.configure(
    "http://localhost:8080"
)

answer()

Use answer when the result can be anything:

answer = determine.answer(
    "What should the player be told?"
)

choose()

Use choose when the result must come from available options:

action = determine.choose(
    "What should the enemy do?",
    [
        "attack",
        "run",
        "hide"
    ]
)

Automatic context

Determine can automatically see relevant variables and source code.

For example:

health = 12
ammo = 0
enemy_distance = 3

action = determine.choose(
    "What should the player do?",
    [
        "fight",
        "run",
        "hide"
    ]
)

Those variables do not have to be manually placed into the prompt.

Advanced llama.cpp configuration

Extra llama.cpp arguments can be supplied:

determine.configure(
    "llama.cpp:/home/me/model.gguf",
    temperature=0.2,
    reasoning_effort="high",
    args=[
        "-ngl", "all",
        "-c", "32768"
    ]
)

A custom executable can also be used:

determine.configure(
    "llama.cpp:/home/me/model.gguf",
    binary="/home/me/llama.cpp/build/bin/llama-cli"
)

Functions as choices

Functions can be choices too:

def backup():
    """Back up the phone."""
    print("Backing up")

def update(version="latest"):
    """Update the phone."""
    print("Updating to", version)

request = input("> ")

determine.choose(
    request,
    [
        backup,
        update
    ]
)

Security

Determine can make fuzzy decisions, but important security boundaries and destructive actions should still have deterministic validation and confirmation around them.

License

MIT

Multi-turn conversations

Determine can remember previous turns by giving it a normal Python list.

import determine

determine.configure("ollama:qwen3")

history = []

print(
    determine.answer(
        "My favourite colour is green.",
        history=history
    )
)

print(
    determine.answer(
        "What is my favourite colour?",
        history=history
    )
)

The same history can be shared with choose():

history = []

determine.answer(
    "I prefer quiet places.",
    history=history
)

place = determine.choose(
    "Where should I go?",
    [
        "busy shopping centre",
        "quiet park",
        "concert"
    ],
    history=history
)

print(place)

Without history=, Determine remains single-turn.

You can start a fresh conversation simply by creating a new list:

history = []

Metadata

Release files for determine 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for determine 0.4.2
File Size Uploaded
determine-0.4.2.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for determine 0.4.2
File Interpreter ABI Platform
determine-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / determine-0.4.2.tar.gz

Download URL determine-0.4.2.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0b5cdbc77bf46c344bf2ef938633bec7d2c87e4fd3fbcbfd59c9af782987c9c6
BLAKE2b-256 checksum
How to use checksums
32f7308bd991393e5ff7c7de31256217110c55878d6cc03e0531cfa6abed01ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / determine-0.4.2-py3-none-any.whl

Download URL determine-0.4.2-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c432f17ee39cc03047dea5db033ba0e086eeb5bf521720ca0f8b611f79788dba
BLAKE2b-256 checksum
How to use checksums
f339879ecfa91de259657d15100d0f186aed94f2c9f7b4e0ff11eba5167733c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.3

2 release files

This release

0.4.2 This release

2 release files

0.4.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page