Skip to content

refactor(constants): enforce ModelConstants — replace hardcoded model strings (#3528)#3542

Merged
mrveiss merged 2 commits intoDev_new_guifrom
issue-3528
Apr 5, 2026
Merged

refactor(constants): enforce ModelConstants — replace hardcoded model strings (#3528)#3542
mrveiss merged 2 commits intoDev_new_guifrom
issue-3528

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Apr 5, 2026

Summary

Replaces 40+ hardcoded model name strings across 14 files with constants from constants/model_constants.py. Consolidates three duplicate MODEL_PRICING dictionaries into a single authoritative source.

model_constants.py additions

  • Explicit constants for all OpenAI/Anthropic/Google/local model names (OPENAI_GPT4, OPENAI_GPT35_TURBO, ANTHROPIC_CLAUDE3_OPUS_DATED, GOOGLE_GEMINI_PRO_VISION, etc.)
  • Substring marker constants EXPENSIVE_MODEL_MARKER_OPUS, EXPENSIVE_MODEL_MARKER_GPT4
  • Three canonical pricing dicts: MODEL_PRICING_PER_1M_TOKENS, MODEL_PRICING_PER_1K_TOKENS, MODEL_COSTS_PER_1M_TOKENS

Files updated

File Change
constants/model_constants.py +120 lines of new constants + pricing dicts
services/llm_cost_tracker.py MODEL_PRICING dict → MODEL_PRICING_PER_1M_TOKENS import
modern_ai_integration.py 7 hardcoded vision/model strings → named constants
llm_multi_provider.py Fallback + default + model list strings → constants
llm_interface_pkg/providers/openai_provider.py "gpt-3.5-turbo" fallback → OPENAI_GPT35_TURBO
models/settings.py Field default → OPENAI_GPT35_TURBO
api/analytics_llm_patterns.py EXPENSIVE_MODELS set + MODEL_COSTS dict + substring checks → constants
code_intelligence/llm_pattern_analysis/calculators.py Both pricing dicts + fallback key → constants
code_intelligence/llm_pattern_analysis/data_models.py expensive_markers list → constants
llm_providers/openai_provider.py Model list + fallback defaults → constants
llm_providers/anthropic_provider.py 4 of 6 model list entries → constants
services/analytics_service.py Substring checks → marker constants
api/llm_providers.py Docstring example → generic reference

Closes #3528

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss mrveiss merged commit 7f0a966 into Dev_new_gui Apr 5, 2026
4 of 5 checks passed
@mrveiss mrveiss deleted the issue-3528 branch April 5, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant