Skip to main content
Pre-release

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

Development

uv sync
just check

See Contributing for the repository layout and focused development commands.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pollux_ai-2.0.0rc4.tar.gz (809.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pollux_ai-2.0.0rc4-py3-none-any.whl (126.8 kB view details)

Uploaded Python 3

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

Hashes for pollux_ai-2.0.0rc4.tar.gz
Algorithm Hash digest
SHA256 83a3360e0d5829e121615bd940feb598ffe4772a3f93cdebbc4adec6c95a8098
MD5 80d68402bd76eac62cee89543c60a678
BLAKE2b-256 74c40af7e48f1dff16ab49ce907ff5759d90bd9adb378849aebddf99e8f95861

See more details on using hashes here.

Provenance

The following attestation bundles were made for pollux_ai-2.0.0rc4.tar.gz:

Publisher: release.yml on seanbrar/pollux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pollux_ai-2.0.0rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 1e394976d266991c38065db3bebb2a6cb02aa6b455f4c20f95ff9378efdd010c
MD5 3522067e2148613ec9103493368d031e
BLAKE2b-256 484013fbc7ded862c17a7f76258ee1d97162abe9aa6c6a38095fdf9e9041e04e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pollux_ai-2.0.0rc4-py3-none-any.whl:

Publisher: release.yml on seanbrar/pollux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.0

2 files

This release

2.0.0rc4 This release

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 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