Skip to main content

Python SDK for dataset generation on LightningRod platform ⚡

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 rates by 25bp in March 2026?",
    answer_type="binary",
    research=True,
)
print(result.binary.probability)  # e.g. 0.62

🏗️ 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.0.tar.gz (194.0 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.0-py3-none-any.whl (334.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lightningrod_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 739c9a1824b112e1986dce68c2dde6e110151f1374fc205e62676f87efb509d7
MD5 76c0756ae5cc342f4df977e08128163c
BLAKE2b-256 8c858acd9c2246e7cc43d2f2e5de53445151ee883a6eb8f1b8f66d6b51433b1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lightningrod_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 334.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for lightningrod_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bddf9608d41054686307f66fffbd18dc4ad95ee0ed623203e27e2a03db7a170c
MD5 7260023342c410637cce52f47302bdb7
BLAKE2b-256 eaff690c184f85e690c836d09e2c5efd0b2c07a1cc8fc8bce4c2003cb3f23143

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