Skip to main content

Lightning Rod Python SDK

Foresight returns a calibrated probability for any question about the future through an OpenAI-compatible API.

Trusted for high-stakes predictions by Numinous, Shore Capital Partners, Awardable, ERIS Marketplace, and others. Foresight processes billions of tokens and serves 100k+ inference requests every day.

Documentation · Get an API key · Research paper

⚡ Better AI Predictions

Foresight is served behind an OpenAI-compatible endpoint, so any OpenAI client works — just point base_url at Lightning Rod.

from openai import OpenAI

client = OpenAI(
    api_key="your-api-key",
    base_url="https://api.lightningrod.ai/v1/openai",
)

completion = client.chat.completions.create(
    model="foresight-v4",
    messages=[
        {"role": "user", "content": "Will the Fed cut rates at its next meeting?"},
    ],
    extra_body={"research": True}, # Auto research the most relevant prediction context
)

print(completion.choices[0].message.content)

See the forecasting guides for how to write good forecasting prompts.

Prefer an SDK helper?

lr.predict() wraps the same API and parses the structured answer for you:

pip install lightningrod-ai
import lightningrod as lr

client = lr.LightningRod(api_key="your-api-key")
result = client.predict(
    "Will the Fed cut interest rates in 2026?",
    answer_type="binary",
    research=True,
)
print(result.binary.probability)

🏗️ Train an expert on your domain

Need a model tuned to your domain? Our platform turns raw sources into labeled datasets and fine-tuned models. Read the Future-as-Label paper or view public models and datasets on Hugging Face.

📅 Book a call with us

📚 Learn more

Metadata

Release files for lightningrod-ai 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lightningrod-ai 1.1.0
File Size Uploaded
lightningrod_ai-1.1.0.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lightningrod-ai 1.1.0
File Interpreter ABI Platform
lightningrod_ai-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.1 kB

Release files / lightningrod_ai-1.1.0.tar.gz

Download URL lightningrod_ai-1.1.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
02932b3247c4b46a47548686729740d83db6d2ebe70044056b05eabcfa89a102
BLAKE2b-256 checksum
How to use checksums
5abddd653ae61aeb9b8bbbacfc486cdab8492604903d777548f500c08ec7a6e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / lightningrod_ai-1.1.0-py3-none-any.whl

Download URL lightningrod_ai-1.1.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81f0a80fcf164f2a2dd91e9919452ea747fc923f246fe1e20c38c7b8f408ed5a
BLAKE2b-256 checksum
How to use checksums
3a02d1569da4b61b10219518e28105955df1511e4747bbc1361706af08a44ca5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.28

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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