Skip to content

Add Docker support, dataset validation, and CLI enhancements - #33

Open
pradeepgudipati wants to merge 2 commits into
mainfrom
fixes/updates
Open

Add Docker support, dataset validation, and CLI enhancements#33
pradeepgudipati wants to merge 2 commits into
mainfrom
fixes/updates

Conversation

@pradeepgudipati

Copy link
Copy Markdown
Owner

This pull request introduces a comprehensive modernization and refactor of the LLMTrainingTools project, focusing on improved developer experience, clearer onboarding, and enhanced local and containerized workflows. Key improvements include a streamlined quickstart script, Docker support, a modernized dependency and configuration system, and a rewritten README for clarity. Several sample datasets and validation examples are also added.

Project Setup & Developer Experience

  • Added a quickstart.sh script for one-command local setup, dependency installation, and app launch, supporting dry-run and no-run modes for flexibility.
  • Introduced a .dockerignore file and a Dockerfile for efficient container builds, plus a docker-compose.yml for simple multi-service orchestration. [1] [2] [3]
  • Updated the CI workflow: now uses uv for dependency management, runs lint and tests on push and PR, and supports multiple Python versions.

Configuration & Dependency Management

  • Added .env.example for environment variable documentation and default config, and updated code to load configuration from this file. .env.local is now ignored by default. [1] [2] [3] [4]
  • Modernized pyproject.toml: core dependencies are minimal, AI/vector extras are optional, dev dependencies are grouped, and the CLI entrypoint is defined.

Documentation & Usability

  • Rewrote README.md for clarity and quick onboarding, including usage walkthroughs, dependency groups, configuration, Docker/Compose instructions, and validation guidance.
  • Added sample data files (sample_qa.csv, sample_chat.jsonl) to illustrate supported dataset shapes and validation. [1] [2]

Licensing

  • Added an MIT LICENSE file for clear open-source terms.

App Initialization & Robustness

  • App now resolves the database path from environment variables, ensures required directories exist, and enforces required environment variables for security and configurability. [1] [2]

Project Setup & Developer Experience

  • Added quickstart.sh for streamlined local bootstrap, dependency install, and app launch, with dry-run and no-run options.
  • Introduced Docker support (Dockerfile, .dockerignore, docker-compose.yml) for containerized deployment and development. [1] [2] [3]
  • Improved CI: now uses uv, runs lint/tests on push and PR, and supports Python 3.10–3.12.

Configuration & Dependency Management

  • Switched to .env.example for config, with code loading from this file; .env.local is now ignored. [1] [2] [3]
  • Refactored pyproject.toml: minimal core deps, optional AI/vector extras, dev group, CLI entrypoint.

Documentation & Usability

  • Rewrote README.md for clear onboarding, usage, validation, and Docker/CI instructions.
  • Added sample datasets for QA, chat, preference, RAG, and eval records. [1] [2]

Licensing

  • Added MIT LICENSE file.

App Initialization & Robustness

  • App now loads config from environment, resolves DB paths, and ensures directories exist; enforces required env vars. [1] [2]

Add Docker/Docker Compose and .env.example for containerised local runs; update README and add MIT LICENSE. Introduce a CLI entrypoint (src/cli.py) and package script, load env vars in app, and wire a Dockerfile to run the app. Implement dataset validation (src/data_tools/dataset_validation.py) and integrate validation into CSV/JSONL import/export flows; improve JSONL↔SQLite converters, add schema migration/ensure logic, and robust backup/restore utilities. Refactor utils (remove old inline validators), add samples and CSV/JSONL examples, and add unit tests covering startup, CSV→JSONL, DB backup/restore, and JSONL roundtrip. Update CI to use uv, run precommit and pytest, and refresh pyproject.toml (dependencies, optional 'ai' extras, scripts, build settings). Minor housekeeping: .gitignore/.dockerignore updates and various small bugfixes and robustness improvements (encoding, path handling, safer file ops).
Introduce dataset validation end-to-end and developer ergonomics: add /api/validate_dataset, a comprehensive dataset validation implementation (CSV/JSONL parsing, HF conversation/instruction/preference/tool/rag/eval normalizers, duplicate detection, PII/secret and size checks, and build_validation_report). Add scripts/quickstart.sh for bootstrapping and update README and CI to use scripts/precommit.sh and the quickstart flow; move precommit.sh into scripts/. Add src/config.py to load .env.example/.env into the runtime and require certain env vars; refactor app/cli/ai_api to use the new config loader and to resolve DB paths and ensure DB schema on startup. Update frontend upload UI and JS to show a Validate button and render validation reports before processing. Remove legacy requirements.txt and update .env.example, .gitignore, and docker-compose to surface the example env and DB path. Add tests covering validation, duplicate detection, quickstart, and validation API.
Comment thread src/app.py
http_status = 200 if report["status"] == "valid" else 422
return jsonify(status=report["status"], report=report), http_status
except ValueError as error:
return jsonify(status="error", message=str(error)), 400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants