Skip to content

OpenAI compatibility API #919

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Conversation

sanderland
Copy link

WIP, not working yet

@@ -28,7 +29,8 @@ export async function isValidApiKey(apiKey) {
}
}

export function checkApiKey(apiKey) {
export function checkApiKey(apiKey, customEndpoint = null) {
return true;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for a custom OpenAI compatibility API endpoint and a model override input, along with updating API call functions to accommodate these changes.

  • Adds a custom endpoint input in the GUI and passes it to API request functions
  • Updates function signatures and template input events in openai.js and index.html.template to support the new custom endpoint and custom model parameters

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
scalene/scalene-gui/optimizations.js Adds retrieval of customEndpoint and customModel values and passes them to sendPromptToOpenAI
scalene/scalene-gui/openai.js Updates functions tryApi, isValidApiKey, checkApiKey, and sendPromptToOpenAI to accept customEndpoint and customModel parameters
scalene/scalene-gui/index.html.template Adds new input fields for custom OpenAI compatibility API URL and language model override
Comments suppressed due to low confidence (1)

scalene/scalene-gui/optimizations.js:201

  • The variable 'customEndpoint' is assigned without being declared, which may result in an unintended global variable. Please declare it (e.g., using 'let customEndpoint = ...') to ensure proper scoping.
customEndpoint = document.getElementById("openai-compatibility-api-url").value;

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