32 lines
1.8 KiB
Python
32 lines
1.8 KiB
Python
"""Non-secret native model metadata for Responses-compatible providers."""
|
|
import hashlib
|
|
import json
|
|
|
|
|
|
def catalog_path(home, runtime):
|
|
identity = json.dumps(runtime.snapshot(), sort_keys=True).encode()
|
|
return home/'model-catalogs'/(hashlib.sha256(identity).hexdigest()+'.json')
|
|
|
|
|
|
def catalog(runtime):
|
|
vision = runtime.id == 'doubao' or runtime.model == 'deepseek-flash'
|
|
return {'models': [{
|
|
'slug': runtime.model, 'display_name': runtime.label+' · '+runtime.model,
|
|
'description': 'PCB design through native Codex tools and server-approved EDA operations.',
|
|
'default_reasoning_level': runtime.effort,
|
|
'supported_reasoning_levels': [{'effort': runtime.effort, 'description': 'Configured reasoning level'}],
|
|
'shell_type': 'shell_command', 'visibility': 'list', 'supported_in_api': True,
|
|
'priority': 0, 'prefer_websockets': False, 'upgrade': None,
|
|
'base_instructions': 'You are a PCB engineering assistant. Follow the developer instructions, user requirements and server approval boundaries.',
|
|
'supports_reasoning_summaries': False, 'default_reasoning_summary': 'none',
|
|
'support_verbosity': False, 'default_verbosity': None,
|
|
'apply_patch_tool_type': None, 'truncation_policy': {'mode': 'bytes', 'limit': 10000},
|
|
'supports_parallel_tool_calls': True, 'supports_image_detail_original': False,
|
|
'supports_standalone_web_search': runtime.id == 'deepseek',
|
|
'context_window': 1000000 if runtime.id == 'deepseek' else 128000,
|
|
'auto_compact_token_limit': 800000 if runtime.id == 'deepseek' else 100000,
|
|
'effective_context_window_percent': 95, 'experimental_supported_tools': [],
|
|
'input_modalities': ['text', 'image'] if vision else ['text'],
|
|
'tool_mode': None, 'supports_search_tool': False,
|
|
}]}
|