11"""Model-specific adaptors — tailored instructions per LLM provider.
22
33Each provider has different strengths. We optimize prompt style accordingly:
4- - Gemini Flash: fast, good at structured output with concise prompts
5- - Cerebras Llama: needs explicit format examples, simpler vocabulary
6- - Anthropic Haiku: benefits from chain-of-thought permission
7- - Anthropic Sonnet: full reasoning freedom, comprehensive analysis
4+ - DeepSeek V3: strong structured output, good reasoning, cost-effective
5+ - Gemini Flash: fast, good at concise responses
6+ - NVIDIA Nemotron: free tier, needs explicit format guidance
7+ - Anthropic Haiku: excellent tool calling, chain-of-thought
88"""
99
1010MODEL_ADAPTORS = {
1111 "pool-a" : {
12- "gemini_flash " : """## Response Style (Gemini Flash )
12+ "deepseek " : """## Response Style (DeepSeek — Efficient )
1313- Be concise: respond in under 150 words unless detailed analysis is explicitly requested
1414- When using tools, summarize results in 2-3 sentences
1515- For structured output, use exact JSON format — no markdown wrapping
1616- Prefer bullet points over paragraphs
1717- Include well IDs and numeric values, skip verbose explanations
1818- Example anomaly summary: "AUH-01-003: debit declined 32% (12.1→8.2 L/s). Recommend pump inspection."
1919""" ,
20- "cerebras_llama" : """## Response Style (Llama)
21- - Use clear, simple language. Avoid complex nested sentences.
22- - When returning structured data, follow this exact format:
23- ```json
24- {"type": "anomaly_card", "severity": "high", "well_id": "AUH-01-003", ...}
25- ```
26- - Always state findings before recommendations
27- - List items with numbered steps: 1. Finding, 2. Cause, 3. Action
28- - When uncertain, say "Based on available data..." rather than speculating
29- - Keep responses under 200 words for simple queries
20+ "gemini_flash" : """## Response Style (Gemini Flash — Concise)
21+ - Be very concise: under 100 words for simple queries
22+ - Use bullet points, not paragraphs
23+ - Include well IDs and numeric values with units
24+ - For structured output, return exact JSON — no wrapping
3025""" ,
3126 },
32- "pool-b" : """## Response Style (Haiku — Analytical)
27+ "pool-b" : """## Response Style (Analytical)
3328- Think step by step before concluding. Consider multiple hypotheses.
3429- Structure your analysis:
3530 1. Observation: what the data shows
4136- Compare with neighboring wells when relevant
4237- Cite specific values and well IDs throughout
4338""" ,
44- "pool-b-upgrade" : """## Response Style (Sonnet — Comprehensive)
39+ "pool-b-upgrade" : """## Response Style (Comprehensive Analysis )
4540- Provide comprehensive analysis with evidence and reasoning
4641- You have full freedom to reason at length — use it for complex cases
4742- Consider geological, operational, and seasonal factors holistically
@@ -63,7 +58,7 @@ def get_model_adaptor(model_pool: str, model_name: str = "") -> str:
6358 """Get the appropriate model adaptor text for a model pool."""
6459 adaptor = MODEL_ADAPTORS .get (model_pool , "" )
6560 if isinstance (adaptor , dict ):
66- if "cerebras" in model_name or "llama " in model_name :
67- return adaptor .get ("cerebras_llama " , list (adaptor .values ())[0 ])
68- return adaptor .get ("gemini_flash " , list (adaptor .values ())[0 ])
61+ if "gemini " in model_name :
62+ return adaptor .get ("gemini_flash " , list (adaptor .values ())[0 ])
63+ return adaptor .get ("deepseek " , list (adaptor .values ())[0 ])
6964 return adaptor
0 commit comments