Skip to content

Deactivate DeepSeek/Anthropic A/B round-robin for article simplification #669

Description

@mircealungu

Why

The provider A/B experiment (round-robin between DeepSeek and Anthropic for article simplification, to compare error rates) has run long enough. Deactivate it and pin providers deliberately.

Current behavior

zeeguu/core/llm_services/simplification_and_classification.py:

  • _get_next_simplification_provider() (~L27) alternates 'deepseek' / 'anthropic' on a module-level counter.
  • It's used by simplify_article_adaptive_levels() (~L79) only when the caller passes no simplification_provider (~L122-127).
  • The batch crawler already pins DeepSeekzeeguu/operations/crawler/crawl.py:148 crawl_round_robin(..., simplification_provider='deepseek') — so batch never round-robins.
  • The remaining round-robin caller is the on-demand path: simplify_article_adaptive_levels(title, content, language_code) at ~L454 (creating a simplified level when a reader needs it), which passes no provider.

Change

Stop the on-demand path from alternating; pin it to Anthropic (Haiku), matching models.py SIMPLIFICATION = ANTHROPIC_HAIKU ("real-time Haiku key path"). Net result:

  • On-demand / live simplification → Anthropic Haiku (low latency; DeepSeek stays as fallback on failure).
  • Batch crawl simplification → DeepSeek (already pinned; cheaper; latency-insensitive).

Minimal options (pick one):

  1. Set the default in simplify_article_adaptive_levels so simplification_provider defaults to 'anthropic' instead of round-robin, and remove/retire _get_next_simplification_provider.
  2. Or make _get_next_simplification_provider() return a fixed 'anthropic' (leaves less dead code behind — prefer removing it).

Acceptance criteria

  • On-demand simplification deterministically uses Anthropic Haiku (verify via logs / result['provider']).
  • Batch crawl still uses DeepSeek.
  • Round-robin counter and helper removed (no dead code).
  • DeepSeek fallback-on-failure behavior preserved.

Notes

  • The related grammar-correction experiment is already parked (correct_grammar=False by default, ran 2025-12-09 → 2026-04-05) — out of scope here, but confirm it stays disabled.
  • Context: this cleanup also sharpens a production example in the "LLM integration patterns" paper (live=Anthropic / batch=DeepSeek as a clean latency-tiered split).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions