Skip to content

Llm migration - #322

Merged
adamjohnwright merged 5 commits into
mainfrom
llm-migration
Nov 9, 2026
Merged

adamjohnwright merged 5 commits into
mainfrom
llm-migration

Conversation

@heliamoh

@heliamoh heliamoh commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Current OpenAI models, including gpt-6-luna (the new default), accept only their own default temperature and take a reasoning effort instead. previously, the chatbot sent every call a temperature from a hand-maintained table of models, and sent 0.0 to any model not in it.

This PR stops sending a temperature to OpenAI models and sends a reasoning effort instead: low for the steps before the answer, medium for the answer. It also checks those settings against the API at startup, so a bad configuration fails the deploy, not a user.

What changed

What each model call sends (src/agent/graph.py, src/agent/models.py)

  • OpenAI calls send no temperature. Rephrasing, the safety check, language detection, intent classification, query expansion and grading send reasoning effort low. The final answer generation LLM runs with reasoning_effort set to medium.
  • Ollama is unchanged: it gets a temperature and no reasoning effort.
  • Removed the temperature table, resolve_temperature and bin/probe_model_temperature. They describe behaviour that no longer exists.
  • get_llm now requires the decided parameters and no longer defaults to 0.0, so code that skips the shared decision fails type checking.

Startup check

  • Before the BM25 build, the server sends the model one request with exactly the settings its calls will use. If the API rejects them, startup stops with the API's error and a suggested fix.
  • Why ask the API: which levels a model accepts varies by model. gpt-4o and gpt-4.1 accept none, and chat-latest accepts only medium. Asking the API avoids keeping another table by hand.
  • Startup also refuses a temperature set for OpenAI (in config.yml or LLM_TEMPERATURE) and a reasoning effort set for Ollama.

Configuration

  • New optional keys in config.yml: llm.reasoning_effort (default low) and llm.answer_reasoning_effort (default medium).
  • .config.schema.yaml, config_default.yml and the env templates are updated to match.

Answer calls

  • The chat profiles now get two copies of the same model, one at each effort.
  • These use the answer copy: the RAG answer, the live-data tool loop, the reply to a refused question, analysis summaries, and the final summary of the parked Cross-Database profile.

Every place that builds a model now uses build_llm

  • The chat and search graph, analysis summaries, the evaluator, the routing probe and the retrieval baseline.
  • The routing probe and the answer sweep used to ignore config.yml. They now read it.

Defaults

  • Answering model: gpt-4o-mini → gpt-6-luna.
  • Evaluator judge: gpt-4o → gpt-6-astra.

Notes

  • A deployment that pins gpt-4o, gpt-4o-mini, gpt-4.1 or gpt-4.1-mini, or sets LLM_TEMPERATURE with OpenAI, will refuse to start until it is updated.
  • Startup now needs OpenAI to be reachable: one short request per process start, two at the default settings.

Example

example generated by the new LLM:

**Question: How does insulin signaling lead to GLUT4 translocation to the plasma membrane? **

**answer:** 
In adipocytes and myocytes, insulin signaling mobilizes GLUT4 (SLC2A4) from intracellular vesicles to the cell surface. Reactome describes the pathway as only partly elucidated, so some links in the sequence remain uncertain. [[Translocation of SLC2A4 (GLUT4) to the plasma membrane](https://reactome.org/content/detail/R-HSA-1445148)](https://reactome.org/content/detail/R-HSA-1445148)

1. **Insulin triggers the signaling cascade.** Insulin binding causes the insulin receptor to autophosphorylate and phosphorylate insulin receptor substrates (IRS). Phosphorylated IRS can recruit PI3K, and insulin signaling activates AKT1 and AKT2. [[Signaling by Insulin receptor](https://reactome.org/content/detail/R-HSA-74752)](https://reactome.org/content/detail/R-HSA-74752) [[Translocation of SLC2A4 (GLUT4) to the plasma membrane](https://reactome.org/content/detail/R-HSA-1445148)](https://reactome.org/content/detail/R-HSA-1445148)

2. **AKT changes the regulation of GLUT4-associated Rab proteins.** AKT2, and to a lesser extent AKT1, phosphorylates TBC1D4 (AS160) on GLUT4-associated vesicles. Phosphorylated TBC1D4 binds 14-3-3; this is associated with loss of its Rab-GTPase-activating activity. Reactome therefore describes Rab proteins—probably RAB8A, RAB10 and RAB14, and possibly RAB13—as accumulating in their GTP-bound forms. The precise connection between Rab-GTP and vesicle movement is not known in the pathway record. [[p-AKT1,p-AKT2 phosphorylates AS160 (TBC1D4)](https://reactome.org/content/detail/R-HSA-1445144)](https://reactome.org/content/detail/R-HSA-1445144) [[14-3-3 binds p-5S,T642-AS160 (TBC1D4)](https://reactome.org/content/detail/R-HSA-1445149)](https://reactome.org/content/detail/R-HSA-1445149) [[Translocation of SLC2A4 (GLUT4) to the plasma membrane](https://reactome.org/content/detail/R-HSA-1445148)](https://reactome.org/content/detail/R-HSA-1445148)

3. **Vesicles are transported and docked.** GLUT4 is carried in insulin-responsive vesicles toward the plasma membrane. Reactome describes roles for Rab-associated myosins in this movement and for docking at the membrane; some of these transport details are inferred from mouse. It also documents an insulin-responsive AKT–DENND1A/DENND1B route that promotes RAB35 activity, which contributes to GLUT4 translocation. [[SLC2A4 (GLUT4) vesicle translocates and docks at the plasma membrane](https://reactome.org/content/detail/R-HSA-2316352)](https://reactome.org/content/detail/R-HSA-2316352) [[Active AKT phosphorylates DENND1A and DENND1B in response to insulin signaling](https://reactome.org/content/detail/R-HSA-8933446)](https://reactome.org/content/detail/R-HSA-8933446)

4. **Docked vesicles fuse with the membrane.** VAMP2 on the vesicle interacts with SNAP23 and SYNTAXIN-4 (STX4) at the plasma membrane to support fusion. STXBP3 (MUNC18C) bound to STX4 prevents fusion until STXBP3 is phosphorylated. Fusion inserts GLUT4 into the plasma membrane, where it can facilitate glucose transport into the cell. [[SLC2A4 (GLUT4) vesicle fuses with the plasma membrane](https://reactome.org/content/detail/R-HSA-1449574)](https://reactome.org/content/detail/R-HSA-1449574) [[GLUT4 (SLC2A4) tetramer transports Glc from extracellular region to cytosol](https://reactome.org/content/detail/R-HSA-8981570)](https://reactome.org/content/detail/R-HSA-8981570)

**In short:** insulin signaling promotes GLUT4 vesicle delivery by changing TBC1D4 and Rab regulation, supporting vesicle transport and docking, and enabling SNARE-mediated fusion at the plasma membrane. Reactome notes that the full pathway and the link between Rab activation and vesicle movement are not completely resolved. [[Translocation of SLC2A4 (GLUT4) to the plasma membrane](https://reactome.org/content/detail/R-HSA-1445148)](https://reactome.org/content/detail/R-HSA-1445148)

## Sources
- [[Signaling by Insulin receptor](https://reactome.org/content/detail/R-HSA-74752)](https://reactome.org/content/detail/R-HSA-74752)
- [[Translocation of SLC2A4 (GLUT4) to the plasma membrane](https://reactome.org/content/detail/R-HSA-1445148)](https://reactome.org/content/detail/R-HSA-1445148)
- [[p-AKT1,p-AKT2 phosphorylates AS160 (TBC1D4)](https://reactome.org/content/detail/R-HSA-1445144)](https://reactome.org/content/detail/R-HSA-1445144)
- [[14-3-3 binds p-5S,T642-AS160 (TBC1D4)](https://reactome.org/content/detail/R-HSA-1445149)](https://reactome.org/content/detail/R-HSA-1445149)
- [[SLC2A4 (GLUT4) vesicle translocates and docks at the plasma membrane](https://reactome.org/content/detail/R-HSA-2316352)](https://reactome.org/content/detail/R-HSA-2316352)
- [[Active AKT phosphorylates DENND1A and DENND1B in response to insulin signaling](https://reactome.org/content/detail/R-HSA-8933446)](https://reactome.org/content/detail/R-HSA-8933446)
- [[SLC2A4 (GLUT4) vesicle fuses with the plasma membrane](https://reactome.org/content/detail/R-HSA-1449574)](https://reactome.org/content/detail/R-HSA-1449574)
- [[GLUT4 (SLC2A4) tetramer transports Glc from extracellular region to cytosol](https://reactome.org/content/detail/R-HSA-8981570)](https://reactome.org/content/detail/R-HSA-8981570)

@adamjohnwright
adamjohnwright merged commit 1a65b75 into main Nov 9, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the llm-migration branch November 9, 2026 21:06
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