Skip to main content

Multimodal orchestration for LLM analysis

Project description

Pollux

Multimodal orchestration for LLM APIs.

You describe what to analyze. Pollux handles source patterns, context caching, and multimodal content, so you don't.

Documentation · Getting Started

PyPI CI codecov Testing: MTMT Python License

Quick Start

import asyncio
from pollux import Config, Source, run

result = asyncio.run(
    run(
        "What are the key findings and their implications?",
        source=Source.from_file("earnings-report.pdf"),
        config=Config(provider="gemini", model="gemini-2.5-flash-lite"),
    )
)
print(result["answers"][0])
# Revenue grew 18% YoY to $4.2B, driven by cloud services. Operating
# margins improved from 29% to 34%. Management's $2B buyback and raised
# guidance signal confidence in sustained growth.

run() returns a ResultEnvelope: answers holds one entry per prompt.

To use OpenAI instead: Config(provider="openai", model="gpt-5-nano"). For Anthropic: Config(provider="anthropic", model="claude-haiku-4-5"). For OpenRouter: Config(provider="openrouter", model="google/gemma-3-27b-it:free").

For a full walkthrough (install, key setup, first result), see Getting Started.

What Problems Does Pollux Solve?

Say you have a document and ten questions about it. Each API call re-uploads the file, and you're left managing caching, retries, and concurrency yourself. Pollux uploads once, caches the content, fans out your prompts concurrently, and hands back results.

The same Source interface handles PDFs, images, video, YouTube URLs, and arXiv papers. No per-format upload code.

Need structured output? Pass a Pydantic model as response_schema and get a validated instance alongside the raw text. Switching providers is a one-line change: provider="gemini" to provider="openai".

One Upload, Many Prompts

Got three questions about the same paper? run_many() fans them out concurrently:

import asyncio
from pollux import Config, Source, run_many

envelope = asyncio.run(
    run_many(
        ["Summarize the methodology.", "List key findings.", "Identify limitations."],
        sources=[Source.from_file("paper.pdf")],
        config=Config(provider="gemini", model="gemini-2.5-flash-lite"),
    )
)
for answer in envelope["answers"]:
    print(answer)

Add more sources and Pollux broadcasts every prompt across every source, uploading each once regardless of how many prompts reference it.

Where Pollux Ends

Pollux owns content delivery, context caching, and provider translation. Prompt design, workflow orchestration, and what you do with results are yours. See Core Concepts for the full boundary model.

Installation

pip install pollux-ai

Set your provider's API key:

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"

Keys from: Google AI Studio · OpenAI · Anthropic · OpenRouter

Documentation

Full docs at polluxlib.dev.

Contributing

See CONTRIBUTING and TESTING.md for guidelines.

Built during Google Summer of Code 2025 with Google DeepMind. Learn more

License

MIT

Project details


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-1.4.0.tar.gz (601.0 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-1.4.0-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

Details for the file pollux_ai-1.4.0.tar.gz.

File metadata

  • Download URL: pollux_ai-1.4.0.tar.gz
  • Upload date:
  • Size: 601.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pollux_ai-1.4.0.tar.gz
Algorithm Hash digest
SHA256 eed841d223e2a1fced496617e72c8f39f59de89013cf178f8de4219aea21ac51
MD5 df78258448fff84f462b92eb131b428f
BLAKE2b-256 a3ab67d15079a4ae1c5246cb752d5e1efd0373ffa210dac744b50e67f0542625

See more details on using hashes here.

Provenance

The following attestation bundles were made for pollux_ai-1.4.0.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-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: pollux_ai-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 58.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pollux_ai-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e1eb48e6cf8f7ece4bdcaf65e8f2cc4f65c60d1122050ac2e4e89e74a96c0a4
MD5 a8981453e1026e91fdf4ab39d220fc66
BLAKE2b-256 6fa2756dd42930419cdf8a485d24434c64ace516bf776d4eeddfffa43dd653d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pollux_ai-1.4.0-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page