Skip to content

distill::synthetic

More...

Classes

Name
class distill::synthetic::SyntheticDataGenerator

Attributes

Name
int QUALITY_MIN_CHARS
list REFUSAL_PATTERNS
parser
required
True
help
args
project_root
loader
cfg
system_prompt
user_prompts
client
generator
samples

Detailed Description

Synthetic data generation using multi-backend cascade-capable teacher models.```



## Attributes Documentation

### variable QUALITY_MIN_CHARS

```python
int QUALITY_MIN_CHARS =  200;

variable REFUSAL_PATTERNS

list REFUSAL_PATTERNS =  [
    r"\bI cannot\b",
    r"\bI['\u2019]m unable\b",
    r"\bas an AI\b",
    r"\bI don['\u2019]t have\b",
    r"\bI do not have\b",
    r"\bI am not able\b",
    r"\bI['\u2019]m not able\b",
    r"\bsorry.*cannot\b",
    r"\bcan['\u2019]t (?:help|assist|do that|generate|create|provide)\b",
];

variable parser

parser =  argparse.ArgumentParser(description="Generate synthetic data for a specialist niche");

variable required

required;

variable True

True;

variable help

help;

variable args

args =  parser.parse_args();

variable project_root

project_root =  Path(__file__).resolve().parent.parent;

variable loader

loader =  ConfigLoader(project_root);

variable cfg

cfg =  loader.get_effective_config(args.niche);

variable system_prompt

system_prompt =  cfg.get("system_prompt", f"You are a {args.niche} specialist.");

variable user_prompts

user_prompts =  cfg.get("synthetic_prompts", [f"Explain {args.niche} concepts in detail."]);

variable client

client =  TeacherClient(project_root);

variable generator

generator =  SyntheticDataGenerator(client, project_root, use_cascade=True);

variable samples

samples =  generator.generate_for_niche(args.niche, system_prompt, user_prompts);

Updated on 2026-07-25 at 22:56:57 +0000