Skip to main content

Simplified API for Data Science Agent Automation

Project description

DSLIGHTING Logo

DSLIGHTING:全流程数据科学智能助手

Python FastAPI React Next.js License

Quick Start    Core Features    Documentation    User Guide    Stars    Profile views

English · 日本語 · Français

🎯 智能Agent工作流  •  📊 交互式数据可视化
🤖 自动化代码生成  •  📈 全流程任务评估

💬 加入微信交流群  •  ⭐ 给我们Star


📸 Web界面预览

主页面

主页面

数据探索 (EDA)

数据探索

自定义任务

自定义任务

模型训练

模型训练

报告生成

报告生成


📖 项目简介

DSLIGHTING 是一个全流程数据科学智能助手系统,采用Agent式工作流和可复用的数据布局,为数据科学任务提供端到端的执行、评估和迭代能力。

✨ 核心特性

  • 🤖 多种Agent工作流:集成aide、automind、dsagent等多种智能体风格
  • 🔄 元优化框架:支持AFlow元优化,自动选择最优工作流
  • 📊 Web可视化界面:基于Next.js + FastAPI的交互式Dashboard
  • 📝 完整日志追踪:记录每次运行的artifacts和摘要
  • 🧩 可扩展架构:灵活的任务注册和数据准备流程

🚀 快速开始

📖 查看完整文档https://luckyfan-cs.github.io/dslighting-web/

💡 需要详细配置步骤? 查看 完整配置指南

系统要求

  • Python: 3.10 或更高版本
    # 检查Python版本
    python --version
    # 或
    python3 --version
    
  • Node.js: 18.x 或更高版本
  • npm: 9.x 或更高版本(随Node.js一起安装)
  • Git: 用于版本控制

1. 环境准备

git clone https://github.com/usail-hkust/dslighting.git
cd dslighting
python3.10 -m venv dslighting
source dslighting/bin/activate  # Windows: dslighting\Scripts\activate

2. 安装依赖

标准安装(推荐):

pip install -r requirements.txt

备选方案(如果标准安装出错):

pip install -r requirements_local.txt

💡 说明

  • requirements.txt:锁定具体版本,适合生产环境
  • requirements_local.txt:不锁定版本,依赖更灵活,适合开发环境

3. (可选) 安装 Python API 包

🎉 新功能! DSLighting 现在提供简化的 Python API,让使用像 scikit-learn 一样简单!

快速安装 Python API 包

pip install -e .

一行代码运行数据科学任务

import dslighting

# 快速运行
result = dslighting.run_agent("data/competitions/bike-sharing-demand")

# 查看结果
print(f"得分: {result.score}, 成本: ${result.cost:.4f}")

# 或者更多控制
data = dslighting.load_data("data/competitions/bike-sharing-demand")
agent = dslighting.Agent(workflow="aide", model="gpt-4o-mini", temperature=0.7)
result = agent.run(data)

📖 详细文档Python API 快速上手指南 | API 完整文档

特点

  • 🚀 超简单:1-3 行代码完成复杂任务
  • 🤖 智能检测:自动识别任务类型和推荐工作流
  • 🔧 完全兼容:与现有 DSAT API 100% 兼容
  • 📊 开箱即用:合理的默认配置,环境变量驱动

4. 配置API密钥

cp .env.example .env
# 编辑.env文件,设置你的API密钥

DSLighting支持多种LLM提供商:

国内API提供商(推荐):

国际API提供商

支持通过 API_KEY/API_BASELLM_MODEL_CONFIGS 配置不同模型。

💡 配置示例: 查看 .env.example 文件获取详细的多模型配置示例,包括API密钥轮换、温度设置等。

5. 准备数据

DSLighting支持多种数据来源。目前支持以下数据准备方式:

方式1:通过MLE-Bench下载(推荐)

MLE-Bench是OpenAI提供的机器学习评估基准数据集。

# 1. 克隆MLE-Bench仓库
git clone https://github.com/openai/mle-bench.git
cd mle-bench

# 2. 安装依赖
pip install -e .

# 3. 下载所有数据集
python scripts/prepare.py --competition all

# 4. 将数据链接到DSLighting项目
# MLE-Bench数据默认在 ~/mle-bench/data/
# 可以创建符号链接或复制到 dslighting 项目
ln -s ~/mle-bench/data/competitions /path/to/dslighting/data/competitions

📖 详细信息: 查看 MLE-Bench文档 了解更多数据集详情。

方式2:自定义数据集

您也可以使用自己的数据集,只需按照DSLighting的数据布局结构组织:

data/competitions/
  <竞赛ID>/
    config.yaml           # 竞赛配置文件
    prepared/
      public/            # 公开数据(训练集、样本提交)
      private/           # 私有数据(测试标签,用于评分)

💡 提示: 更多数据类型和预训练模型支持正在陆续开放中,敬请期待!

📖 详细数据准备指南: 查看 数据准备文档 了解更多详情。

6. 运行单个任务

python run_benchmark.py \
  --workflow aide \
  --benchmark mle \
  --data-dir data/competitions \
  --task-id bike-sharing-demand \
  --llm-model gpt-4

7. 使用Web UI(推荐)

我们提供了基于 Next.js + FastAPI 的Web界面,让数据上传和任务执行更加便捷。

6.1 后端环境配置

后端依赖主项目的dslighting环境,只需额外安装Web框架依赖:

source dslighting/bin/activate
# 安装后端依赖
pip install -r web_ui/backend/requirements.txt

6.2 启动后端服务

# 进入后端目录
cd web_ui/backend

# 启动后端(默认端口8003)
python main.py

或者使用uvicorn直接启动:

cd web_ui/backend
uvicorn app.main:app --reload --host 0.0.0.0 --port 8003

📖 详细文档:查看 后端README 了解API端点和配置说明

💡 提示:后端默认运行在 8003端口。如果端口被占用,修改 main.py 中的端口号。

6.3 启动前端服务

cd web_ui/frontend
npm install  # 首次运行时安装依赖
npm run dev  # 启动开发服务器

📖 详细文档:查看 前端README 了解更多前端开发细节

6.4 访问Dashboard

打开浏览器访问:http://localhost:3000


🏗️ 核心功能

Agent工作流

  • aide:迭代式代码生成和审查循环
  • automind:带记忆和任务分解的规划+推理
  • dsagent:结构化操作符流程的规划/执行循环
  • data_interpreter:快速代码执行和调试循环
  • autokaggle:SOP风格的Kaggle工作流
  • aflow:工作流的元优化
  • deepanalyze:专注分析型执行工作流

数据布局

data/competitions/
  <竞赛ID>/
    config.yaml           # 竞赛配置文件
    prepared/
      public/            # 公开数据
      private/           # 私有数据

配置说明

config.yaml 会被基准测试运行器和LLM服务读取:

  • competitions:MLEBench的默认竞赛列表
  • sciencebench_competitions(可选):ScienceBench的默认列表
  • custom_model_pricing:LiteLLM的按模型token定价覆盖
  • run:轨迹日志记录开关

📂 日志和Artifacts

默认日志写入路径:

runs/benchmark_results/<workflow>_on_<benchmark>/<model_name>/

可以通过 --log-path 参数覆盖基础目录。


❓ 常见问题

查看 docs/FAQ.md 获取更多详细信息。


⭐ Star History

Stargazers    Forkers

Star History Chart

💬 微信交流群

欢迎加入我们的微信交流群,与其他用户和开发者交流经验!

微信交流群

扫描上方二维码加入DSLighting用户交流群

在群内您可以:

  • 🤝 与其他用户交流使用经验
  • 💡 提出功能建议和反馈
  • 🐛 报告Bug并获得帮助
  • 📢 了解最新开发动态

🤝 贡献指南

我们希望 DSLIGHTING 能成为社区的一份礼物。🎁

核心贡献者

查看 docs/CONTRIBUTING.md 了解如何参与贡献。


🔗 社区


📄 许可证

本项目采用 AGPL-3.0 许可证。


🙏 致谢

感谢你关注 DSLIGHTING!


📊 项目统计


📚 引用 (Citation)

如果你在研究中使用了 DSLIGHTING,请使用以下 BibTeX 格式进行引用:

@software{dslighting2025,
  title = {DSLIGHTING: An End-to-End Data Science Intelligent Assistant System},
  author = {Liu, F. and Liu, C. and others},
  year = {2025},
  publisher = {GitHub},
  url = {https://github.com/usail-hkust/dslighting},
  version = {1.0.0}
}

或者使用 plain text 格式:

Liu, F., Liu, C., et al. (2025). DSLIGHTING: An End-to-End Data Science Intelligent Assistant System.
GitHub repository. https://github.com/usail-hkust/dslighting

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

dslighting-1.3.3.tar.gz (126.5 kB view details)

Uploaded Source

Built Distribution

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

dslighting-1.3.3-py3-none-any.whl (154.3 kB view details)

Uploaded Python 3

File details

Details for the file dslighting-1.3.3.tar.gz.

File metadata

  • Download URL: dslighting-1.3.3.tar.gz
  • Upload date:
  • Size: 126.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.1

File hashes

Hashes for dslighting-1.3.3.tar.gz
Algorithm Hash digest
SHA256 d643c46d63e02de24ab01b7323c439d1455d56c2f1c3e9aee6c94bd3887f3d6b
MD5 6b6d896080bdc49797afae76bdb37f10
BLAKE2b-256 7e44009974d920f8b7b0ea896c68c6963b352c1ca511ace294e98a9a7966aa11

See more details on using hashes here.

File details

Details for the file dslighting-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: dslighting-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 154.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.1

File hashes

Hashes for dslighting-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3cb0a71f3bd5e38a8497701616fb222aa6438322da5ce6a65e46dab0bd11ab27
MD5 008dd2d47eb51270f33f536e093c54e4
BLAKE2b-256 013ea01f143b753fee3d94aec1aa092245f884d31284aeabb58f6547c3ef9fd2

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