Skip to content

refactor: split disabled models for endpoints mapping into chat completions endpoint-disabled and completions endpoint-enabled mappings #974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PChaparro
Copy link

Describe the change

This PR refactors model mapping logic by splitting the original disabledModelsForEndpoints map into two distinct maps: disabledModelsForChatCompletionsEndpoint and enabledModelsForDeprecatedCompletionsEndpoint.

This improves clarity and simplifies future maintenance of model support across endpoints.

Provide OpenAI documentation link

Describe your solution

  • Created disabledModelsForChatCompletionsEndpoint to list models not supported by the chat completions endpoint. Maintaining a deny list is simpler since most new models are supported by chat completions by default.

  • Created enabledModelsForDeprecatedCompletionsEndpoint to list models that are supported by the legacy completions endpoint. Maintaining an allow list is more appropriate here, since the completions endpoint is deprecated and no longer widely supported.

Tests

Executed the verification command provided in the CONTRIBUTING.md file. All tests passed successfully and the refactor did not introduce any regressions.

Issue: #972.

…etions endpoint-disabled and completions endpoint-enabled mappings
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.43%. Comparing base (774fc9d) to head (5b57388).
Report is 90 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #974       +/-   ##
===========================================
- Coverage   98.46%   85.43%   -13.03%     
===========================================
  Files          24       43       +19     
  Lines        1364     2266      +902     
===========================================
+ Hits         1343     1936      +593     
- Misses         15      308      +293     
- Partials        6       22       +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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