DataLab is a modern, AI-powered data processing application built with Next.js, TypeScript, and Tailwind CSS. It provides intelligent agents for data analysis, transformation, and visualization.
- Data Cleaning Agents: Remove duplicates, handle missing values, normalize text
- Analysis Agents: Detect outliers, generate statistical summaries
- Transformation Agents: Data type conversion, column operations
- Multiple AI Backends: vLLM (local), Claude (cloud), or intelligent local processing
- Automatic Fallback: Seamless fallback between AI processing modes
- Bar charts, line charts, pie charts, and scatter plots
- Real-time chart generation from uploaded data
- Configurable axes and chart types
- CSV file upload and parsing
- JSON data import
- Automatic data type detection
- Responsive design with Tailwind CSS
- Dark mode support
- Intuitive tabbed interface
- Node.js 18+
- npm, yarn, pnpm, or bun
- Clone the repository or ensure you're in the project directory
- Install dependencies:
npm install- Configure LLM integration (optional):
npm run setup-llmThis will prompt you to enter your OpenAI API key for real LLM processing. Without an API key, the app will use intelligent local processing as a fallback.
To get an Anthropic API key:
- Visit https://console.anthropic.com/
- Create a new API key
- Run the setup script and enter your key
Run the development server:
npm run devOpen http://localhost:3000 to see the application.
npm run build
npm startsrc/
├── app/ # Next.js App Router pages
│ ├── page.tsx # Homepage
│ └── workspace/ # Main workspace
├── components/ # React components
│ ├── FileUpload.tsx # File upload functionality
│ ├── DataTable.tsx # Data preview table
│ ├── AgentPanel.tsx # AI agents interface
│ └── VisualizationPanel.tsx # Charts and graphs
└── types/ # TypeScript type definitions
- Upload Data: Start by uploading a CSV or JSON file
- Preview Data: View your data in the structured table
- Run AI Agents: Use cleaning and analysis agents to process your data
- Visualize: Create interactive charts and explore insights
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- Charts: Recharts
- Icons: Lucide React
- File Processing: Papa Parse
- UI Components: Radix UI
This project follows the coding standards defined in .github/copilot-instructions.md. Key principles:
- Use TypeScript strictly with proper type definitions
- Follow React best practices with functional components
- Implement proper error handling and loading states
- Create reusable, maintainable components
- Use server components where appropriate for performance
- Follow the established code style and patterns
- Write proper TypeScript types
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License.
DataLab supports multiple AI processing backends with automatic fallback. The application provides three modes:
When configured with a vLLM endpoint, agents use your local AI server for:
- Full control over your AI models and data privacy
- Support for various open-source models (Phi-3, Llama, etc.)
- No external API dependencies
- Cost-effective processing for large datasets
When configured with an Anthropic API key:
- Intelligent duplicate detection based on semantic similarity
- Smart missing value imputation strategies
- Context-aware text normalization
- Advanced outlier detection with reasoning
- Comprehensive data insights and patterns
Without external AI, agents use intelligent local algorithms:
- Rule-based duplicate removal
- Statistical imputation (median/mode)
- Standard text normalization
- IQR-based outlier detection
- Basic statistical summaries
-
vLLM Configuration (Self-hosted AI):
VLLM_ENDPOINT_URL=http://localhost:8000 VLLM_MODEL_NAME=microsoft/Phi-3-mini-4k-instruct
-
Claude Configuration (Anthropic API):
ANTHROPIC_API_KEY=your_anthropic_api_key_here
-
Interactive Setup:
npm run setup-llm
-
Manual Configuration: Create
.env.localin the project root with your preferred configuration.
DataLab automatically selects the best available processing method:
- vLLM (if
VLLM_ENDPOINT_URLis configured) - Claude (if
ANTHROPIC_API_KEYis configured) - Local Processing (always available as fallback)
VLLM_ENDPOINT_URL: Your vLLM server endpoint (e.g., http://localhost:8000)VLLM_MODEL_NAME: Model name for vLLM (default: microsoft/Phi-3-mini-4k-instruct)ANTHROPIC_API_KEY: Your Anthropic API key for Claude processing
To use vLLM for local AI processing:
-
Install vLLM:
pip install vllm
-
Start vLLM server:
python -m vllm.entrypoints.openai.api_server \ --model microsoft/Phi-3-mini-4k-instruct \ --host 0.0.0.0 \ --port 8000
-
Configure DataLab:
VLLM_ENDPOINT_URL=http://localhost:8000 VLLM_MODEL_NAME=microsoft/Phi-3-mini-4k-instruct
- API keys are stored locally in
.env.local - Never commit API keys to version control
- The
.env.localfile is automatically ignored by Git
DataLab can be easily deployed using Docker for both development and production environments.
- Docker
- Docker Compose (optional, for easier management)
- Build and run with Docker Compose (Recommended):
# Copy environment variables
cp .env.example .env
# Edit .env with your configuration
nano .env
# Build and start the application
docker-compose up -d- Manual Docker build:
# Build the image
docker build -t datalab .
# Run the container
docker run -d \
--name datalab \
-p 3000:3000 \
-e NEXTAUTH_URL=http://localhost:3000 \
-e NEXTAUTH_SECRET=your-super-secret-jwt-secret \
-e ANTHROPIC_API_KEY=your-api-key \
-v datalab_data:/app/data \
datalab# Start development environment
docker-compose --profile dev upThis will start the development server with hot-reloading on port 3001.
Create a .env file in the project root with the following variables:
# Database
DATABASE_URL=file:/app/data/prisma/dev.db
# Authentication
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-super-secret-jwt-secret-replace-in-production
# AI API Keys
ANTHROPIC_API_KEY=your-anthropic-api-key
# Optional: OAuth providers
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GITHUB_ID=your-github-id
GITHUB_SECRET=your-github-secretDockerfile: Production build with multi-stage optimizationDockerfile.dev: Development build with hot-reloadingdocker-compose.yml: Orchestration for both production and development.dockerignore: Optimizes build context and image size
The container includes health checks available at /api/health:
# Check container health
curl http://localhost:3000/api/healthThe SQLite database is persisted using Docker volumes:
- Production:
datalab_datavolume - Development:
datalab_dev_datavolume
- Use environment files: Create production-specific
.envfiles - SSL/TLS: Use a reverse proxy (nginx, traefik) for HTTPS
- Monitoring: Add logging and monitoring solutions
- Backup: Regularly backup the database volume
- Updates: Use rolling updates for zero-downtime deployments
For high-traffic deployments:
# docker-compose.production.yml
version: '3.8'
services:
datalab:
image: datalab:latest
deploy:
replicas: 3
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure