Skip to content

Conversation

@sanderland
Copy link

WIP, not working yet


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 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;

@emeryberger
Copy link
Member

Hi @sanderland - should this still be a draft?

@sanderland
Copy link
Author

@emeryberger in the issue I described where I got stuck (mainly webpack). If there is no capacity to help on that part, just close this.

@emeryberger
Copy link
Member

How are you testing? With python3 -m scalene --viewer?

@sanderland
Copy link
Author

It's a while back! I think the python script ended up producing a web page, but this page included compressed scripts which very persistently were the old versions.

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.

2 participants