Skip to content

fix(config): change LLM_BACKEND default from gpt-4o to openai - #178

Merged
sahoo-tech merged 2 commits into
sahoo-tech:mainfrom
Ridanshi:fix/llm-factory-default-backend
May 21, 2026
Merged

fix(config): change LLM_BACKEND default from gpt-4o to openai#178
sahoo-tech merged 2 commits into
sahoo-tech:mainfrom
Ridanshi:fix/llm-factory-default-backend

Conversation

@Ridanshi

Copy link
Copy Markdown
Contributor

Summary

Fixes a configuration mismatch where the default LLM_BACKEND value in core/config.py did not match any backend supported by LLMClientFactory.create().

Previously, users running Execra without overriding LLM_BACKEND in .env would hit:

ValueError: Unsupported backend: gpt-4o

during startup because the factory only recognised:

  • openai
  • gemini
  • llama

This PR updates the default backend to openai, aligns .env.example, and adds regression coverage to prevent future config/factory mismatches.

Closes #35


Changes Made

core/config.py

  • Changed the default backend from:
LLM_BACKEND: str = "gpt-4o"

to:

LLM_BACKEND: str = "openai"

.env.example

  • Updated the documented default backend value to openai

tests/unit/test_config.py

  • Updated existing default assertions
  • Added:
test_default_llm_backend_resolves_in_factory

to verify the default configuration resolves successfully through LLMClientFactory


Impact

Reliability

Prevents startup failures for users running Execra with default configuration values.

Configuration Consistency

Ensures configuration defaults remain aligned with supported factory backends.

Regression Protection

Adds automated coverage preventing future backend/default mismatches.


Testing

  • Verified default backend resolves successfully through LLMClientFactory.create()

  • Updated config default assertions

  • pytest tests/unit/test_config.py

    • 4/5 tests passing
    • Remaining failure (TRUST_SCORE_W1 AttributeError) is pre-existing and unrelated to this change

Notes

This PR intentionally keeps the fix minimal and isolated:

  • no architectural changes
  • no factory refactors
  • no unrelated configuration modifications

Ridanshi and others added 2 commits May 17, 2026 21:38
LLMClientFactory.create() dispatches on backend == openai | gemini |
llama. The previous default gpt-4o never matched any branch, causing
an immediate ValueError for every user on default config.

Change the default to openai so it routes correctly to OpenAIClient,
and update .env.example to match. Also update the defaults assertion in
test_config.py and add a guard test that verifies the default backend is
always a value the factory can handle.
@sahoo-tech
sahoo-tech merged commit 9bfeae3 into sahoo-tech:main May 21, 2026
1 of 2 checks passed
@Ridanshi

Copy link
Copy Markdown
Contributor Author

Hi @sahoo-tech,
Thank you for merging this PR. Could you please update the corresponding GSSoC contribution points/leaderboard entry whenever convenient?

Thanks again for the review and support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build the Physical Domain Pipeline (CV + Task Guidance)

2 participants