-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Implement retrieval and use of fine-tune models #314
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
Conversation
Cleanup LLM selection code resolves #311
|
The PR looks good overall, but there are a few areas where improvements can be made:
+import { useState } from 'react';
...
+const [showApiKey, setShowApiKey] = useState(false);
...
+<input
+ type={showApiKey ? "text" : "password"}
+ ...
+/>
+<button onClick={() => setShowApiKey(!showApiKey)}>
+ {showApiKey ? "Hide API Key" : "Show API Key"}
+</button>
+const [inputKey, setInputKey] = useState(settings?.OpenAiKey);
...
+<input
+ ...
+ defaultValue={inputKey ? "*".repeat(20) : ""}
+ onChange={(e) => setInputKey(e.target.value)}
+ onBlur={onUpdateOpenAiKey}
+/>
-import showToast from "../../../../../utils/toast";
...
+if (error) {
+ showToast(`Failed to save LLM settings: ${error}`, "error");
+ return;
+}
+const [azureEndpoint, setAzureEndpoint] = useState(settings?.AzureOpenAiEndpoint);
...
+<input
+ ...
+ value={azureEndpoint}
+ onChange={(e) => setAzureEndpoint(e.target.value)}
+/>
+import Spinner from "../../../../../components/Spinner";
...
+if (loading) {
+ return (
+ <div className="flex flex-col w-60">
+ ...
+ <Spinner />
+ </div>
+ );
+}Please consider these suggestions and apply them if you find them useful. However, I noticed that the For example, if <OpenAiOptions apiKey={settings?.OpenAiKey} modelPref={settings?.OpenAiModelPref} />And then in This is just a suggestion for further improvement, overall the changes in this PR are well done.
customModels: async function (provider, apiKey) {
return fetch(`${API_BASE}/system/custom-models?provider=${provider}&apiKey=${apiKey}`, {
method: "GET",
headers: baseHeaders(),
})
// rest of the code
},
app.get(
"/system/custom-models",
[validatedRequest],
async (request, response) => {
try {
const { provider, apiKey } = request.query;
const { models, error } = await getCustomModels(provider, apiKey);
return response.status(200).json({
models,
error,
});
} catch (error) {
console.error(error);
response.status(500).end();
}
}
);
OpenAiModelPref: {
envKey: "OPEN_MODEL_PREF",
checks: [isNotEmpty, isValidChatCompletionModel],
},Please consider these suggestions and apply the necessary changes. |
* Implement retrieval and use of fine-tune models Cleanup LLM selection code resolves #311 * Cleanup from PR bot
* Implement retrieval and use of fine-tune models Cleanup LLM selection code resolves Mintplex-Labs#311 * Cleanup from PR bot
Cleanup LLM selection code
resolves #311