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.0

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.0
File Size Uploaded
determine-0.4.0.tar.gz 11.2 kB Details

Built distribution (wheel)

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

Total release size: 23.8 kB

Release files / determine-0.4.0.tar.gz

Download URL determine-0.4.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
310522685faaaf49ab2bc1e46db13d128b668bb5302ede9f7cba6ace4fb899c5
BLAKE2b-256 checksum
How to use checksums
a5717cfa0b5337b2b79294201bbcafc15e4b819d44aefd17be2100c390f75e10
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.0-py3-none-any.whl

Download URL determine-0.4.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd16b2f6fbccc4ed7cca76676f0bb99355822514d95ba2adf0921b363e71b33d
BLAKE2b-256 checksum
How to use checksums
e549c2e4f71a5991c8ffb0ed73b0b2ca9cea4f09dbdf3650daf2fc84bab6e434
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

0.4.2

2 release files

This release

0.4.0 This release

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