Open
Conversation
Mirrowel
reviewed
Nov 21, 2025
Comment on lines
+89
to
+126
| local function get_model_list() | ||
| local headers = { | ||
| ["Content-Type"] = "application/json", | ||
| ["Authorization"] = "Bearer "..API_KEY, | ||
| } | ||
|
|
||
| local body_tbl = {} | ||
| local requestId = http.send_request(API_MODELS_URL, "GET", headers, body_tbl) | ||
|
|
||
| local response | ||
| local error | ||
|
|
||
| -- ugly 5s busy timeout | ||
| local sec = tonumber(os.clock() + 5); | ||
| while not response and not error and ( os.clock() < sec ) do | ||
| log.info("waiting for models response"); | ||
| response, error = http.check_response(requestId) | ||
| end | ||
|
|
||
| log.info("models response " .. inspect(response)) | ||
|
|
||
| local resultPairs = {} | ||
| if response and response.data then | ||
| log.info("models list array result" .. inspect(response.data)) | ||
| for i, v in ipairs(response.data) do | ||
| local pair = { v["id"], v["id"] } | ||
| log.info("adding the pair: " .. inspect(pair)) | ||
| table.insert(resultPairs, pair) | ||
| end | ||
| elseif error then | ||
| log.error("models error" .. inspect(error)) | ||
| else | ||
| log.info("models probably timeout") | ||
| end | ||
| log.info("models final table", inspect(resultPairs)) | ||
| return resultPairs | ||
| end | ||
|
|
Collaborator
There was a problem hiding this comment.
This reminds me i need to add model list sanitization by default. I keep forgetting.
This returns... like 200+ models with gemini, nvidia combined.
Mirrowel
reviewed
Nov 21, 2025
Comment on lines
26
to
28
| local API_URL = "http://127.0.0.1:8000/v1/chat/completions" | ||
| local API_MODELS_URL = "http://127.0.0.1:8000/v1/models" | ||
| local API_KEY = config.PROXY_API_KEY |
Collaborator
There was a problem hiding this comment.
Honestly, this is a perfect thing to add to advanced settings in MCM - Base URL(API_URL in code). Maybe in the future. including the key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fetch the model list from the proxy at the game start (with 5s timeout).
Option is not yet used, just shown in MCM menu.
Hardcoded to use the proxy provider for now.