Skip to main content

Module micro_mode

Module micro_mode 

Source
Expand description

Micro Evolution Mode — For 0.8B-3B Parameter Models

Small models struggle with:

  • Large context windows (>4K tokens)
  • Complex multi-file reasoning
  • Precise JSON array formatting
  • Multi-step search-and-replace

This module provides simplified mutation strategies that trade sophistication for reliability on resource-constrained hardware.

Constants§

MICRO_MAX_CONTEXT_CHARS
Maximum context size for micro mode (in characters) ~4K tokens ≈ 16K chars for code
MICRO_MAX_EDITS
Maximum edits per hypothesis in micro mode Small models do better with single, focused changes
MICRO_MAX_FILES
Maximum files to include in micro mode context

Functions§

build_micro_context
Build micro-mode context with aggressive truncation
build_micro_system_prompt
Simplified system prompt for micro models
is_micro_model
Detect if we should use micro mode based on model name. Matches small parameter counts as word-bounded tokens to avoid false positives (e.g. “32b” matching “2b”, “13b” matching “3b”).
select_micro_targets
Filter and limit mutation targets for micro mode Returns the smallest files first, limited by MICRO_MAX_FILES
validate_micro_hypothesis
Validate that a hypothesis is “micro-safe”