Skip to content

Commit 8a2fd55

Browse files
authored
Iris: Centralize LLM model configuration and selection (#496)
1 parent bc2ae08 commit 8a2fd55

75 files changed

Lines changed: 1576 additions & 2150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

iris/COURSE_CHAT_PIPELINE_REFACTORING.md

Lines changed: 0 additions & 622 deletions
This file was deleted.

iris/README.MD renamed to iris/README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ their programming exercises on Artemis in a pedagogically meaningful way.
193193
- `api_key`: The API key for the model.
194194
- `description`: Additional information about the model.
195195
- `id`: Unique identifier for the model across all models.
196-
- `model`: The official name of the model as used by the vendor, also used by ModelVersionRequestHandler for model selection (e.g., "gpt-4.1", "gpt-4.1-mini").
196+
- `model`: The official name of the model as used by the vendor (e.g., "gpt-4.1", "gpt-4.1-mini").
197197
- `name`: A custom, human-readable name for the model.
198198
- `type`: The model type, used to select the appropriate client (e.g., `openai_chat`, `azure_chat`, `ollama`).
199199
- `endpoint`: The URL to connect to the model.
@@ -386,6 +386,45 @@ Deploying Pyris using Docker ensures a consistent environment and simplifies the
386386

387387
Modify configuration files as needed:
388388
- **Pyris Configuration**: Update `application.yml` and `llm_config.yml`.
389+
- `application.yml` must include an `llm_configuration` section that maps pipeline `implementation_id`s to variant IDs and roles with `local`/`cloud` LLM IDs (matching `llm_config.yml` `id`). Use `application.example.yml` as a template.
390+
- Bulk-replace an LLM ID across all `llm_configuration` entries:
391+
392+
```bash
393+
# adjust these three values
394+
export APP_YML=application.yml
395+
export OLD_MODEL=gpt-4.1-mini
396+
export NEW_MODEL=gpt-4o-mini
397+
398+
python - <<'PY'
399+
import os
400+
import pathlib
401+
import yaml
402+
403+
path = pathlib.Path(os.environ["APP_YML"])
404+
old = os.environ["OLD_MODEL"]
405+
new = os.environ["NEW_MODEL"]
406+
407+
data = yaml.safe_load(path.read_text(encoding="utf-8"))
408+
llm_cfg = data.get("llm_configuration", {})
409+
410+
def walk(node):
411+
if isinstance(node, dict):
412+
return {k: walk(v) for k, v in node.items()}
413+
if isinstance(node, list):
414+
return [walk(v) for v in node]
415+
if isinstance(node, str) and node == old:
416+
return new
417+
return node
418+
419+
data["llm_configuration"] = walk(llm_cfg)
420+
path.write_text(
421+
yaml.safe_dump(data, sort_keys=False, allow_unicode=True),
422+
encoding="utf-8",
423+
)
424+
print(f"Replaced {old} -> {new} in {path}")
425+
PY
426+
```
427+
389428
- **Weaviate Configuration**: Adjust settings in `weaviate.yml`.
390429
- **Nginx Configuration**: Modify Nginx settings in `nginx.yml` and related config files.
391430

iris/application.example.yml

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ weaviate:
99
memiris:
1010
enabled: true
1111
sleep_enabled: true
12+
llm_configuration:
13+
embeddings:
14+
- mxbai-embed-large
15+
- nomic-embed-text
16+
learning_extractor:
17+
local: gemma3
18+
cloud: gemma3
19+
learning_deduplicator:
20+
local: gemma3
21+
cloud: gemma3
22+
memory_creator:
23+
local: gpt-oss
24+
cloud: gpt-oss
25+
sleep_tool_llm:
26+
local: gpt-oss
27+
cloud: gpt-oss
28+
sleep_json_llm:
29+
local: gemma3
30+
cloud: gemma3
31+
32+
local_llm_enabled: true # Set to false to disable local LLM support entirely
1233

1334
langfuse:
1435
enabled: false # Set to true to enable LangFuse tracing
@@ -30,3 +51,223 @@ transcription:
3051

3152
env_vars:
3253
SOME: "value"
54+
55+
# Values are LLM entry IDs (the "id" field in llm_config.yml).
56+
llm_configuration:
57+
exercise_chat_pipeline:
58+
default:
59+
chat:
60+
local: oai-gpt-5-mini
61+
cloud: oai-gpt-5-mini
62+
advanced:
63+
chat:
64+
local: oai-gpt-52
65+
cloud: oai-gpt-52
66+
67+
course_chat_pipeline:
68+
default:
69+
chat:
70+
local: oai-gpt-5-mini
71+
cloud: oai-gpt-5-mini
72+
advanced:
73+
chat:
74+
local: oai-gpt-52
75+
cloud: oai-gpt-52
76+
77+
lecture_chat_pipeline:
78+
default:
79+
chat:
80+
local: oai-gpt-5-mini
81+
cloud: oai-gpt-5-mini
82+
advanced:
83+
chat:
84+
local: oai-gpt-52
85+
cloud: oai-gpt-52
86+
87+
text_exercise_chat_pipeline:
88+
default:
89+
chat:
90+
local: oai-gpt-5-mini
91+
cloud: oai-gpt-5-mini
92+
advanced:
93+
chat:
94+
local: oai-gpt-52
95+
cloud: oai-gpt-52
96+
97+
autonomous_tutor_pipeline:
98+
default:
99+
chat:
100+
local: gpt-oss
101+
cloud: oai-gpt-5-mini
102+
103+
tutor_suggestion_pipeline:
104+
default:
105+
chat:
106+
local: oai-gpt-5-mini
107+
cloud: oai-gpt-5-mini
108+
advanced:
109+
chat:
110+
local: oai-gpt-52
111+
cloud: oai-gpt-52
112+
113+
competency_extraction_pipeline:
114+
default:
115+
chat:
116+
local: oai-gpt-52
117+
cloud: oai-gpt-52
118+
119+
inconsistency_check_pipeline:
120+
default:
121+
solver:
122+
local: oai-gpt-5-mini
123+
cloud: oai-gpt-5-mini
124+
prettify:
125+
local: oai-gpt-5-mini
126+
cloud: oai-gpt-5-mini
127+
128+
rewriting_pipeline:
129+
faq:
130+
rewriting:
131+
local: oai-gpt-52
132+
cloud: oai-gpt-52
133+
consistency:
134+
local: oai-gpt-52
135+
cloud: oai-gpt-52
136+
problem_statement:
137+
rewriting:
138+
local: oai-gpt-52
139+
cloud: oai-gpt-52
140+
consistency:
141+
local: oai-gpt-52
142+
cloud: oai-gpt-52
143+
144+
lecture_unit_page_ingestion_pipeline:
145+
default:
146+
chat:
147+
local: oai-gpt-5-mini
148+
cloud: oai-gpt-5-mini
149+
embedding: oai-embedding-small
150+
advanced:
151+
chat:
152+
local: oai-gpt-52
153+
cloud: oai-gpt-52
154+
embedding: azure-embedding-large
155+
156+
faq_ingestion_pipeline:
157+
default:
158+
chat:
159+
local: oai-gpt-5-mini
160+
cloud: oai-gpt-5-mini
161+
embedding: oai-embedding-small
162+
163+
transcription_ingestion_pipeline:
164+
default:
165+
chat:
166+
local: oai-gpt-5-mini
167+
cloud: oai-gpt-5-mini
168+
embedding: oai-embedding-small
169+
170+
lecture_unit_segment_summary_pipeline:
171+
default:
172+
chat:
173+
local: oai-gpt-5-mini
174+
cloud: oai-gpt-5-mini
175+
embedding: oai-embedding-small
176+
177+
lecture_unit_summary_pipeline:
178+
default:
179+
chat:
180+
local: oai-gpt-5-mini
181+
cloud: oai-gpt-5-mini
182+
183+
lecture_unit_pipeline:
184+
default:
185+
embedding: oai-embedding-small
186+
187+
lecture_retrieval_pipeline:
188+
default:
189+
chat:
190+
local: oai-gpt-5-mini
191+
cloud: oai-gpt-5-mini
192+
embedding: oai-embedding-small
193+
reranker: cohere
194+
195+
lecture_unit_segment_retrieval_pipeline:
196+
default:
197+
chat:
198+
local: oai-gpt-5-mini
199+
cloud: oai-gpt-5-mini
200+
embedding: oai-embedding-small
201+
reranker: cohere
202+
203+
lecture_transcriptions_retrieval_pipeline:
204+
default:
205+
chat:
206+
local: oai-gpt-5-mini
207+
cloud: oai-gpt-5-mini
208+
embedding: oai-embedding-small
209+
reranker: cohere
210+
211+
faq_retrieval_pipeline:
212+
default:
213+
chat:
214+
local: oai-gpt-5-mini
215+
cloud: oai-gpt-5-mini
216+
embedding: oai-embedding-small
217+
218+
citation_pipeline:
219+
default:
220+
chat:
221+
local: oai-gpt-5-mini
222+
cloud: oai-gpt-5-nano
223+
keyword_summary:
224+
local: oai-gpt-5-nano
225+
cloud: oai-gpt-5-nano
226+
advanced:
227+
chat:
228+
local: oai-gpt-5-mini
229+
cloud: oai-gpt-5-mini
230+
231+
interaction_suggestion_pipeline:
232+
course:
233+
chat:
234+
local: oai-gpt-5-mini
235+
cloud: oai-gpt-5-nano
236+
exercise:
237+
chat:
238+
local: oai-gpt-5-mini
239+
cloud: oai-gpt-5-nano
240+
241+
session_title_generation_pipeline:
242+
default:
243+
chat:
244+
local: oai-gpt-5-mini
245+
cloud: oai-gpt-5-nano
246+
247+
code_feedback_pipeline:
248+
default:
249+
chat:
250+
local: oai-gpt-5-mini
251+
cloud: oai-gpt-5-mini
252+
253+
summary_pipeline:
254+
default:
255+
chat:
256+
local: oai-gpt-5-mini
257+
cloud: oai-gpt-5-nano
258+
259+
lecture_search_answer_pipeline:
260+
default:
261+
hyde:
262+
local: gpt-oss
263+
cloud: oai-gpt-5-nano
264+
answer:
265+
local: gpt-oss
266+
cloud: oai-gpt-5-mini
267+
embedding: oai-embedding-small
268+
269+
mcq_generation_pipeline:
270+
default:
271+
chat:
272+
local: gpt-oss
273+
cloud: oai-gpt-5-nano

0 commit comments

Comments
 (0)