mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-11 01:10:11 +01:00
Set gpt-4o as default for OpenAI (#1391)
This commit is contained in:
parent
2fabc84578
commit
64b62290d7
@ -9,7 +9,7 @@ GID='1000'
|
||||
###########################################
|
||||
# LLM_PROVIDER='openai'
|
||||
# OPEN_AI_KEY=
|
||||
# OPEN_MODEL_PREF='gpt-3.5-turbo'
|
||||
# OPEN_MODEL_PREF='gpt-4o'
|
||||
|
||||
# LLM_PROVIDER='gemini'
|
||||
# GEMINI_API_KEY=
|
||||
|
@ -6,7 +6,7 @@ JWT_SECRET="my-random-string-for-seeding" # Please generate random string at lea
|
||||
###########################################
|
||||
# LLM_PROVIDER='openai'
|
||||
# OPEN_AI_KEY=
|
||||
# OPEN_MODEL_PREF='gpt-3.5-turbo'
|
||||
# OPEN_MODEL_PREF='gpt-4o'
|
||||
|
||||
# LLM_PROVIDER='gemini'
|
||||
# GEMINI_API_KEY=
|
||||
|
@ -297,7 +297,7 @@ const SystemSettings = {
|
||||
return {
|
||||
// OpenAI Keys
|
||||
OpenAiKey: !!process.env.OPEN_AI_KEY,
|
||||
OpenAiModelPref: process.env.OPEN_MODEL_PREF || "gpt-3.5-turbo",
|
||||
OpenAiModelPref: process.env.OPEN_MODEL_PREF || "gpt-4o",
|
||||
|
||||
// Azure + OpenAI Keys
|
||||
AzureOpenAiEndpoint: process.env.AZURE_OPENAI_ENDPOINT,
|
||||
|
@ -11,8 +11,7 @@ class OpenAiLLM {
|
||||
this.openai = new OpenAIApi({
|
||||
apiKey: process.env.OPEN_AI_KEY,
|
||||
});
|
||||
this.model =
|
||||
modelPreference || process.env.OPEN_MODEL_PREF || "gpt-3.5-turbo";
|
||||
this.model = modelPreference || process.env.OPEN_MODEL_PREF || "gpt-4o";
|
||||
this.limits = {
|
||||
history: this.promptWindowLimit() * 0.15,
|
||||
system: this.promptWindowLimit() * 0.15,
|
||||
@ -48,6 +47,7 @@ class OpenAiLLM {
|
||||
case "gpt-3.5-turbo":
|
||||
case "gpt-3.5-turbo-1106":
|
||||
return 16_385;
|
||||
case "gpt-4o":
|
||||
case "gpt-4-turbo":
|
||||
case "gpt-4-1106-preview":
|
||||
case "gpt-4-turbo-preview":
|
||||
|
@ -11,7 +11,7 @@ const Agent = {
|
||||
|
||||
const aibitat = new AIbitat({
|
||||
provider: "openai",
|
||||
model: "gpt-3.5-turbo",
|
||||
model: "gpt-4o",
|
||||
})
|
||||
.use(cli.plugin())
|
||||
.function({
|
||||
|
@ -8,7 +8,7 @@ const {
|
||||
require("dotenv").config({ path: `../../../../.env.development` });
|
||||
|
||||
const aibitat = new AIbitat({
|
||||
model: "gpt-3.5-turbo",
|
||||
model: "gpt-4o",
|
||||
})
|
||||
.use(cli.plugin())
|
||||
.use(fileHistory.plugin())
|
||||
|
@ -69,7 +69,7 @@ async function runAIbitat(socket) {
|
||||
console.log(chalk.blue("Booting AIbitat class & starting agent(s)"));
|
||||
const aibitat = new AIbitat({
|
||||
provider: "openai",
|
||||
model: "gpt-3.5-turbo",
|
||||
model: "gpt-4o",
|
||||
})
|
||||
.use(websocket.plugin({ socket }))
|
||||
.use(webBrowsing.plugin())
|
||||
|
@ -13,6 +13,10 @@ class OpenAIProvider extends Provider {
|
||||
input: 0.03,
|
||||
output: 0.06,
|
||||
},
|
||||
"gpt-4o": {
|
||||
input: 0.005,
|
||||
output: 0.015,
|
||||
},
|
||||
"gpt-4-32k": {
|
||||
input: 0.06,
|
||||
output: 0.12,
|
||||
@ -33,7 +37,7 @@ class OpenAIProvider extends Provider {
|
||||
apiKey: process.env.OPEN_AI_KEY,
|
||||
maxRetries: 3,
|
||||
},
|
||||
model = "gpt-3.5-turbo",
|
||||
model = "gpt-4o",
|
||||
} = config;
|
||||
|
||||
const client = new OpenAI(options);
|
||||
|
@ -12,7 +12,7 @@ const Provider = require("../providers/ai-provider");
|
||||
|
||||
const SUMMARY_MODEL = {
|
||||
anthropic: "claude-3-opus-20240229", // 200,000 tokens
|
||||
openai: "gpt-3.5-turbo-1106", // 16,385 tokens
|
||||
openai: "gpt-4o", // 128,000 tokens
|
||||
};
|
||||
|
||||
async function summarizeContent(
|
||||
|
@ -146,7 +146,7 @@ class AgentHandler {
|
||||
#providerDefault() {
|
||||
switch (this.provider) {
|
||||
case "openai":
|
||||
return "gpt-3.5-turbo";
|
||||
return "gpt-4o";
|
||||
case "anthropic":
|
||||
return "claude-3-sonnet-20240229";
|
||||
case "lmstudio":
|
||||
@ -258,7 +258,7 @@ class AgentHandler {
|
||||
) {
|
||||
this.aibitat = new AIbitat({
|
||||
provider: this.provider ?? "openai",
|
||||
model: this.model ?? "gpt-3.5-turbo",
|
||||
model: this.model ?? "gpt-4o",
|
||||
chats: await this.#chatHistory(20),
|
||||
handlerProps: {
|
||||
invocation: this.invocation,
|
||||
|
@ -66,6 +66,14 @@ async function openAiModels(apiKey = null) {
|
||||
owned_by: "openai",
|
||||
organization: "OpenAi",
|
||||
},
|
||||
{
|
||||
name: "gpt-4o",
|
||||
id: "gpt-4o",
|
||||
object: "model",
|
||||
created: 1677610602,
|
||||
owned_by: "openai",
|
||||
organization: "OpenAi",
|
||||
},
|
||||
{
|
||||
name: "gpt-4",
|
||||
id: "gpt-4",
|
||||
|
Loading…
Reference in New Issue
Block a user