mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-17 18:18:11 +00:00
Add support for gpt-4-turbo 128K model (#340)
resolves #336 Add support for gpt-4-turbo 128K model
This commit is contained in:
parent
5673dc522b
commit
d34ec68702
4 changed files with 25 additions and 13 deletions
|
@ -73,7 +73,7 @@ This monorepo consists of three main sections:
|
|||
### Requirements
|
||||
- `yarn` and `node` on your machine
|
||||
- `python` 3.9+ for running scripts in `collector/`.
|
||||
- access to an LLM like `GPT-3.5`, `GPT-4`.
|
||||
- access to an LLM like `GPT-3.5`, `GPT-4`, etc.
|
||||
- (optional) a vector database like Pinecone, qDrant, Weaviate, or Chroma*.
|
||||
*AnythingLLM by default uses a built-in vector db called LanceDB.
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ export default function AzureAiOptions({ settings }) {
|
|||
<option value={16384}>16,384 (gpt-3.5-16k)</option>
|
||||
<option value={8192}>8,192 (gpt-4)</option>
|
||||
<option value={32768}>32,768 (gpt-4-32k)</option>
|
||||
<option value={128000}>128,000 (gpt-4-turbo)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -84,17 +84,19 @@ function OpenAIModelSelection({ apiKey, settings }) {
|
|||
className="bg-zinc-900 border border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
|
||||
>
|
||||
<optgroup label="General LLM models">
|
||||
{["gpt-3.5-turbo", "gpt-4"].map((model) => {
|
||||
return (
|
||||
<option
|
||||
key={model}
|
||||
value={model}
|
||||
selected={settings.OpenAiModelPref === model}
|
||||
>
|
||||
{model}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
{["gpt-3.5-turbo", "gpt-4", "gpt-4-1106-preview", "gpt-4-32k"].map(
|
||||
(model) => {
|
||||
return (
|
||||
<option
|
||||
key={model}
|
||||
value={model}
|
||||
selected={settings.OpenAiModelPref === model}
|
||||
>
|
||||
{model}
|
||||
</option>
|
||||
);
|
||||
}
|
||||
)}
|
||||
</optgroup>
|
||||
{customModels.length > 0 && (
|
||||
<optgroup label="Your fine-tuned models">
|
||||
|
|
|
@ -25,13 +25,22 @@ class OpenAiLLM extends OpenAiEmbedder {
|
|||
return 4096;
|
||||
case "gpt-4":
|
||||
return 8192;
|
||||
case "gpt-4-1106-preview":
|
||||
return 128000;
|
||||
case "gpt-4-32k":
|
||||
return 32000;
|
||||
default:
|
||||
return 4096; // assume a fine-tune 3.5
|
||||
}
|
||||
}
|
||||
|
||||
async isValidChatCompletionModel(modelName = "") {
|
||||
const validModels = ["gpt-4", "gpt-3.5-turbo"];
|
||||
const validModels = [
|
||||
"gpt-4",
|
||||
"gpt-3.5-turbo",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4-32k",
|
||||
];
|
||||
const isPreset = validModels.some((model) => modelName === model);
|
||||
if (isPreset) return true;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue