Skip to content

Commit db41377

Browse files
authored
feat(New Model): Add support for gpt5 (#52)
* add gpt5 * fix some bug * fix * update gpt5 * add doc, fix some bug * fix gpt-5
1 parent fc4e99b commit db41377

File tree

11 files changed

+633
-26
lines changed

11 files changed

+633
-26
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
defaults:
2+
- benchmark: gaia-validation
3+
- override hydra/job_logging: none
4+
- _self_ # Allow defining variables at the top of this file
5+
6+
7+
main_agent:
8+
prompt_class: MainAgentPrompt_GAIA
9+
llm:
10+
provider_class: "GPT5OpenAIClient"
11+
model_name: "gpt-5"
12+
async_client: true
13+
temperature: 1.0
14+
top_p: 1.0
15+
min_p: 0.0
16+
top_k: -1
17+
max_tokens: 128000
18+
reasoning_effort: "high"
19+
openai_api_key: "${oc.env:OPENAI_API_KEY,???}"
20+
openai_base_url: "${oc.env:OPENAI_BASE_URL,https://api.openai.com/v1}"
21+
openrouter_provider: ""
22+
disable_cache_control: true
23+
keep_tool_result: -1
24+
oai_tool_thinking: false
25+
26+
tool_config:
27+
- tool-reasoning
28+
29+
max_turns: -1 # Maximum number of turns for main agent execution
30+
max_tool_calls_per_turn: 10 # Maximum number of tool calls per turn
31+
32+
input_process:
33+
hint_generation: true
34+
hint_llm_base_url: "${oc.env:HINT_LLM_BASE_URL,https://api.openai.com/v1}"
35+
output_process:
36+
final_answer_extraction: true
37+
final_answer_llm_base_url: "${oc.env:FINAL_ANSWER_LLM_BASE_URL,https://api.openai.com/v1}"
38+
39+
openai_api_key: "${oc.env:OPENAI_API_KEY,???}" # used for hint generation and final answer extraction
40+
add_message_id: true
41+
keep_tool_result: -1
42+
chinese_context: "${oc.env:CHINESE_CONTEXT,false}"
43+
44+
45+
sub_agents:
46+
agent-worker:
47+
prompt_class: SubAgentWorkerPrompt
48+
llm:
49+
provider_class: "GPT5OpenAIClient"
50+
model_name: "gpt-5"
51+
async_client: true
52+
temperature: 1.0
53+
top_p: 1.0
54+
min_p: 0.0
55+
top_k: -1
56+
max_tokens: 128000
57+
reasoning_effort: "medium"
58+
openai_api_key: "${oc.env:OPENAI_API_KEY,???}"
59+
openai_base_url: "${oc.env:OPENAI_BASE_URL,https://api.openai.com/v1}"
60+
openrouter_provider: ""
61+
disable_cache_control: true
62+
keep_tool_result: -1
63+
oai_tool_thinking: false
64+
65+
tool_config:
66+
- tool-searching
67+
- tool-image-video
68+
- tool-reading
69+
- tool-code
70+
- tool-audio
71+
72+
max_turns: -1 # Maximum number of turns for main agent execution
73+
max_tool_calls_per_turn: 10 # Maximum number of tool calls per turn
74+
75+
76+
# Can define some top-level or default parameters here
77+
output_dir: logs/
78+
data_dir: "${oc.env:DATA_DIR,data}" # Points to where data is stored
79+

config/tool/tool-reading.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ name: "tool-reading"
22
tool_command: "python"
33
args:
44
- "-m"
5-
- "src.tool.mcp_servers.reading_mcp_server"
5+
- "src.tool.mcp_servers.reading_mcp_server"
6+
env:
7+
SERPER_API_KEY: "${oc.env:SERPER_API_KEY}"
8+
JINA_API_KEY: "${oc.env:JINA_API_KEY}"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# GAIA Validation - GPT5
2+
3+
MiroFlow now supports GPT-5 with MCP tool invocation, providing a unified workflow for multi-step reasoning, information integration, and scalable tool coordination.
4+
5+
!!! info "Prerequisites"
6+
Before proceeding, please review the [GAIA Validation Prerequisites](gaia_validation_prerequisites.md) document, which covers common setup requirements, dataset preparation, and API key configuration.
7+
8+
---
9+
10+
## Running the Evaluation
11+
12+
### Step 1: Dataset Preparation
13+
14+
Follow the [dataset preparation instructions](gaia_validation_prerequisites.md#dataset-preparation) in the prerequisites document.
15+
16+
### Step 2: API Keys Configuration
17+
18+
Configure the following API keys in your `.env` file:
19+
20+
```env title="GPT-5 .env Configuration"
21+
# Search and web scraping capabilities
22+
SERPER_API_KEY="your-serper-api-key"
23+
JINA_API_KEY="your-jina-api-key"
24+
25+
# Code execution environment
26+
E2B_API_KEY="your-e2b-api-key"
27+
28+
# Vision understanding capabilities
29+
ANTHROPIC_API_KEY="your-anthropic-api-key"
30+
GEMINI_API_KEY="your-gemini-api-key"
31+
32+
# Primary LLM provider, LLM judge, reasoning, and hint generation
33+
OPENAI_API_KEY="your-openai-api-key"
34+
OPENAI_BASE_URL="https://api.openai.com/v1"
35+
36+
```
37+
38+
### Step 3: Run the Evaluation
39+
40+
Execute the evaluation using the GPT-5 configuration:
41+
42+
```bash title="Run GAIA Validation with GPT-5"
43+
uv run main.py common-benchmark \
44+
--config_file_name=agent_gaia-validation-gpt5 \
45+
output_dir="logs/gaia-validation-gpt5/$(date +"%Y%m%d_%H%M")"
46+
```
47+
48+
### Step 4: Monitor Progress
49+
50+
Follow the [progress monitoring instructions](gaia_validation_prerequisites.md#progress-monitoring-and-resume) in the prerequisites document.
51+
52+
53+
---
54+
55+
!!! info "Documentation Info"
56+
**Last Updated:** October 2025 · **Doc Contributor:** Team @ MiroMind AI

docs/mkdocs/docs/llm_clients_overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ MiroFlow supports multiple LLM providers through a unified client interface. Eac
99
| `ClaudeAnthropicClient` | Anthropic Direct | claude-3-7-sonnet | `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL` |
1010
| `ClaudeOpenRouterClient` | OpenRouter | anthropic/claude-3.7-sonnet, and other [supported models](https://openrouter.ai/models) | `OPENROUTER_API_KEY`, `OPENROUTER_BASE_URL` |
1111
| `GPTOpenAIClient` | OpenAI | gpt-4, gpt-3.5 | `OPENAI_API_KEY`, `OPENAI_BASE_URL` |
12+
| `GPT5OpenAIClient` | OpenAI | gpt-5 | `OPENAI_API_KEY`, `OPENAI_BASE_URL` |
1213
| `MiroThinkerSGLangClient` | SGLang | MiroThinker series | `OAI_MIROTHINKER_API_KEY`, `OAI_MIROTHINKER_BASE_URL` |
1314

1415
## Basic Configuration
@@ -31,4 +32,4 @@ main_agent:
3132
---
3233

3334
!!! info "Documentation Info"
34-
**Last Updated:** September 2025 · **Doc Contributor:** Team @ MiroMind AI
35+
**Last Updated:** October 2025 · **Doc Contributor:** Team @ MiroMind AI

docs/mkdocs/docs/openai-gpt.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,45 @@
11
# OpenAI GPT Models
22

3-
OpenAI's latest models including GPT-4o and advanced reasoning models with strong coding, vision, and reasoning capabilities.
3+
OpenAI's latest models including GPT-5, GPT-4o and advanced reasoning models with strong coding, vision, and reasoning capabilities.
44

5-
## Client Used
5+
## Client Used for GPT-5
6+
7+
`GPT5OpenAIClient`
8+
9+
## Environment Setup
10+
11+
```bash title="Environment Variables"
12+
export OPENAI_API_KEY="your-openai-key"
13+
export OPENAI_BASE_URL="https://api.openai.com/v1" # optional
14+
```
15+
16+
## Configuration
17+
18+
```yaml title="Agent Configuration"
19+
main_agent:
20+
llm:
21+
provider_class: "GPT5OpenAIClient"
22+
model_name: "gpt-5"
23+
async_client: true
24+
temperature: 1.0
25+
top_p: 1.0
26+
min_p: 0.0
27+
top_k: -1
28+
max_tokens: 128000
29+
reasoning_effort: "high" # Use high in the main agent, and use the default medium in the sub-agent.
30+
openai_api_key: "${oc.env:OPENAI_API_KEY,???}"
31+
openai_base_url: "${oc.env:OPENAI_BASE_URL,https://api.openai.com/v1}"
32+
```
33+
34+
## Usage
35+
36+
```bash title="Example Command"
37+
# Create custom OpenAI config
38+
uv run main.py trace --config_file_name=your_config_file \
39+
--task="Your task" --task_file_name="data/file.txt"
40+
```
41+
42+
## Client Used for GPT-4o
643

744
`GPTOpenAIClient`
845

@@ -32,7 +69,10 @@ uv run main.py trace --config_file_name=your_config_file \
3269
--task="Your task" --task_file_name="data/file.txt"
3370
```
3471

72+
!!! note "Configuration Notes"
73+
- `GPTOpenAIClient` also supports GPT-5, but it has not been fully validated on MiroFlow yet. We recommend using `GPT5OpenAIClient`.
74+
3575
---
3676

3777
!!! info "Documentation Info"
38-
**Last Updated:** September 2025 · **Doc Contributor:** Team @ MiroMind AI
78+
**Last Updated:** October 2025 · **Doc Contributor:** Team @ MiroMind AI

docs/mkdocs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ nav:
5252
- GAIA-Validation:
5353
- Prerequisites: gaia_validation_prerequisites.md
5454
- Claude-3.7-Sonnet: gaia_validation_claude37sonnet.md
55+
- GPT-5: gaia_validation_gpt5.md
5556
- MiroThinker: gaia_validation_mirothinker.md
5657
- GAIA-Validation-Text-Only: gaia_validation_text_only.md
5758
- GAIA-Test: gaia_test.md

src/llm/provider_client_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def __post_init__(self):
4343
self.top_p: float = self.cfg.llm.top_p
4444
self.min_p: float = self.cfg.llm.min_p
4545
self.top_k: int = self.cfg.llm.top_k
46+
self.reasoning_effort: str = self.cfg.llm.get("reasoning_effort", "medium")
4647
self.repetition_penalty: float = self.cfg.llm.get("repetition_penalty", 1.0)
4748
self.max_tokens: int = self.cfg.llm.max_tokens
4849
self.max_context_length: int = self.cfg.llm.get("max_context_length", -1)

src/llm/providers/claude_openrouter_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,4 +411,4 @@ def _apply_cache_control(self, messages):
411411
else:
412412
# Other messages add directly
413413
cached_messages.append(turn)
414-
return list(reversed(cached_messages))
414+
return list(reversed(cached_messages))

0 commit comments

Comments
 (0)