Skip to main content

Predict anything with AI. Python SDK for Foresight forecasting models, built on top of OpenAI compatible inference API.

Project description

04-product-ui

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

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

lightningrod_ai-0.2.2.tar.gz (198.2 kB view details)

Uploaded Source

Built Distribution

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

lightningrod_ai-0.2.2-py3-none-any.whl (341.5 kB view details)

Uploaded Python 3

File details

Details for the file lightningrod_ai-0.2.2.tar.gz.

File metadata

  • Download URL: lightningrod_ai-0.2.2.tar.gz
  • Upload date:
  • Size: 198.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for lightningrod_ai-0.2.2.tar.gz
Algorithm Hash digest
SHA256 41db8d1a4a1e4dc248a9fe75cf91e623e1e1040694856a6184e2c85271905caf
MD5 b487b56033963cc28086def122f1b1b8
BLAKE2b-256 ac632bbf59f4b1ec70ea27b9cbd3e618dab9e5582bc0fa42c88062ee32933311

See more details on using hashes here.

File details

Details for the file lightningrod_ai-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lightningrod_ai-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9ff92c9987994a2339d8ec5be49dc085858aef74599e6b2615c1fe25973813ae
MD5 2bf124c221b3079c3a5ab0b6a56c448c
BLAKE2b-256 2fc593ab3fcb3b74db902f669e3fe2fcb79fda6cf7dfa79347f3f0935eee8f1a

See more details on using hashes here.

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