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 complexity—so you don't.
Originally built for Gemini during Google Summer of Code 2025. Pollux now supports both Gemini and OpenAI with explicit capability differences.
Documentation · Quickstart · Cookbook
Quick Start
import asyncio
from pollux import Config, Source, run
result = asyncio.run(
run(
"What are the key findings?",
source=Source.from_text(
"Pollux supports fan-out, fan-in, and broadcast source patterns. "
"It also supports context caching for repeated prompts."
),
config=Config(provider="gemini", model="gemini-2.5-flash-lite"),
)
)
print(result["answers"][0])
For a full 2-minute walkthrough (install, key setup, success checks), use
Quickstart. For local-file
analysis, swap to Source.from_file("paper.pdf").
Why Pollux?
- Multimodal-first: PDFs, images, videos, YouTube—same API
- Source patterns: Fan-out (one source → many prompts), fan-in, and broadcast
- Context caching: Upload once, reuse across prompts—save tokens and money
- Production-ready core: async execution, explicit capability checks, clear errors
Installation
pip install pollux-ai
Or download the latest wheel from Releases.
API Key
Get a key from Google AI Studio, then:
export GEMINI_API_KEY="your-key-here"
Usage
Multi-Source Analysis
import asyncio
from pollux import Config, Source, run_many
async def main() -> None:
config = Config(provider="gemini", model="gemini-2.5-flash-lite")
sources = [
Source.from_file("paper1.pdf"),
Source.from_file("paper2.pdf"),
]
prompts = ["Summarize the main argument.", "List key findings."]
envelope = await run_many(prompts, sources=sources, config=config)
for answer in envelope["answers"]:
print(answer)
asyncio.run(main())
Configuration
from pollux import Config
config = Config(
provider="gemini",
model="gemini-2.5-flash-lite",
enable_caching=True,
)
See the Configuration Guide for details.
Provider Differences
Pollux does not force strict feature parity across providers in v1.0. See the capability matrix: Provider Capabilities.
Documentation
- Quickstart — First result in 2 minutes
- Concepts — Mental model for source patterns and caching
- Sources and Patterns — Source constructors, run/run_many, ResultEnvelope
- Configuration — Providers, models, retries, caching
- API Reference — Entry points and types
- Cookbook — Scenario-driven, ready-to-run recipes
Origins
Pollux was developed as part of Google Summer of Code 2025 with Google DeepMind. Learn more →
Contributing
See CONTRIBUTING and TESTING.md for guidelines.
License
Project details
Release history Release notifications | RSS feed
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-1.0.0rc2.tar.gz.
File metadata
- Download URL: pollux_ai-1.0.0rc2.tar.gz
- Upload date:
- Size: 247.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
996f068851b850ed2aca31b1a0808d835f7df9ad926ed8d939745ecefe59d186
|
|
| MD5 |
b404fcf8d16445bcfd644b52c94e057d
|
|
| BLAKE2b-256 |
502cf4f9a6068d8730f0a4f862bc640191cdc2f6b327ee6310a9d85cd0ba8933
|
Provenance
The following attestation bundles were made for pollux_ai-1.0.0rc2.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-1.0.0rc2.tar.gz -
Subject digest:
996f068851b850ed2aca31b1a0808d835f7df9ad926ed8d939745ecefe59d186 - Sigstore transparency entry: 953473180
- Sigstore integration time:
-
Permalink:
seanbrar/pollux@3f1451731ea835d98439f25bddf270290b94ed95 -
Branch / Tag:
refs/heads/release/v1.0 - Owner: https://github.com/seanbrar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3f1451731ea835d98439f25bddf270290b94ed95 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pollux_ai-1.0.0rc2-py3-none-any.whl.
File metadata
- Download URL: pollux_ai-1.0.0rc2-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c14f97033ae6d3f1519efb952793eee5df76f2da4dafcf294b8d99373162e21f
|
|
| MD5 |
5fcbb106d75c3f71efe10691a2051425
|
|
| BLAKE2b-256 |
aabe610586dffc51c19dbc7094aac22980304623edda0e25ca205d156b10ccee
|
Provenance
The following attestation bundles were made for pollux_ai-1.0.0rc2-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-1.0.0rc2-py3-none-any.whl -
Subject digest:
c14f97033ae6d3f1519efb952793eee5df76f2da4dafcf294b8d99373162e21f - Sigstore transparency entry: 953473183
- Sigstore integration time:
-
Permalink:
seanbrar/pollux@3f1451731ea835d98439f25bddf270290b94ed95 -
Branch / Tag:
refs/heads/release/v1.0 - Owner: https://github.com/seanbrar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3f1451731ea835d98439f25bddf270290b94ed95 -
Trigger Event:
workflow_dispatch
-
Statement type: