10000 Added support for o4-mini by amit9oct · Pull Request #81 · trishullab/copra · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added support for o4-mini #81

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

Merged
merged 2 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = ["src/copra"]

[project]
name = "copra-theorem-prover"
version = "1.1.6"
version = "1.1.7"
authors = [
{ name="Amitayush Thakur", email="amitayush@utexas.edu" },
]
Expand Down
12 changes: 11 additions & 1 deletion src/copra/gpts/gpt_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class GptAccess:
"request_limit_per_min": 8000,
"max_token_per_prompt": int(1.2 * 10**5)
},
"o4-mini": {
"token_limit_per_min": 8000000,
"request_limit_per_min": 8000,
"max_token_per_prompt": int(1.2 * 10**5)
},
"claude-3-7-sonnet-20250219": {
"token_limit_per_min": 40000,
"request_limit_per_min": 1000,
Expand All @@ -85,6 +90,7 @@ class GptAccess:
"o1": ".secrets/openai_key.json",
"o3": ".secrets/openai_key.json",
"o3-mini": ".secrets/openai_key.json",
"o4-mini": ".secrets/openai_key.json",
"claude-3-7-sonnet-20250219": ".secrets/anthropic_key.json"
}

Expand Down Expand Up @@ -179,6 +185,7 @@ def complete_chat(self,
if self.is_open_ai_model or self.is_anthropic_model:
if self.model_name.startswith("o1") or \
self.model_name.startswith("o3") or \
self.model_name.startswith("o4") or \
self.is_anthropic_model:
messages = self.handle_thinking_messages(messages)
return_responses, usage, stopping_reasons = \
Expand Down Expand Up @@ -224,7 +231,7 @@ def handle_thinking_messages(self, messages: typing.List[typing.Dict[str, str]])

def get_thinking_response(self, model, messages, max_tokens, stop : typing.List[str], reasoning_token_count, reasoning_effort) -> typing.Tuple[list, dict, str]:
response = None
if self.is_open_ai_model and model == "o1-mini":
if self.is_open_ai_model and model == "o1-mini" or model == "o4-mini":
response = self.client.chat.completions.create(
model=model,
messages=messages,
Expand Down Expand Up @@ -359,6 +366,9 @@ def _run_chat_test(self, model_name: str, token_count: int):

def test_o3_mini_model(self):
self._run_chat_test("o3-mini", token_count=100)

def test_o4_mini_model(self):
self._run_chat_test("o4-mini", token_count=100)

def test_gpt4o_model(self):
self._run_chat_test("gpt-4o", token_count=100)
Expand Down
0