@@ -88,7 +88,7 @@ from swarms import Agent
8888
8989agent = Agent(
9090 agent_name = " Analyst" ,
91- model_name = " gpt-4.1 " ,
91+ model_name = " gpt-5.4 " ,
9292 max_loops = 1 ,
9393)
9494
@@ -103,7 +103,7 @@ print(result)
103103| ` agent_name ` | str | ` "swarm-worker-01" ` | Unique name — used for memory file paths |
104104| ` agent_description ` | str | generic | Shown to orchestrators for routing |
105105| ` system_prompt ` | str | built-in | The agent's persona / instructions |
106- | ` model_name ` | str | ` "gpt-4.1 " ` | Any LiteLLM model string |
106+ | ` model_name ` | str | ` "gpt-5.4 " ` | Any LiteLLM model string |
107107| ` max_loops ` | int \| ` "auto" ` | ` 1 ` | Loops before returning; ` "auto" ` = autonomous until done |
108108| ` tools ` | list[ Callable] | ` None ` | Python functions the agent can call |
109109| ` streaming_on ` | bool | ` False ` | Stream tokens to stdout |
@@ -131,7 +131,7 @@ When `max_loops="auto"` the agent runs a plan→execute→reflect loop until it
131131``` python
132132agent = Agent(
133133 agent_name = " Researcher" ,
134- model_name = " gpt-4.1 " ,
134+ model_name = " gpt-5.4 " ,
135135 max_loops = " auto" ,
136136 interactive = False ,
137137)
@@ -144,7 +144,7 @@ Use any LiteLLM-compatible string:
144144
145145``` python
146146# OpenAI
147- model_name= " gpt-4.1 "
147+ model_name= " gpt-5.4 "
148148model_name= " gpt-5.4-mini"
149149model_name= " o3"
150150
@@ -180,14 +180,14 @@ On startup the agent reads `{workspace}/agents/{agent_name}/MEMORY.md` and injec
180180``` python
181181agent = Agent(
182182 agent_name = " ProjectAssistant" ,
183- model_name = " gpt-4.1 " ,
183+ model_name = " gpt-5.4 " ,
184184 persistent_memory = True , # default
185185)
186186# First run: agent has no prior context
187187agent.run(" My project is called Helios. Remember that." )
188188
189189# New process, same agent_name → agent remembers "Helios"
190- agent2 = Agent(agent_name = " ProjectAssistant" , model_name = " gpt-4.1 " )
190+ agent2 = Agent(agent_name = " ProjectAssistant" , model_name = " gpt-5.4 " )
191191agent2.run(" What is my project called?" )
192192```
193193
@@ -198,7 +198,7 @@ Fully stateless — no disk reads or writes. Use for short, isolated tasks where
198198``` python
199199agent = Agent(
200200 agent_name = " OneShot" ,
201- model_name = " gpt-4.1 " ,
201+ model_name = " gpt-5.4 " ,
202202 persistent_memory = False ,
203203)
204204```
@@ -210,7 +210,7 @@ agent = Agent(
210210``` python
211211agent = Agent(
212212 agent_name = " LongSession" ,
213- model_name = " gpt-4.1 " ,
213+ model_name = " gpt-5.4 " ,
214214 context_length = 32000 ,
215215 context_compression = True , # default
216216)
@@ -258,7 +258,7 @@ def get_stock_price(ticker: str) -> str:
258258
259259agent = Agent(
260260 agent_name = " StockAnalyst" ,
261- model_name = " gpt-4.1 " ,
261+ model_name = " gpt-5.4 " ,
262262 tools = [get_stock_price],
263263 max_loops = 3 ,
264264)
@@ -270,7 +270,7 @@ result = agent.run("What is the current price of Apple and Microsoft?")
270270``` python
271271agent = Agent(
272272 agent_name = " ResearchAgent" ,
273- model_name = " gpt-4.1 " ,
273+ model_name = " gpt-5.4 " ,
274274 tools = [search_web, get_stock_price, read_file, write_file],
275275 max_loops = " auto" ,
276276)
@@ -298,7 +298,7 @@ schema = base_model_to_openai_function(WeatherQuery)
298298``` python
299299agent = Agent(
300300 agent_name = " Writer" ,
301- model_name = " gpt-4.1 " ,
301+ model_name = " gpt-5.4 " ,
302302 streaming_on = True ,
303303)
304304agent.run(" Write a short poem about distributed systems." )
@@ -312,7 +312,7 @@ def handle_token(token: str) -> None:
312312
313313agent = Agent(
314314 agent_name = " Writer" ,
315- model_name = " gpt-4.1 " ,
315+ model_name = " gpt-5.4 " ,
316316 streaming_callback = handle_token,
317317)
318318agent.run(" Write a haiku." )
@@ -324,7 +324,7 @@ agent.run("Write a haiku.")
324324import asyncio
325325from swarms import Agent
326326
327- agent = Agent(agent_name = " AsyncWriter" , model_name = " gpt-4.1 " , streaming_on = True )
327+ agent = Agent(agent_name = " AsyncWriter" , model_name = " gpt-5.4 " , streaming_on = True )
328328
329329async def main ():
330330 async for token in agent.arun_stream(" Explain async/await in Python." ):
@@ -344,9 +344,9 @@ Agents execute **one after another**. The output of each agent is passed as cont
344344``` python
345345from swarms import Agent, SequentialWorkflow
346346
347- researcher = Agent(agent_name = " Researcher" , model_name = " gpt-4.1 " , max_loops = 1 )
348- analyst = Agent(agent_name = " Analyst" , model_name = " gpt-4.1 " , max_loops = 1 )
349- writer = Agent(agent_name = " Writer" , model_name = " gpt-4.1 " , max_loops = 1 )
347+ researcher = Agent(agent_name = " Researcher" , model_name = " gpt-5.4 " , max_loops = 1 )
348+ analyst = Agent(agent_name = " Analyst" , model_name = " gpt-5.4 " , max_loops = 1 )
349+ writer = Agent(agent_name = " Writer" , model_name = " gpt-5.4 " , max_loops = 1 )
350350
351351pipeline = SequentialWorkflow(
352352 agents = [researcher, analyst, writer],
@@ -367,7 +367,7 @@ All agents run **in parallel** on the same task. Results are collected and retur
367367from swarms import Agent, ConcurrentWorkflow
368368
369369agents = [
370- Agent(agent_name = f " Worker- { i} " , model_name = " gpt-4.1 " , max_loops = 1 )
370+ Agent(agent_name = f " Worker- { i} " , model_name = " gpt-5.4 " , max_loops = 1 )
371371 for i in range (5 )
372372]
373373
@@ -386,10 +386,10 @@ Define execution flow as a string using a simple DSL. Mix sequential (`->`) and
386386``` python
387387from swarms import Agent, AgentRearrange
388388
389- planner = Agent(agent_name = " Planner" , model_name = " gpt-4.1 " , max_loops = 1 )
390- coder = Agent(agent_name = " Coder" , model_name = " gpt-4.1 " , max_loops = 1 )
391- reviewer = Agent(agent_name = " Reviewer" , model_name = " gpt-4.1 " , max_loops = 1 )
392- tester = Agent(agent_name = " Tester" , model_name = " gpt-4.1 " , max_loops = 1 )
389+ planner = Agent(agent_name = " Planner" , model_name = " gpt-5.4 " , max_loops = 1 )
390+ coder = Agent(agent_name = " Coder" , model_name = " gpt-5.4 " , max_loops = 1 )
391+ reviewer = Agent(agent_name = " Reviewer" , model_name = " gpt-5.4 " , max_loops = 1 )
392+ tester = Agent(agent_name = " Tester" , model_name = " gpt-5.4 " , max_loops = 1 )
393393
394394pipeline = AgentRearrange(
395395 agents = [planner, coder, reviewer, tester],
@@ -471,9 +471,9 @@ wf.add_edge(Edge(source="researcher", target="editor"))
471471from swarms import Agent, SwarmRouter
472472
473473agents = [
474- Agent(agent_name = " Analyst" , model_name = " gpt-4.1 " , max_loops = 1 ),
475- Agent(agent_name = " Writer" , model_name = " gpt-4.1 " , max_loops = 1 ),
476- Agent(agent_name = " Reviewer" , model_name = " gpt-4.1 " , max_loops = 1 ),
474+ Agent(agent_name = " Analyst" , model_name = " gpt-5.4 " , max_loops = 1 ),
475+ Agent(agent_name = " Writer" , model_name = " gpt-5.4 " , max_loops = 1 ),
476+ Agent(agent_name = " Reviewer" , model_name = " gpt-5.4 " , max_loops = 1 ),
477477]
478478
479479router = SwarmRouter(
@@ -516,14 +516,14 @@ Multiple **worker** agents each respond to the task independently, then an **agg
516516from swarms import Agent, MixtureOfAgents
517517
518518workers = [
519- Agent(agent_name = " Worker-GPT" , model_name = " gpt-4.1 " , max_loops = 1 ),
519+ Agent(agent_name = " Worker-GPT" , model_name = " gpt-5.4 " , max_loops = 1 ),
520520 Agent(agent_name = " Worker-Claude" , model_name = " claude-sonnet-4-6" , max_loops = 1 ),
521521 Agent(agent_name = " Worker-Llama" , model_name = " groq/llama-3.3-70b-versatile" , max_loops = 1 ),
522522]
523523
524524aggregator = Agent(
525525 agent_name = " Aggregator" ,
526- model_name = " gpt-4.1 " ,
526+ model_name = " gpt-5.4 " ,
527527 system_prompt = " Synthesise the following expert responses into one coherent answer." ,
528528 max_loops = 1 ,
529529)
@@ -551,7 +551,7 @@ from swarms import Agent, HierarchicalSwarm
551551director = Agent(
552552 agent_name = " Director" ,
553553 agent_description = " Breaks complex tasks into subtasks and delegates them." ,
554- model_name = " gpt-4.1 " ,
554+ model_name = " gpt-5.4 " ,
555555 max_loops = 1 ,
556556)
557557
@@ -586,23 +586,23 @@ from swarms.structs.groupchat import GroupChat, RESPOND_TOOL
586586optimist = Agent(
587587 agent_name = " Optimist" ,
588588 system_prompt = " You argue for the benefits." ,
589- model_name = " gpt-4.1 " ,
589+ model_name = " gpt-5.4 " ,
590590 max_loops = 1 ,
591591 persistent_memory = False ,
592592 tools_list_dictionary = [RESPOND_TOOL ],
593593)
594594pessimist = Agent(
595595 agent_name = " Pessimist" ,
596596 system_prompt = " You argue for the risks." ,
597- model_name = " gpt-4.1 " ,
597+ model_name = " gpt-5.4 " ,
598598 max_loops = 1 ,
599599 persistent_memory = False ,
600600 tools_list_dictionary = [RESPOND_TOOL ],
601601)
602602realist = Agent(
603603 agent_name = " Realist" ,
604604 system_prompt = " You seek balanced analysis." ,
605- model_name = " gpt-4.1 " ,
605+ model_name = " gpt-5.4 " ,
606606 max_loops = 1 ,
607607 persistent_memory = False ,
608608 tools_list_dictionary = [RESPOND_TOOL ],
@@ -649,15 +649,15 @@ A council of agents each deliberate, then a judge agent makes the final ruling b
649649from swarms import Agent, CouncilAsAJudge
650650
651651council = [
652- Agent(agent_name = " Expert-Security" , model_name = " gpt-4.1 " , max_loops = 1 ),
653- Agent(agent_name = " Expert-Privacy" , model_name = " gpt-4.1 " , max_loops = 1 ),
654- Agent(agent_name = " Expert-Legal" , model_name = " gpt-4.1 " , max_loops = 1 ),
652+ Agent(agent_name = " Expert-Security" , model_name = " gpt-5.4 " , max_loops = 1 ),
653+ Agent(agent_name = " Expert-Privacy" , model_name = " gpt-5.4 " , max_loops = 1 ),
654+ Agent(agent_name = " Expert-Legal" , model_name = " gpt-5.4 " , max_loops = 1 ),
655655]
656656
657657judge = Agent(
658658 agent_name = " Judge" ,
659659 system_prompt = " Given the council's analysis, deliver a final verdict." ,
660- model_name = " gpt-4.1 " ,
660+ model_name = " gpt-5.4 " ,
661661 max_loops = 1 ,
662662)
663663
@@ -678,13 +678,13 @@ Two or more agents argue opposing positions for multiple rounds. A judge deliver
678678``` python
679679from swarms import Agent, DebateWithJudge
680680
681- pro = Agent(agent_name = " Pro" , system_prompt = " Argue strongly in favour." , model_name = " gpt-4.1 " , max_loops = 1 )
682- con = Agent(agent_name = " Con" , system_prompt = " Argue strongly against." , model_name = " gpt-4.1 " , max_loops = 1 )
681+ pro = Agent(agent_name = " Pro" , system_prompt = " Argue strongly in favour." , model_name = " gpt-5.4 " , max_loops = 1 )
682+ con = Agent(agent_name = " Con" , system_prompt = " Argue strongly against." , model_name = " gpt-5.4 " , max_loops = 1 )
683683
684684judge = Agent(
685685 agent_name = " Judge" ,
686686 system_prompt = " Evaluate the debate and deliver an objective verdict." ,
687- model_name = " gpt-4.1 " ,
687+ model_name = " gpt-5.4 " ,
688688 max_loops = 1 ,
689689)
690690
@@ -707,7 +707,7 @@ from swarms import HeavySwarm
707707
708708swarm = HeavySwarm(
709709 num_agents = 4 ,
710- model_name = " gpt-4.1 " ,
710+ model_name = " gpt-5.4 " ,
711711 loops_per_agent = 5 , # each agent reasons for 5 loops
712712 show_output = True ,
713713)
@@ -719,7 +719,7 @@ Or via `SwarmRouter`:
719719``` python
720720from swarms import Agent, SwarmRouter
721721
722- agents = [Agent(agent_name = f " Deep- { i} " , model_name = " gpt-4.1 " , max_loops = 5 ) for i in range (4 )]
722+ agents = [Agent(agent_name = f " Deep- { i} " , model_name = " gpt-5.4 " , max_loops = 5 ) for i in range (4 )]
723723router = SwarmRouter(agents = agents, swarm_type = " HeavySwarm" )
724724result = router.run(" Deep analysis: implications of AGI on global labour markets." )
725725```
@@ -757,7 +757,7 @@ from swarms import Agent, PlannerWorkerSwarm
757757planner = Agent(
758758 agent_name = " Planner" ,
759759 system_prompt = " You create detailed, step-by-step execution plans." ,
760- model_name = " gpt-4.1 " ,
760+ model_name = " gpt-5.4 " ,
761761 max_loops = 1 ,
762762)
763763
@@ -825,7 +825,7 @@ results = asyncio.run(run_agents_concurrently_async(agents=agents, task="..."))
825825import asyncio
826826from swarms import Agent
827827
828- agent = Agent(agent_name = " AsyncAgent" , model_name = " gpt-4.1 " )
828+ agent = Agent(agent_name = " AsyncAgent" , model_name = " gpt-5.4 " )
829829
830830async def main ():
831831 # Standard async run
@@ -851,15 +851,15 @@ from swarms import Agent
851851# Single MCP server
852852agent = Agent(
853853 agent_name = " MCPAgent" ,
854- model_name = " gpt-4.1 " ,
854+ model_name = " gpt-5.4 " ,
855855 mcp_url = " http://localhost:8000/sse" , # SSE endpoint
856856 max_loops = " auto" ,
857857)
858858
859859# Multiple MCP servers
860860agent = Agent(
861861 agent_name = " MultiMCPAgent" ,
862- model_name = " gpt-4.1 " ,
862+ model_name = " gpt-5.4 " ,
863863 mcp_urls = [
864864 " http://localhost:8000/sse" ,
865865 " http://localhost:8001/sse" ,
@@ -908,7 +908,7 @@ conv.compact(summary="User asked basic arithmetic. Answer: 4.")
908908# Pass to an agent
909909agent = Agent(
910910 agent_name = " MyAgent" ,
911- model_name = " gpt-4.1 " ,
911+ model_name = " gpt-5.4 " ,
912912 # agent reads MEMORY.md automatically when persistent_memory=True
913913)
914914```
@@ -945,9 +945,9 @@ agent = Agent(
945945from swarms import Agent, SequentialWorkflow
946946
947947pipeline = SequentialWorkflow(agents = [
948- Agent(agent_name = " Researcher" , system_prompt = " You research topics thoroughly." , model_name = " gpt-4.1 " ),
949- Agent(agent_name = " Writer" , system_prompt = " You write clear, engaging content." , model_name = " gpt-4.1 " ),
950- Agent(agent_name = " Editor" , system_prompt = " You improve clarity and fix errors." , model_name = " gpt-4.1 " ),
948+ Agent(agent_name = " Researcher" , system_prompt = " You research topics thoroughly." , model_name = " gpt-5.4 " ),
949+ Agent(agent_name = " Writer" , system_prompt = " You write clear, engaging content." , model_name = " gpt-5.4 " ),
950+ Agent(agent_name = " Editor" , system_prompt = " You improve clarity and fix errors." , model_name = " gpt-5.4 " ),
951951], max_loops = 1 )
952952
953953result = pipeline.run(" Write an article about the history of neural networks." )
@@ -959,11 +959,11 @@ result = pipeline.run("Write an article about the history of neural networks.")
959959from swarms import Agent, MixtureOfAgents
960960
961961specialists = [
962- Agent(agent_name = " TechExpert" , system_prompt = " Analyse the technical aspects." , model_name = " gpt-4.1 " ),
963- Agent(agent_name = " BusinessExpert" ,system_prompt = " Analyse the business aspects." , model_name = " gpt-4.1 " ),
964- Agent(agent_name = " LegalExpert" , system_prompt = " Analyse the legal aspects." , model_name = " gpt-4.1 " ),
962+ Agent(agent_name = " TechExpert" , system_prompt = " Analyse the technical aspects." , model_name = " gpt-5.4 " ),
963+ Agent(agent_name = " BusinessExpert" ,system_prompt = " Analyse the business aspects." , model_name = " gpt-5.4 " ),
964+ Agent(agent_name = " LegalExpert" , system_prompt = " Analyse the legal aspects." , model_name = " gpt-5.4 " ),
965965]
966- synthesiser = Agent(agent_name = " Synthesiser" , model_name = " gpt-4.1 " ,
966+ synthesiser = Agent(agent_name = " Synthesiser" , model_name = " gpt-5.4 " ,
967967 system_prompt = " Combine expert analyses into one coherent report." )
968968
969969moa = MixtureOfAgents(agents = specialists, aggregator_agent = synthesiser)
@@ -989,7 +989,7 @@ def write_file(filename: str, content: str) -> str:
989989
990990agent = Agent(
991991 agent_name = " AutonomousResearcher" ,
992- model_name = " gpt-4.1 " ,
992+ model_name = " gpt-5.4 " ,
993993 max_loops = " auto" ,
994994 tools = [search_web, write_file],
995995 persistent_memory = True ,
@@ -1006,7 +1006,7 @@ import sys
10061006from swarms import Agent, ConcurrentWorkflow
10071007
10081008agents = [
1009- Agent(agent_name = " GPT" , model_name = " gpt-4.1 " , max_loops = 1 ),
1009+ Agent(agent_name = " GPT" , model_name = " gpt-5.4 " , max_loops = 1 ),
10101010 Agent(agent_name = " Claude" , model_name = " claude-sonnet-4-6" , max_loops = 1 ),
10111011 Agent(agent_name = " Gemini" , model_name = " gemini/gemini-2.5-pro" , max_loops = 1 ),
10121012]
@@ -1029,8 +1029,8 @@ def human_input(response: str) -> str:
10291029
10301030pipeline = AgentRearrange(
10311031 agents = [
1032- Agent(agent_name = " Drafter" , model_name = " gpt-4.1 " ),
1033- Agent(agent_name = " Finisher" , model_name = " gpt-4.1 " ),
1032+ Agent(agent_name = " Drafter" , model_name = " gpt-5.4 " ),
1033+ Agent(agent_name = " Finisher" , model_name = " gpt-5.4 " ),
10341034 ],
10351035 flow = " Drafter -> H -> Finisher" ,
10361036 human_in_the_loop = True ,
@@ -1047,7 +1047,7 @@ from swarms import Agent, GraphWorkflow, Node, Edge, NodeType
10471047ingestion = Agent(agent_name = " Ingestion" , model_name = " gpt-5.4-mini" , max_loops = 1 )
10481048branch_a = Agent(agent_name = " BranchA" , model_name = " gpt-5.4-mini" , max_loops = 1 )
10491049branch_b = Agent(agent_name = " BranchB" , model_name = " gpt-5.4-mini" , max_loops = 1 )
1050- merger = Agent(agent_name = " Merger" , model_name = " gpt-4.1 " , max_loops = 1 )
1050+ merger = Agent(agent_name = " Merger" , model_name = " gpt-5.4 " , max_loops = 1 )
10511051
10521052wf = GraphWorkflow()
10531053for a in [ingestion, branch_a, branch_b, merger]:
0 commit comments