E.D.E.N. is a backend-first AI infrastructure project for building, cleaning, scoring, evaluating, and iteratively improving prompt datasets for large language models.
The project focuses on dataset quality, model comparison, and experiment tracking rather than chat UI:
- structured prompt dataset generation
- cleaning and semantic deduplication
- transparent quality scoring
- multi-backend LLM evaluation
- automatic weak-prompt improvement
- experiment logging and SQLite persistence
- metrics snapshots and trend tracking
The main goal is to keep the prompt dataset itself under measurement and version control:
- better prompts create better benchmarks
- better benchmarks expose real model differences
- better measurements create a more reliable improvement loop
flowchart LR
A["Template / Seed Inputs"] --> B["Dataset Generation Engine"]
B --> C["Cleaning Pipeline"]
C --> D["Quality Scoring Engine"]
D --> E["LLM Evaluation Engine"]
E --> F["Improvement Loop"]
F --> G["Prompt Versioning + History"]
G --> H["Metrics Aggregator"]
H --> I["FastAPI API + Artifacts"]
H --> J["SQLite + Time-Based Snapshots"]
F --> C
EDEN/
├── ARCHITECTURE_PLAN.md
├── README.md
├── backend/
│ ├── .env.example
│ ├── app/
│ │ ├── api/
│ │ │ ├── router.py
│ │ │ └── routes/
│ │ │ ├── datasets.py
│ │ │ ├── health.py
│ │ │ ├── metrics.py
│ │ │ ├── pipeline.py
│ │ │ └── runs.py
│ │ ├── core/
│ │ │ ├── config.py
│ │ │ └── logging.py
│ │ ├── db/
│ │ │ ├── base.py
│ │ │ └── session.py
│ │ ├── evaluators/
│ │ │ ├── base.py
│ │ │ ├── factory.py
│ │ │ ├── heuristics.py
│ │ │ ├── huggingface.py
│ │ │ ├── mock.py
│ │ │ ├── ollama.py
│ │ │ └── openai_evaluator.py
│ │ ├── generators/
│ │ │ ├── dataset_generator.py
│ │ │ └── template_library.py
│ │ ├── improvement/
│ │ │ └── rewriter.py
│ │ ├── models/
│ │ │ ├── base.py
│ │ │ ├── dataset.py
│ │ │ ├── evaluation.py
│ │ │ ├── improvement.py
│ │ │ ├── metrics.py
│ │ │ ├── prompt.py
│ │ │ └── score.py
│ │ ├── monitoring/
│ │ │ └── aggregator.py
│ │ ├── schemas/
│ │ │ ├── common.py
│ │ │ ├── dataset.py
│ │ │ ├── evaluation.py
│ │ │ ├── improvement.py
│ │ │ ├── metrics.py
│ │ │ └── scoring.py
│ │ ├── scoring/
│ │ │ └── quality.py
│ │ ├── services/
│ │ │ ├── cleaning_service.py
│ │ │ ├── evaluation_service.py
│ │ │ ├── generation_service.py
│ │ │ ├── improvement_service.py
│ │ │ └── scoring_service.py
│ │ ├── utils/
│ │ │ ├── artifacts.py
│ │ │ ├── categories.py
│ │ │ ├── ids.py
│ │ │ ├── similarity.py
│ │ │ ├── text.py
│ │ │ └── time.py
│ │ └── main.py
│ ├── requirements.txt
│ └── tests/
│ ├── conftest.py
│ ├── test_api.py
│ ├── test_generation.py
│ └── test_pipeline_services.py
├── data/
│ ├── cleaned/
│ │ └── sample_dataset.json
│ ├── generated/
│ │ └── sample_dataset.json
│ ├── raw/
│ │ └── seed_templates.json
│ └── scored/
│ └── sample_dataset.json
├── evaluation/
│ ├── charts/
│ │ └── sample_quality_by_category.svg
│ ├── sample_metrics.json
│ └── sample_run.json
├── logs/
└── notebooks/
└── demo_pipeline.py
E.D.E.N. centers on a continuous refinement loop:
generate -> clean -> score -> evaluate -> improve -> track -> repeat
- Uses seeded category templates and deterministic randomness
- Supports categories like coding, reasoning, summarization, explanation, factual QA, instruction following, safety-sensitive refusal, and structured output
- Can optionally add LLM-assisted flavoring
- normalizes whitespace and punctuation
- removes exact duplicates
- removes semantic near-duplicates
- flags low-information prompts
- auto-categorizes missing categories with keyword rules
Each prompt receives a transparent quality score:
quality_score =
0.20 * clarity +
0.15 * specificity +
0.15 * usefulness +
0.15 * inverse_ambiguity +
0.15 * diversity_contribution +
0.10 * category_fit +
0.10 * semantic_novelty
Additional auxiliary signal:
- lexical complexity
Evaluates active prompts against:
mockbackend for local demos and tests- OpenAI API backend
- Ollama local backend
- Hugging Face local backend
Tracked metrics include:
- latency
- response length
- failure rate
- structured output validity
- expected-behavior overlap
- refusal correctness
- repeat-run consistency
Weak prompts are automatically analyzed and rewritten when:
- clarity is weak
- specificity is weak
- category fit is weak
- diversity contribution is low
- expected behavior metadata is weak
- models show low discriminative spread on the prompt
Improved prompts are rescored before adoption. E.D.E.N. preserves:
- original prompt item
- improved prompt version
- score before and after
- improvement analysis and action type
Template-backed dataset generation with seeded variations and portable prompt schemas.
Normalization, exact dedup, semantic dedup, and low-information filtering.
Transparent heuristics for prompt quality breakdowns and explanations.
Backend abstraction for model evaluation across local and hosted options.
Repeated-run benchmarking, heuristic response evaluation, and per-model aggregate metrics.
Deterministic prompt rewriting logic focused on practical data quality weaknesses.
Dataset metrics, model metrics, and time-based metric snapshots for trend tracking.
E.D.E.N. is intentionally practical rather than claiming a formal benchmark suite.
- response completeness
- response length appropriateness
- JSON validity for structured output tasks
- refusal correctness for safety-sensitive tasks
- overlap with expected behavior metadata
- consistency across repeated runs
- heuristic quality is not a substitute for human evaluation
- semantic similarity depends on local model availability and may fall back to TF-IDF
- OpenAI and Ollama integrations require environment setup outside the repo
- category-fit logic is intentionally simple and interpretable
- Recommended: Python 3.11 or 3.12
- Supported for the core backend: Python 3.14
If you are on Python 3.14+, the base API still installs cleanly, but two version details matter:
- use
pydantic>=2.12, because official initial Python 3.14 support landed in Pydantic2.12.0 - use a recent SQLAlchemy 2.0 release on Python 3.14; older pins such as
2.0.37can hit ORM annotation issues - install local Hugging Face and sentence-transformer support separately, because older
torchpins do not publish wheels for Python 3.14
cd backend
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtInstall this only if you want local sentence embeddings or the Hugging Face evaluator:
pip install -r requirements-local-models.txtcp .env.example .envSet optional keys if needed:
EDEN_OPENAI_API_KEYEDEN_OLLAMA_BASE_URLEDEN_OLLAMA_MODELEDEN_HF_MODEL
cd backend
uvicorn app.main:app --reload --reload-dir appIf your virtual environment lives inside backend/.venv, restricting reloads to app/ avoids noisy restarts caused by file changes inside site-packages.
Open:
- API docs: http://localhost:8000/docs
- Health check: http://localhost:8000/health
POST /generate-datasetPOST /cleanPOST /scorePOST /evaluatePOST /improveGET /metricsGET /datasetsGET /datasets/{dataset_id}GET /runsGET /health
curl -X POST http://localhost:8000/generate-dataset \
-H "Content-Type: application/json" \
-d '{
"dataset_name": "benchmark-v1",
"description": "Prompt benchmark for LLM evaluation",
"num_items": 24,
"seed": 42,
"llm_assisted": false
}'Example response:
{
"dataset_id": "0d56eebd-6d92-4757-a2f3-44cc46a8477c",
"dataset_name": "benchmark-v1",
"status": "generated",
"item_count": 24,
"artifacts": ["data/generated/0d56eebd-6d92-4757-a2f3-44cc46a8477c.json"],
"message": "Dataset generated successfully."
}curl -X POST http://localhost:8000/clean \
-H "Content-Type: application/json" \
-d '{
"dataset_id": "0d56eebd-6d92-4757-a2f3-44cc46a8477c",
"semantic_threshold": 0.92,
"remove_low_information": true
}'curl -X POST http://localhost:8000/score \
-H "Content-Type: application/json" \
-d '{
"dataset_id": "0d56eebd-6d92-4757-a2f3-44cc46a8477c"
}'curl -X POST http://localhost:8000/evaluate \
-H "Content-Type: application/json" \
-d '{
"dataset_id": "0d56eebd-6d92-4757-a2f3-44cc46a8477c",
"repeats": 2,
"models": [
{"backend": "mock", "model_name": "eden-mock-001"},
{"backend": "ollama", "model_name": "llama3.2"}
]
}'curl -X POST http://localhost:8000/improve \
-H "Content-Type: application/json" \
-d '{
"dataset_id": "0d56eebd-6d92-4757-a2f3-44cc46a8477c",
"quality_threshold": 0.62,
"max_candidates": 10
}'| Metric | Value |
|---|---|
| Average quality score | 0.7542 |
| Duplicate rate | 0.25 |
| Average mock latency | 15.2 ms |
| Average heuristic quality | 0.792 |
| Category | Quality Score |
|---|---|
| coding | 0.7995 |
| structured_output | 0.7610 |
| safety_sensitive_refusal | 0.7021 |
A runnable walkthrough lives at notebooks/demo_pipeline.py.
It performs:
- dataset generation
- cleaning
- scoring
- evaluation across mock models
- improvement
- metrics snapshot creation
- chart generation under
evaluation/charts/
Run it with:
python notebooks/demo_pipeline.pySQLite stores:
- datasets
- prompt items
- quality scores
- evaluation runs
- model outputs
- improvement records
- metric snapshots
This provides:
- reproducible local experiments
- prompt version history
- time-based metrics
- model comparison history
- modular service-oriented backend structure
- typed Pydantic schemas
- SQLAlchemy ORM persistence
- environment-based configuration
- explicit artifact exports for reproducibility
- deterministic generation seeds
- transparent scoring heuristics
- runnable demo workflow
- basic tests for core modules
From the backend/ directory:
pytestCoverage currently focuses on:
- template generation
- cleaning behavior
- scoring behavior
- prompt improvement
- API health check
- add human annotation and review queues
- support richer expected-output schemas
- add calibration and evaluator disagreement analysis
- add richer prompt discriminative power metrics across models
- support experiment tags and dashboarding for multi-dataset comparisons
- add background job execution for larger evaluation runs
- scoring is heuristic and intentionally interpretable, not a learned reward model
- the default
mockevaluator is for local testing, not benchmark realism - Hugging Face generation can be slow on CPU-only environments
- large sentence-transformer models may require a one-time download
- no frontend is included beyond FastAPI docs by design