mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Add support for o3 mini model by openai
This commit is contained in:
@@ -71,6 +71,8 @@ def completion_with_backoff(
|
||||
elif model_name.startswith("o1"):
|
||||
temperature = 1
|
||||
model_kwargs.pop("response_format", None)
|
||||
elif model_name.startswith("o3-"):
|
||||
temperature = 1
|
||||
|
||||
if os.getenv("KHOJ_LLM_SEED"):
|
||||
model_kwargs["seed"] = int(os.getenv("KHOJ_LLM_SEED"))
|
||||
@@ -181,6 +183,8 @@ def llm_thread(
|
||||
elif model_name.startswith("o1-"):
|
||||
temperature = 1
|
||||
model_kwargs.pop("response_format", None)
|
||||
elif model_name.startswith("o3-"):
|
||||
temperature = 1
|
||||
elif model_name.startswith("deepseek-reasoner"):
|
||||
# Two successive messages cannot be from the same role. Should merge any back-to-back messages from the same role.
|
||||
# The first message should always be a user message (except system message).
|
||||
|
||||
@@ -55,6 +55,7 @@ model_to_prompt_size = {
|
||||
"gpt-4o-mini": 60000,
|
||||
"o1": 20000,
|
||||
"o1-mini": 60000,
|
||||
"o3-mini": 60000,
|
||||
# Google Models
|
||||
"gemini-1.5-flash": 60000,
|
||||
"gemini-1.5-pro": 60000,
|
||||
|
||||
@@ -40,6 +40,7 @@ model_to_cost: Dict[str, Dict[str, float]] = {
|
||||
"gpt-4o-mini": {"input": 0.15, "output": 0.60},
|
||||
"o1": {"input": 15.0, "output": 60.00},
|
||||
"o1-mini": {"input": 3.0, "output": 12.0},
|
||||
"o3-mini": {"input": 1.10, "output": 4.40},
|
||||
# Gemini Pricing: https://ai.google.dev/pricing
|
||||
"gemini-1.5-flash": {"input": 0.075, "output": 0.30},
|
||||
"gemini-1.5-flash-002": {"input": 0.075, "output": 0.30},
|
||||
|
||||
Reference in New Issue
Block a user