---
type: email
from: Behnvm <notifications@github.com>
subject: [openai/openai-agents-python] Unusual CPU usage when running agents

 with "gpt-5-nano" (Issue #1409)
received: 2026-03-05 09:55:28
date_header: Fri, 08 Aug 2025 05:44:11 -0700
priority: normal
status: awaiting_approval
uid: 26926
---

## Email Content

**From:** Behnvm <notifications@github.com>
**Subject:** [openai/openai-agents-python] Unusual CPU usage when running agents

 with "gpt-5-nano" (Issue #1409)
**Date:** Fri, 08 Aug 2025 05:44:11 -0700

### Body (preview)

behnamkhorsandian created an issue (openai/openai-agents-python#1409)



Switching the model from `gpt-4.1-nano` to `gpt-5-nano` causes unusually high local CPU and RAM usage during agent runs (See attached image showing an 8-core container jumping to ~800% CPU with gpt-5-nano, while gpt-4.1-nano remains comparatively low.). 



With gpt-4.1-nano, CPU usage is modest and stable. With gpt-5-nano, CPU spikes up to 800% (sometimes up to 1200–1400%) (Docker Desktop shows 8 CPUs available), along with a noticeable memory surge. This happens in an agent-based, tool-using workflow. The only change is the model name. No other code/config/process changes.





Example code to run:



```python

import os

from dotenv import load_dotenv

from agents import Agent, function_tool, Runner, trace, AgentOutputSchema, TResponseInputItem, ModelSettings

from datetime import datetime

from typing import Any, Optional, List

from pydantic import BaseModel, Field

from scrapling.fetchers import StealthyFetcher

import requests



fetcher = StealthyFetcher()



load_dotenv()



LLM_MODEL = 'gpt-5-nano'



@function_tool

def internet_search(query: str, url: Optional[str]=None, location: Optional[str]=None, language: Optional[str]=None):

    """

    Perform a Google search with optional site, location, and language parameters.

    Args:

        query (str): Search term.

        url (str): Restrict results to a specific site (e.g., 'bbc.com').

        location (str): Country code (e.g., 'US', 'GB').

        language (str): Language code (e.g., 'en', 'de').

    Returns:

        List[dict]: Search results.

    """

    if url:

        query = f"site:{url} {query}"

    params = {

        'q': query,

        'cx': os.getenv('GOOGLE_SEARCH_ENGINE_ID'),

        'key': os.getenv('GOOGLE_SEARCH_API_KEY'),

        'num': 10,

    }

    if language:

        params['lr'] = f'lang_{language}'

    if location:

        params['gl'] = location



    url = 'https://www.googleapis.com/

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
