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

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?",
        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

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

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.0.0rc1.tar.gz (247.5 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.0.0rc1-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file pollux_ai-1.0.0rc1.tar.gz.

File metadata

  • Download URL: pollux_ai-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 247.5 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.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 350d6af66f77c9a20f1ada28f95880413d1b5983110a987a7de499b15a24e91c
MD5 d429f40fdd043846898b2e2f59945068
BLAKE2b-256 e7ecea9c607a072bc92a7d66f81b212b45f79e4b00eacafea856e60321680da8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pollux_ai-1.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 33.5 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.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 9494251a8d3c65408b23c9a3b5424f13ac913fc140f4b4e287a0765c5673c5f7
MD5 7ee5b267fdb7a89ecef5ceddf5b90e3c
BLAKE2b-256 e797ae947b937d0e60ab0f00af872fc7d765a50e6eabaf28a9a6bb266a1d8522

See more details on using hashes here.

Provenance

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