This release is a pre-release and may not be stable for production use.
Pollux
Pollux sends prompts and multimodal sources to several LLM providers through one small Python interface. It handles uploads, shared context, retries, provider differences, and normalized results.
Install
Pollux 2.0 is currently a release candidate:
pip install --pre --upgrade pollux-ai
Set the key for the provider you want to use:
export GEMINI_API_KEY="your-key-here" # or
export OPENAI_API_KEY="your-key-here" # or
export ANTHROPIC_API_KEY="your-key-here" # or
export OPENROUTER_API_KEY="your-key-here"
The local provider does not need a key. Point it at an OpenAI-compatible server
with base_url or POLLUX_LOCAL_BASE_URL.
Ask About a File
import asyncio
from pollux import Config, Source, run
result = asyncio.run(
run(
"What are the key findings?",
source=Source.from_file("paper.pdf"),
config=Config(provider="gemini", model="gemini-2.5-flash-lite"),
)
)
print(result.text)
run() returns an Output. Alongside text, it can contain structured data,
tool calls, reasoning, token usage, completion details, and continuation state.
Changing providers is a configuration change:
Config(provider="openai", model="gpt-5-nano")
Config(provider="anthropic", model="claude-haiku-4-5")
Config(provider="openrouter", model="google/gemma-3-27b-it:free")
Config(provider="local", model="gemma3:4b", base_url="http://localhost:11434/v1")
Ask Several Questions About Shared Context
import asyncio
from pollux import Config, Source, run_many
results = asyncio.run(
run_many(
[
"Summarize the methodology.",
"List the key findings.",
"Identify the main limitation.",
],
sources=[Source.from_file("paper.pdf")],
config=Config(provider="gemini", model="gemini-2.5-flash-lite"),
)
)
for answer in results.answers:
print(answer)
Every prompt sees the same source set. Pollux reuses uploaded content and runs
the prompts concurrently. To process separate files independently, write the
outer loop in your application and call run() or run_many() for each file.
Choose the Smallest Entry Point
| Need | Use |
|---|---|
| One answer now | run() |
| Several prompts over shared sources | run_many() |
| Conversation history or tool calls | interact() or Session |
| Incremental output | stream() |
| Provider-side asynchronous work | defer() |
The advanced entry points use the same Environment, Input, Output, and
OutputCollection types as the simple path.
Documentation
- Getting started
- Sending content
- Structured output
- Conversations, tools, and streaming
- Deferred work
- Provider capabilities
- API reference
- Migrating from 1.x
Development
uv sync
just check
See Contributing for the repository layout and focused development commands.
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pollux_ai-2.0.0rc4.tar.gz.
File metadata
- Download URL: pollux_ai-2.0.0rc4.tar.gz
- Upload date:
- Size: 809.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a3360e0d5829e121615bd940feb598ffe4772a3f93cdebbc4adec6c95a8098
|
|
| MD5 |
80d68402bd76eac62cee89543c60a678
|
|
| BLAKE2b-256 |
74c40af7e48f1dff16ab49ce907ff5759d90bd9adb378849aebddf99e8f95861
|
Provenance
The following attestation bundles were made for pollux_ai-2.0.0rc4.tar.gz:
Publisher:
release.yml on seanbrar/pollux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pollux_ai-2.0.0rc4.tar.gz -
Subject digest:
83a3360e0d5829e121615bd940feb598ffe4772a3f93cdebbc4adec6c95a8098 - Sigstore transparency entry: 2655178076
- Sigstore integration time:
-
Permalink:
seanbrar/pollux@6dc4a0805b455b2f295368b4312b977b185bff6d -
Branch / Tag:
refs/tags/v2.0.0-rc.4 - Owner: https://github.com/seanbrar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6dc4a0805b455b2f295368b4312b977b185bff6d -
Trigger Event:
push
-
Statement type:
File details
Details for the file pollux_ai-2.0.0rc4-py3-none-any.whl.
File metadata
- Download URL: pollux_ai-2.0.0rc4-py3-none-any.whl
- Upload date:
- Size: 126.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e394976d266991c38065db3bebb2a6cb02aa6b455f4c20f95ff9378efdd010c
|
|
| MD5 |
3522067e2148613ec9103493368d031e
|
|
| BLAKE2b-256 |
484013fbc7ded862c17a7f76258ee1d97162abe9aa6c6a38095fdf9e9041e04e
|
Provenance
The following attestation bundles were made for pollux_ai-2.0.0rc4-py3-none-any.whl:
Publisher:
release.yml on seanbrar/pollux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pollux_ai-2.0.0rc4-py3-none-any.whl -
Subject digest:
1e394976d266991c38065db3bebb2a6cb02aa6b455f4c20f95ff9378efdd010c - Sigstore transparency entry: 2655178086
- Sigstore integration time:
-
Permalink:
seanbrar/pollux@6dc4a0805b455b2f295368b4312b977b185bff6d -
Branch / Tag:
refs/tags/v2.0.0-rc.4 - Owner: https://github.com/seanbrar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6dc4a0805b455b2f295368b4312b977b185bff6d -
Trigger Event:
push
-
Statement type: