Add ModelNames class for model name constants
Browse files- config/chain_configs.py +27 -18
config/chain_configs.py
CHANGED
|
@@ -26,13 +26,22 @@ from config.llm_config import llms
|
|
| 26 |
|
| 27 |
# Note: The default LLM here is GPT-4o (low temp); the UI can override this choice.
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
chain_configs = {
|
| 30 |
"diagnoser": {
|
| 31 |
"class": DiagnoserChain,
|
| 32 |
"template_standardize": template_standardize_exercise,
|
| 33 |
-
"llm_standardize": llms[
|
| 34 |
-
"llm_4o_mini": llms[
|
| 35 |
-
"llm_4o": llms[
|
| 36 |
# 4 different diagnosis templates (to run in parallel:
|
| 37 |
"templates_diagnose": [
|
| 38 |
template_diagnose_double_negation,
|
|
@@ -41,44 +50,44 @@ chain_configs = {
|
|
| 41 |
template_diagnose_distractor_partially_correct,
|
| 42 |
],
|
| 43 |
"template_diagnose_scorecard": diagnose_scorecard_template,
|
| 44 |
-
"llm_diagnose": llms[
|
| 45 |
},
|
| 46 |
"distractors": {
|
| 47 |
"class": DistractorsChain,
|
| 48 |
"template_standardize": template_standardize_exercise,
|
| 49 |
-
"llm_standardize": llms[
|
| 50 |
"template_distractors_brainstorm_1": template_distractors_brainstorm_1,
|
| 51 |
"template_distractors_brainstorm_2": template_distractors_brainstorm_2,
|
| 52 |
-
"llm_brainstorm_1": llms[
|
| 53 |
-
"llm_brainstorm_2": llms[
|
| 54 |
"template_consolidate": template_consolidate_distractors,
|
| 55 |
-
"llm_consolidate": llms[
|
| 56 |
},
|
| 57 |
"learning_objectives": {
|
| 58 |
"class": LearningObjectivesChain,
|
| 59 |
"template_standardize": template_standardize_studytext,
|
| 60 |
-
"llm_standardize": llms[
|
| 61 |
"template_gen_prompt_a": template_gen_prompt_a,
|
| 62 |
"template_gen_prompt_b": template_gen_prompt_b,
|
| 63 |
-
"default_llm_a": llms[
|
| 64 |
-
"default_llm_b": llms[
|
| 65 |
"template_sanitize": template_sanitize_learning_objectives,
|
| 66 |
-
"llm_sanitize":
|
| 67 |
},
|
| 68 |
"fluster": {
|
| 69 |
"class": FlusterWritingChain,
|
| 70 |
"template_write_fluster_a": template_write_fluster_a,
|
| 71 |
"template_write_fluster_b": template_write_fluster_b,
|
| 72 |
-
"default_llm_a": llms[
|
| 73 |
-
"default_llm_b": llms[
|
| 74 |
# Prompt & LLM for the refine-distractors step
|
| 75 |
"template_refine_fluster": template_refine_fluster,
|
| 76 |
-
"llm_refine": llms[
|
| 77 |
"template_sanitize": template_sanitize_fluster,
|
| 78 |
-
"llm_sanitize":
|
| 79 |
"template_structurize": template_isolate_exercises,
|
| 80 |
-
"llm_structurize": llms[
|
| 81 |
"template_fix_exercise": template_fix_exercise,
|
| 82 |
-
"llm_fix_exercise": llms[
|
| 83 |
},
|
| 84 |
}
|
|
|
|
| 26 |
|
| 27 |
# Note: The default LLM here is GPT-4o (low temp); the UI can override this choice.
|
| 28 |
|
| 29 |
+
# Model name constants - these match the keys in llm_config.llms
|
| 30 |
+
class ModelNames:
|
| 31 |
+
GPT4_ZERO = "GPT-4o (zero temp)"
|
| 32 |
+
GPT4_LOW = "GPT-4o (low temp)"
|
| 33 |
+
GPT4_MID = "GPT-4o (mid temp)"
|
| 34 |
+
GPT4_MINI_ZERO = "GPT-4o-mini (zero temp)"
|
| 35 |
+
O1_HIGH_REASONING = "o1 (high reasoning_effort)"
|
| 36 |
+
O3_MINI_HIGH_REASONING = "o3-mini (high reasoning_effort)"
|
| 37 |
+
|
| 38 |
chain_configs = {
|
| 39 |
"diagnoser": {
|
| 40 |
"class": DiagnoserChain,
|
| 41 |
"template_standardize": template_standardize_exercise,
|
| 42 |
+
"llm_standardize": llms[ModelNames.GPT4_MINI_ZERO], # Always fixed
|
| 43 |
+
"llm_4o_mini": llms[ModelNames.GPT4_LOW],
|
| 44 |
+
"llm_4o": llms[ModelNames.GPT4_LOW],
|
| 45 |
# 4 different diagnosis templates (to run in parallel:
|
| 46 |
"templates_diagnose": [
|
| 47 |
template_diagnose_double_negation,
|
|
|
|
| 50 |
template_diagnose_distractor_partially_correct,
|
| 51 |
],
|
| 52 |
"template_diagnose_scorecard": diagnose_scorecard_template,
|
| 53 |
+
"llm_diagnose": llms[ModelNames.GPT4_LOW], # Default; can be replaced in UI
|
| 54 |
},
|
| 55 |
"distractors": {
|
| 56 |
"class": DistractorsChain,
|
| 57 |
"template_standardize": template_standardize_exercise,
|
| 58 |
+
"llm_standardize": llms[ModelNames.GPT4_MINI_ZERO], # Always fixed
|
| 59 |
"template_distractors_brainstorm_1": template_distractors_brainstorm_1,
|
| 60 |
"template_distractors_brainstorm_2": template_distractors_brainstorm_2,
|
| 61 |
+
"llm_brainstorm_1": llms[ModelNames.GPT4_LOW],
|
| 62 |
+
"llm_brainstorm_2": llms[ModelNames.GPT4_MID],
|
| 63 |
"template_consolidate": template_consolidate_distractors,
|
| 64 |
+
"llm_consolidate": llms[ModelNames.GPT4_LOW],
|
| 65 |
},
|
| 66 |
"learning_objectives": {
|
| 67 |
"class": LearningObjectivesChain,
|
| 68 |
"template_standardize": template_standardize_studytext,
|
| 69 |
+
"llm_standardize": llms[ModelNames.GPT4_MINI_ZERO], # Always fixed
|
| 70 |
"template_gen_prompt_a": template_gen_prompt_a,
|
| 71 |
"template_gen_prompt_b": template_gen_prompt_b,
|
| 72 |
+
"default_llm_a": llms[ModelNames.O1_HIGH_REASONING],
|
| 73 |
+
"default_llm_b": llms[ModelNames.O3_MINI_HIGH_REASONING],
|
| 74 |
"template_sanitize": template_sanitize_learning_objectives,
|
| 75 |
+
"llm_sanitize": ModelNames.GPT4_MINI_ZERO,
|
| 76 |
},
|
| 77 |
"fluster": {
|
| 78 |
"class": FlusterWritingChain,
|
| 79 |
"template_write_fluster_a": template_write_fluster_a,
|
| 80 |
"template_write_fluster_b": template_write_fluster_b,
|
| 81 |
+
"default_llm_a": llms[ModelNames.O1_HIGH_REASONING],
|
| 82 |
+
"default_llm_b": llms[ModelNames.O3_MINI_HIGH_REASONING],
|
| 83 |
# Prompt & LLM for the refine-distractors step
|
| 84 |
"template_refine_fluster": template_refine_fluster,
|
| 85 |
+
"llm_refine": llms[ModelNames.GPT4_ZERO],
|
| 86 |
"template_sanitize": template_sanitize_fluster,
|
| 87 |
+
"llm_sanitize": ModelNames.GPT4_MINI_ZERO,
|
| 88 |
"template_structurize": template_isolate_exercises,
|
| 89 |
+
"llm_structurize": llms[ModelNames.GPT4_ZERO],
|
| 90 |
"template_fix_exercise": template_fix_exercise,
|
| 91 |
+
"llm_fix_exercise": llms[ModelNames.GPT4_LOW],
|
| 92 |
},
|
| 93 |
}
|