Skip to content
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

chore: support customized OpenAI model.json #3961

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Nov 6, 2024

Describe Your Changes

This PR allows users to customize model.json to point to a compatible OpenAI endpoint. It applies the legacy model scanning for these cases.

Screenshot 2024-11-06 at 16 47 15

Changes made

The git diff highlights the following changes in the model-json.ts file:

  1. Added Local Engines Array:

    • A new constant array LocalEngines has been added. It contains specific inference engines from the InferenceEngine enum: cortex, cortex_llamacpp, cortex_tensorrtllm, cortex_onnx, nitro_tensorrt_llm, and nitro.
  2. Modified Conditional Logic:

    • The conditional check within the scanModelsFolder function was altered.
    • Previously, the code returned the model if all existFiles evaluated to true.
    • Now, the code checks if the model's engine is not in the LocalEngines list or if all existFiles are true before returning the model. If either of these conditions is met, the model is returned.

These changes adjust how models are processed based on their engine type and the existence of corresponding files.

@github-actions github-actions bot added the type: chore Maintenance, operational label Nov 6, 2024
@louis-jan louis-jan requested a review from a team November 6, 2024 09:47
Copy link
Contributor

github-actions bot commented Nov 6, 2024

Barecheck - Code coverage report

Total: 69.62%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
web/hooks/useModels.ts45, 58-59, 63

@louis-jan louis-jan merged commit 0e65379 into dev Nov 6, 2024
11 checks passed
@louis-jan louis-jan deleted the chore/support-customized-openai-model-json branch November 6, 2024 10:30
@github-actions github-actions bot added this to the v0.5.8 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Maintenance, operational
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants