|
45 | 45 | 'cross_agent_enhancement': True, # Generate enhanced solutions using peer strategies |
46 | 46 | } |
47 | 47 |
|
| 48 | +# Lightweight MARS configuration for coding benchmarks (faster, simpler) |
| 49 | +LIGHTWEIGHT_CONFIG = { |
| 50 | + 'num_agents': 2, # Reduced from 3 |
| 51 | + 'max_iterations': 2, # Reduced from 5 for speed |
| 52 | + 'verification_passes_required': 1, # Reduced from 2 |
| 53 | + 'consensus_threshold': 1, # Adjusted for 2-agent setup |
| 54 | + 'min_verified_solutions': 1, |
| 55 | + 'max_tokens': 4000, # Much smaller for coding |
| 56 | + 'max_verification_attempts': 2, # Reduced from 3 |
| 57 | + 'early_termination': True, |
| 58 | + 'use_reasoning_api': True, |
| 59 | + # Disable expensive features for coding |
| 60 | + 'enable_aggregation': False, # Skip RSA aggregation |
| 61 | + 'enable_strategy_network': False, # Skip strategy network |
| 62 | + 'strategy_extraction_enabled': False, |
| 63 | + 'cross_agent_enhancement': False, |
| 64 | +} |
| 65 | + |
48 | 66 | def multi_agent_reasoning_system( |
49 | 67 | system_prompt: str, |
50 | 68 | initial_query: str, |
@@ -84,8 +102,12 @@ async def _run_mars_parallel( |
84 | 102 | logger.info(f"🚀 MARS INITIALIZATION - Starting MARS with model: {model}") |
85 | 103 | logger.info(f"📝 PROBLEM: {initial_query[:200]}{'...' if len(initial_query) > 200 else ''}") |
86 | 104 |
|
87 | | - # Initialize configuration |
88 | | - config = DEFAULT_CONFIG.copy() |
| 105 | + # Initialize configuration - use lightweight config for coding if max_tokens <= 4000 |
| 106 | + use_lightweight = request_config and request_config.get('max_tokens', 64000) <= 4000 |
| 107 | + config = LIGHTWEIGHT_CONFIG.copy() if use_lightweight else DEFAULT_CONFIG.copy() |
| 108 | + |
| 109 | + if use_lightweight: |
| 110 | + logger.info(f"⚡ CONFIG: Using LIGHTWEIGHT MARS config for coding (fast mode)") |
89 | 111 |
|
90 | 112 | # Override max_tokens from request_config if provided |
91 | 113 | if request_config and 'max_tokens' in request_config: |
|
0 commit comments