Python SDK for Lightning Rod AI-powered forecasting dataset generation
Project description
Lightning Rod Python SDK 
The Lightning Rod SDK provides a simple Python API for generating custom forecasting datasets to train your LLMs. Transform news articles, documents, and other real-world data into high-quality training samples automatically.
Based on our research: Future-as-Label: Scalable Supervision from Real-World Outcomes
👋 Quick Start
1. Install the SDK
pip install lightningrod-ai
2. Get your API key
Sign up at dashboard.lightningrod.ai to get your API key and $50 of free credits.
3. Generate your first dataset
Generate 1000+ forecasting questions in minutes - from raw sources to labeled dataset, automatically. ⚡
from lightningrod import LightningRod, BinaryAnswerType, QuestionPipeline, NewsSeedGenerator, ForwardLookingQuestionGenerator, WebSearchLabeler
lr = LightningRod(api_key="your-api-key")
binary_answer = BinaryAnswerType()
pipeline = QuestionPipeline(
seed_generator=NewsSeedGenerator(
start_date=datetime.now() - timedelta(days=90),
end_date=datetime.now(),
search_query=["Trump"],
),
question_generator=ForwardLookingQuestionGenerator(
instructions="Generate binary forecasting questions about Trump's actions and decisions.",
examples=[
"Will Trump impose 25% tariffs on all goods from Canada by February 1, 2025?",
"Will Pete Hegseth be confirmed as Secretary of Defense by February 15, 2025?",
]
),
labeler=WebSearchLabeler(answer_type=binary_answer),
)
dataset = lr.transforms.run(pipeline, max_questions=3000)
dataset.flattened() # Ready-to-use data for your training pipelines
We use this to generate the Future-as-Label training dataset for our research paper.
✨ Examples
We have some example notebooks to help you get started! If you have trouble using the SDK, please submit an issue on Github.
For complete API reference documentation, see API.md. This includes overview of the core system concepts, methods and types.
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 lightningrod_ai-0.1.14.tar.gz.
File metadata
- Download URL: lightningrod_ai-0.1.14.tar.gz
- Upload date:
- Size: 81.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a3fccea0baf36e7bec930c090598596bdf8a2d4b1290dee1277c15eb8ecf568
|
|
| MD5 |
d50128843f785c69c51fdf6e79c0a596
|
|
| BLAKE2b-256 |
d7e3990ba65ed8835a3e6376e7281b951a235fe3e2aa24ed1d5224baac8642be
|
File details
Details for the file lightningrod_ai-0.1.14-py3-none-any.whl.
File metadata
- Download URL: lightningrod_ai-0.1.14-py3-none-any.whl
- Upload date:
- Size: 169.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bdb1bf4e4f6c8c504e44ad5753d65b72600bd65ef84f0e1bc93ab7532b64cae
|
|
| MD5 |
b085fb7f97cca09f5827ff38892b0f29
|
|
| BLAKE2b-256 |
c1bc7b5f823bec79bf12f4124bc8acc7b2edc1b31bde622cf8fdf115f88c1bab
|