3030CLAUDE_MODELS : dict [str , str ] = {
3131 "Opus 5" : "claude-opus-5" ,
3232 "Opus 4.8" : "claude-opus-4-8" ,
33+ "Fable 5.1" : "claude-fable-5-1" ,
3334 "Fable 5" : "claude-fable-5" ,
3435 "Sonnet 5" : "claude-sonnet-5" ,
3536 "Opus 4.7" : "claude-opus-4-7" ,
4344# Models that use the newer "adaptive" thinking mode (Opus 4.7+ require it; older models keep the explicit budget API).
4445# Anthropic decides the actual budget when adaptive is used, based on the `output_config.effort` hint.
4546_ADAPTIVE_THINKING_MODELS = {"Opus 4.8" , "Sonnet 5" , "Opus 4.7" , "Opus 4.6" , "Sonnet 4.6" }
46- _ALWAYS_THINKING_MODELS = {"Opus 5" , "Fable 5" }
47+ _ALWAYS_THINKING_MODELS = {"Opus 5" , "Fable 5.1" , "Fable 5" }
48+ _XHIGH_EFFORT_MODELS = {"Opus 5" , "Opus 4.8" , "Fable 5.1" , "Fable 5" , "Sonnet 5" , "Opus 4.7" }
49+ _MAX_EFFORT_MODELS = _XHIGH_EFFORT_MODELS | {"Opus 4.6" , "Sonnet 4.6" }
4750_EXPLICIT_THINKING_OFF_MODELS = {"Sonnet 5" }
48- _NO_TEMPERATURE_MODELS = {"Opus 5" , "Opus 4.8" , "Fable 5" , "Sonnet 5" }
51+ _NO_TEMPERATURE_MODELS = {"Opus 5" , "Opus 4.8" , "Fable 5.1" , "Fable 5 " , "Sonnet 5" }
4952
5053# Budget mode (Sonnet 4.5): effort -> reasoning budget in tokens. Must be < max_tokens.
5154# Sized so even the "high" budget fits comfortably under the default max_tokens=32768.
5760_REASONING_EFFORTS = ["off" , "low" , "medium" , "high" ]
5861
5962
63+ def _reasoning_effort_options (model_label : str ) -> list [str ]:
64+ options = list (_REASONING_EFFORTS )
65+ if model_label in _ALWAYS_THINKING_MODELS :
66+ options .remove ("off" )
67+ if model_label in _XHIGH_EFFORT_MODELS :
68+ options .append ("xhigh" )
69+ if model_label in _MAX_EFFORT_MODELS :
70+ options .append ("max" )
71+ return options
72+
73+
6074def _claude_model_inputs (model_label : str ):
6175 inputs : list = [
6276 IO .Int .Input (
@@ -87,7 +101,7 @@ def _claude_model_inputs(model_label: str):
87101 inputs .append (
88102 IO .Combo .Input (
89103 "reasoning_effort" ,
90- options = [ e for e in _REASONING_EFFORTS if e != "off" ] ,
104+ options = _reasoning_effort_options ( model_label ) ,
91105 default = "high" ,
92106 tooltip = "Extended thinking effort. Reasoning is always enabled for this model." ,
93107 advanced = True ,
@@ -97,7 +111,7 @@ def _claude_model_inputs(model_label: str):
97111 inputs .append (
98112 IO .Combo .Input (
99113 "reasoning_effort" ,
100- options = _REASONING_EFFORTS ,
114+ options = _reasoning_effort_options ( model_label ) ,
101115 default = "off" ,
102116 tooltip = "Extended thinking effort. 'off' disables reasoning." ,
103117 advanced = True ,
0 commit comments