Dslighting
π₯π₯π₯ DSLighting is an LLM-driven autonomous data science execution engine that turns task descriptions and datasets into iterative code generation, execution, evaluation, and refinement workflows.
Install / Use
/learn @usail-hkust/DslightingREADME
DSLIGHTING: Data Science Framework
<p align="center"> <a href="#quick-start-simplified-api"><img src="https://img.shields.io/badge/%F0%9F%9A%80-Quick_Start-green?style=for-the-badge" alt="Quick Start"></a> <a href="#what-dslighting-is"><img src="https://img.shields.io/badge/%E2%9A%A1-Features-blue?style=for-the-badge" alt="Core Features"></a> <a href="https://luckyfan-cs.github.io/dslighting-web/"><img src="https://img.shields.io/badge/%F0%9D%93%9A-Docs-orange?style=for-the-badge" alt="Documentation"></a> <a href="https://luckyfan-cs.github.io/dslighting-web/guide/getting-started.html"><img src="https://img.shields.io/badge/%F0%9D%93%96-User_Guide-purple?style=for-the-badge" alt="User Guide"></a> <a href="https://github.com/usail-hkust/dslighting/stargazers"><img src="https://img.shields.io/github/stars/usail-hkust/dslighting?style=for-the-badge" alt="Stars"></a> <img src="https://komarev.com/ghpvc/?username=usail-hkust&repo=dslighting&style=for-the-badge" alt="Profile views"> </p>δΈζ Β· ζ₯ζ¬θͺ Β· FranΓ§ais
</div> <div align="center">π― Intelligent Agent Workflows Β β’Β π Interactive Data Visualization<br> π€ Automated Code Generation Β β’Β π End-to-End Task Evaluation
β Star us Β β’Β π¬ Discussions
</div><details> <summary><strong>News 2026.03</strong> Β· <a href="#benchmarks">Jump to Benchmarks</a></summary>
DSLighting now officially supports benchmark evaluation for DACode (EMNLP 2024), DABench (ICML 2024), MoSciBench (ICLR 2026), MLE-Bench, and ScienceAgentBench (ICLR 2025).
Run benchmark evaluations with just a few lines of code through DSBenchmark.
New in v2.7.9 (Current)
| Feature | Description | |---------|-------------| | Benchmark Mode | Officially supports DABench, DACode, MLEBench, MoSciBench, and ScienceAgentBench / ScienceBench benchmark families for agent evaluation | | DAG Mode | Enhanced Directed Acyclic Graph (DAG) runtime for workflow orchestration | | ~~Web UI~~ | Development is currently paused, and the Web UI is no longer supported in this repository |
What DSLighting Is
DSLighting is an LLM-driven data science execution framework. DSLighting is an LLM-driven autonomous data science execution engine that turns task descriptions and datasets into iterative code generation, execution, evaluation, and refinement workflows. It supports:
- task-oriented agent execution (
run_agent,Agent) - benchmark evaluation (
DSBenchmark) - architecture-level customization (services/operators/workflows)
The current public API is split into two layers:
dslighting.api: simplified, stable user APIdslighting.arch.*: advanced architecture API for custom agent development
Two Usage Modes
-
Simplified API (recommended for quick start)
For rapid prototyping and standard data science tasks. -
Architecture (recommended for deep customization)
For advanced users building custom operators, workflows, and factories.
Installation
git clone https://github.com/usail-hkust/dslighting.git
cd dslighting
python3.10 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt # Core runtime dependencies
pip install -e .
# Optional: full development/research dependency set
# pip install -r requirements_local.txt
If you hit ModuleNotFoundError: aiofiles, run:
pip install aiofiles
Environment Setup
Minimal .env:
API_KEY=your_key
API_BASE=https://api.openai.com/v1
LLM_MODEL=gpt-4o
Optional model-specific overrides (LLM_MODEL_CONFIGS):
{
"openai/deepseek-ai/DeepSeek-V3.1-Terminus": {
"api_key": ["key1", "key2"],
"api_base": "https://api.siliconflow.cn/v1",
"temperature": 1.0
}
}
config.yaml (Optional)
config.yaml is optional for normal run_agent / Agent usage.
- You can run most tasks without it.
- It is mainly used by benchmark/runtime configuration and custom model pricing metadata.
- Task registries still use per-task
data_dir/<task_id>/config.yaml(separate from root config).
Minimal example (config.yaml):
run:
enable_trajectory_logging: false
trajectory_filename: trajectory.jsonl
llm_pricing:
custom_models: {}
Sandbox Backends (Simplified API)
run_agent and Agent support:
locale2bds_sandbox
Use explicit dotenv loading in your script:
from dotenv import load_dotenv
load_dotenv()
.env example
SANDBOX_BACKEND=local
SANDBOX_BACKEND_TYPE=docker
SANDBOX_TIMEOUT=21600
E2B_API_KEY=
SANDBOX_WORKSPACE_BASE=/tmp/ds_sandbox_workspaces
SANDBOX_PAUSED_BASE=/tmp/ds_sandbox_paused
Local sandbox
result = run_agent(
task_id="bike-sharing-demand",
sandbox_backend="local",
)
E2B sandbox
result = run_agent(
task_id="bike-sharing-demand",
sandbox_backend="e2b",
sandbox_api_key=None, # read from E2B_API_KEY by default
)
Notes:
- install SDK:
pip install e2b - set
E2B_API_KEYin.env(or passsandbox_api_key)
DS-Sandbox
result = run_agent(
task_id="bike-sharing-demand",
sandbox_backend="ds_sandbox",
sandbox_backend_type="local", # or "docker"
)
Notes:
- install package:
pip install ds-sandbox - defaults use writable paths under
/tmpto avoid/optpermission issues
Quick Start (Simplified API)
One-liner execution
from dotenv import load_dotenv
load_dotenv()
from dslighting.api import run_agent
result = run_agent(
task_id="bike-sharing-demand",
workflow="aide", # optional
model="gpt-4o", # optional
)
print(result.success, result.score, result.cost)
print(result.duration, result.output, result.error)
Use Agent directly
from dotenv import load_dotenv
load_dotenv()
from dslighting.api import Agent
agent = Agent(
workflow="aide",
model="gpt-4o",
max_iterations=5,
)
result = agent.run(task_id="bike-sharing-demand")
print(result)
Architecture Mode (Custom Agent Development)
Use this when you need custom operators/workflows/factories.
What each part does:
Operator: one async capability unit (for example, summarize, plan, execute).Workflow.solve(...): core async logic of your agent.WorkflowFactory.create_agent(...): wires services + operators into a workflow instance.workflow.run(...): sync wrapper aroundsolve(...)for non-async users.
from pathlib import Path
from typing import Any
from dslighting.arch.interfaces import WorkflowFactoryInterface
from dslighting.arch.operators import Operator
from dslighting.arch.services import LLMService, SandboxService, WorkspaceService
from dslighting.arch.state import JournalState
from dslighting.arch.workflows import BaseWorkflow, BaseWorkflowFactory
from dslighting.config import LLMConfig
class SummarizeOperator(Operator):
async def __call__(self, text: str) -> dict[str, Any]:
return {"summary": text[:200]}
class MyWorkflow(BaseWorkflow):
def __init__(self, operators, services, agent_config=None):
super().__init__(
operators=operators,
services=services,
agent_config=agent_config or {},
)
async def solve(
self,
description: str,
io_instructions: str,
data_dir: Path,
output_path: Path,
) -> dict[str, Any]:
return await self.operators["summarize"](text=description)
class MyWorkflowFactory(BaseWorkflowFactory, WorkflowFactoryInterface):
def create_agent(self, **kwargs):
workspace = WorkspaceService(run_name="custom_arch_run")
services = {
"llm": LLMService(config=LLMConfig(model=self.model)),
"sandbox": SandboxService(workspace=workspace),
"workspace": workspace,
"state": JournalState(),
}
operators = {
"summarize": SummarizeOperator(),
}
return MyWorkflow(operators=operators, services=services, agent_config=kwargs)
# Recommended for normal scripts: sync call via workflow.run(...)
def main():
workflow = MyWorkflowFactory(model="gpt-4o").create_agent(max_iterations=3)
result = workflow.run(data="data/competitions/bike-sharing-demand")
print(result)
if __name__ == "__main__":
main()
For most users (no custom workfl
Related Skills
node-connect
341.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.5kCommit, push, and open a PR
