open-swarm 0.1.1748636259__tar.gz → 0.1.1748636455__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. open_swarm-0.1.1748636455/PKG-INFO +261 -0
  2. open_swarm-0.1.1748636455/README.md +219 -0
  3. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/pyproject.toml +1 -3
  4. open_swarm-0.1.1748636455/src/open_swarm.egg-info/PKG-INFO +261 -0
  5. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/open_swarm.egg-info/SOURCES.txt +7 -0
  6. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/open_swarm.egg-info/requires.txt +0 -2
  7. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/__init__.py +2 -0
  8. open_swarm-0.1.1748636455/src/swarm/core.py +411 -0
  9. open_swarm-0.1.1748636455/src/swarm/extensions/blueprint/agent_utils.py +45 -0
  10. open_swarm-0.1.1748636455/src/swarm/extensions/blueprint/blueprint_base.py +562 -0
  11. open_swarm-0.1.1748636455/src/swarm/extensions/blueprint/django_utils.py +203 -0
  12. open_swarm-0.1.1748636455/src/swarm/extensions/blueprint/interactive_mode.py +107 -0
  13. open_swarm-0.1.1748636455/src/swarm/extensions/blueprint/output_utils.py +82 -0
  14. open_swarm-0.1.1748636455/src/swarm/extensions/config/config_loader.py +352 -0
  15. open_swarm-0.1.1748636455/src/swarm/extensions/mcp/__init__.py +1 -0
  16. open_swarm-0.1.1748636455/src/swarm/extensions/mcp/cache_utils.py +32 -0
  17. open_swarm-0.1.1748636455/src/swarm/extensions/mcp/mcp_client.py +233 -0
  18. open_swarm-0.1.1748636455/src/swarm/extensions/mcp/mcp_tool_provider.py +135 -0
  19. open_swarm-0.1.1748636455/src/swarm/extensions/mcp/mcp_utils.py +260 -0
  20. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/llm/chat_completion.py +19 -48
  21. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/settings.py +106 -70
  22. open_swarm-0.1.1748636455/src/swarm/types.py +91 -0
  23. open_swarm-0.1.1748636455/src/swarm/views/chat_views.py +83 -0
  24. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/views/utils.py +1 -3
  25. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_blueprint_base_unit.py +1 -1
  26. open_swarm-0.1.1748636455/tests/test_chat.py +190 -0
  27. open_swarm-0.1.1748636455/tests/test_config_loader.py +166 -0
  28. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_core_chatmessage.py +1 -1
  29. open_swarm-0.1.1748636455/tests/test_swarm_init.py +31 -0
  30. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_swarm_types.py +1 -1
  31. open_swarm-0.1.1748636259/PKG-INFO +0 -188
  32. open_swarm-0.1.1748636259/README.md +0 -144
  33. open_swarm-0.1.1748636259/src/open_swarm.egg-info/PKG-INFO +0 -188
  34. open_swarm-0.1.1748636259/src/swarm/extensions/blueprint/agent_utils.py +0 -21
  35. open_swarm-0.1.1748636259/src/swarm/extensions/blueprint/blueprint_base.py +0 -458
  36. open_swarm-0.1.1748636259/src/swarm/extensions/blueprint/django_utils.py +0 -305
  37. open_swarm-0.1.1748636259/src/swarm/extensions/blueprint/interactive_mode.py +0 -102
  38. open_swarm-0.1.1748636259/src/swarm/extensions/blueprint/output_utils.py +0 -95
  39. open_swarm-0.1.1748636259/src/swarm/extensions/config/config_loader.py +0 -208
  40. open_swarm-0.1.1748636259/src/swarm/views/chat_views.py +0 -76
  41. open_swarm-0.1.1748636259/tests/test_chat.py +0 -153
  42. open_swarm-0.1.1748636259/tests/test_config_loader.py +0 -369
  43. open_swarm-0.1.1748636259/tests/test_swarm_init.py +0 -66
  44. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/LICENSE +0 -0
  45. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/setup.cfg +0 -0
  46. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/open_swarm.egg-info/dependency_links.txt +0 -0
  47. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/open_swarm.egg-info/entry_points.txt +0 -0
  48. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/open_swarm.egg-info/top_level.txt +0 -0
  49. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/agent/__init__.py +0 -0
  50. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/agent/agent.py +0 -0
  51. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/apps.py +0 -0
  52. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/auth.py +0 -0
  53. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/consumers.py +0 -0
  54. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/__init__.py +0 -0
  55. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/blueprint/__init__.py +0 -0
  56. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/blueprint/blueprint_discovery.py +0 -0
  57. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/blueprint/blueprint_utils.py +0 -0
  58. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/blueprint/common_utils.py +0 -0
  59. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/blueprint/modes/rest_mode.py +0 -0
  60. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/blueprint/spinner.py +0 -0
  61. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/__init__.py +0 -0
  62. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/blueprint_runner.py +0 -0
  63. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/cli_args.py +0 -0
  64. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/commands/__init__.py +0 -0
  65. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/commands/blueprint_management.py +0 -0
  66. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/commands/config_management.py +0 -0
  67. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/commands/edit_config.py +0 -0
  68. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/commands/list_blueprints.py +0 -0
  69. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/commands/validate_env.py +0 -0
  70. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/commands/validate_envvars.py +0 -0
  71. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/interactive_shell.py +0 -0
  72. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/main.py +0 -0
  73. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/selection.py +0 -0
  74. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/utils/discover_commands.py +0 -0
  75. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/utils/env_setup.py +0 -0
  76. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/cli/utils.py +0 -0
  77. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/config/__init__.py +0 -0
  78. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/config/config_manager.py +0 -0
  79. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/config/server_config.py +0 -0
  80. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/config/setup_wizard.py +0 -0
  81. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/config/utils/__init__.py +0 -0
  82. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/config/utils/logger.py +0 -0
  83. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/launchers/__init__.py +0 -0
  84. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/launchers/build_launchers.py +0 -0
  85. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/launchers/build_swarm_wrapper.py +0 -0
  86. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/launchers/swarm_api.py +0 -0
  87. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/launchers/swarm_cli.py +0 -0
  88. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/extensions/launchers/swarm_wrapper.py +0 -0
  89. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/messages.py +0 -0
  90. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/migrations/0010_initial_chat_models.py +0 -0
  91. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/migrations/__init__.py +0 -0
  92. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/models.py +0 -0
  93. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/repl/__init__.py +0 -0
  94. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/repl/repl.py +0 -0
  95. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/serializers.py +0 -0
  96. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/tool_executor.py +0 -0
  97. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/urls.py +0 -0
  98. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/util.py +0 -0
  99. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/color_utils.py +0 -0
  100. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/context_utils.py +0 -0
  101. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/general_utils.py +0 -0
  102. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/logger.py +0 -0
  103. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/logger_setup.py +0 -0
  104. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/message_sequence.py +0 -0
  105. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/message_utils.py +0 -0
  106. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/utils/redact.py +0 -0
  107. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/views/__init__.py +0 -0
  108. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/views/api_views.py +0 -0
  109. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/views/core_views.py +0 -0
  110. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/views/message_views.py +0 -0
  111. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/views/model_views.py +0 -0
  112. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/views/web_views.py +0 -0
  113. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/src/swarm/wsgi.py +0 -0
  114. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_apps.py +0 -0
  115. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_blueprint_base.py +0 -0
  116. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_blueprint_discovery.py +0 -0
  117. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_blueprint_filter.py +0 -0
  118. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_blueprint_loading.py +0 -0
  119. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_blueprint_runner.py +0 -0
  120. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_blueprints.py +0 -0
  121. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_cli_mode_selection.py +0 -0
  122. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_core_filter_duplicate_system_messages.py +0 -0
  123. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_core_filter_messages.py +0 -0
  124. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_core_truncate_message_history.py +0 -0
  125. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_core_update_null_content.py +0 -0
  126. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_dummy.py +0 -0
  127. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_list_models.py +0 -0
  128. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_message_sequence.py +0 -0
  129. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_models.py +0 -0
  130. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_openai_api_key_handling.py +0 -0
  131. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_redact.py +0 -0
  132. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_resource_timeout.py +0 -0
  133. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_settings.py +0 -0
  134. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_setup_wizard.py +0 -0
  135. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_truncate_message_history.py +0 -0
  136. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_util.py +0 -0
  137. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_utils_coverage.py +0 -0
  138. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_views.py +0 -0
  139. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636455}/tests/test_wsgi.py +0 -0
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: open-swarm
3
+ Version: 0.1.1748636455
4
+ Summary: A tool for orchestrating Swarm using both CLI and API.
5
+ Author-email: Matthew Hand <matthewhandau@gmail.com>
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: aiofiles>=24.1.0
10
+ Requires-Dist: aiohttp>=3.11.11
11
+ Requires-Dist: asyncio>=3.4.3
12
+ Requires-Dist: asynctest>=0.13.0
13
+ Requires-Dist: channels>=4.2.0
14
+ Requires-Dist: colorama>=0.4.6
15
+ Requires-Dist: django<5.0,>=4.2
16
+ Requires-Dist: django-allauth>=65.3.1
17
+ Requires-Dist: django-template-debug>=0.3.5
18
+ Requires-Dist: djangorestframework>=3.15.2
19
+ Requires-Dist: flask>=3.1.0
20
+ Requires-Dist: jmespath>=1.0.1
21
+ Requires-Dist: jsonschema-pydantic>=0.6
22
+ Requires-Dist: mcp>=1.2.0
23
+ Requires-Dist: openai>=1.58.1
24
+ Requires-Dist: python-dotenv>=1.0.1
25
+ Requires-Dist: redis>=5.2.1
26
+ Requires-Dist: requests>=2.32.3
27
+ Requires-Dist: whitenoise>=6.8.2
28
+ Requires-Dist: drf-spectacular>=0.23.0
29
+ Requires-Dist: pyinstaller>=6.12.0
30
+ Requires-Dist: tiktoken>=0.9.0
31
+ Requires-Dist: django-cors-headers>=4.7.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=8.3.4; extra == "dev"
34
+ Requires-Dist: pytest-asyncio>=0.25.1; extra == "dev"
35
+ Requires-Dist: pytest-cov>=6.0.0; extra == "dev"
36
+ Requires-Dist: pytest-django>=4.9.0; extra == "dev"
37
+ Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
38
+ Requires-Dist: python-semantic-release>=9.20.0; extra == "dev"
39
+ Provides-Extra: experimental
40
+ Requires-Dist: nemoguardrails>=0.11.0; extra == "experimental"
41
+ Dynamic: license-file
42
+
43
+ > **DISCLAIMER:** This project is no longer relevant. OpenAI has released **openai-agents**, the successor to **swarm**.
44
+ >
45
+ > For experimental integration of Open Swarm features with OpenAI Agents (hosting agents as completion endpoints, running the same blueprints from the CLI, per-agent model/provider configuration, etc.), see the `experimental` branch.
46
+
47
+ # Open Swarm
48
+
49
+ <div align="center">
50
+ <img src="assets/images/openswarm-project-image.jpg" alt="Project Logo" width="70%"/>
51
+ </div>
52
+
53
+ **Open Swarm** is a versatile, modular framework for building intelligent, multi-agent systems. It's a **fork and actively maintained extension** of the [OpenAI Swarm](https://github.com/openai/swarm) framework. It includes modifications to support stateless RESTful operations and a plugin system for custom extensions that enhance agentic workflows.
54
+
55
+ ---
56
+
57
+ https://github.com/user-attachments/assets/1335f7fb-ff61-4e96-881c-7d3154eb9f14
58
+
59
+ (generated by www.gitpodcast.com)
60
+
61
+ ---
62
+
63
+ ## Table of Contents
64
+ - [Key Features](#key-features)
65
+ - [Quickstart](#quickstart)
66
+ - [Blueprints](#blueprints)
67
+ - [Further Documentation](#further-documentation)
68
+ - [License](#license)
69
+ - [Acknowledgements](#acknowledgements)
70
+
71
+ ---
72
+
73
+ ## Key Features
74
+
75
+ 1. **Multi-Agent Orchestration**
76
+ - Define multiple agents, each with unique instructions and roles.
77
+ - Agents coordinate tasks, share context, or hand off queries between one another.
78
+
79
+ 2. **Blueprint-Driven Architecture**
80
+ - Each **Blueprint** encapsulates logic, tool connections, and environment/config settings.
81
+ - Encourages reusable, modular patterns for different use cases.
82
+
83
+ 3. **Optional MCP Integration**
84
+ - Integrate with external tools (e.g., databases, web search, filesystems) through **MCP servers**.
85
+ - Note `npx` MCP servers work great but `uvx` MCP servers currently have issues.
86
+
87
+ 4. **CLI & REST Interface**
88
+ - Run from the command line or expose a Django-powered REST API for broader integration.
89
+ - Interactive web pages per blueprint at `/<blueprint_name>/`.
90
+
91
+ 5. **OpenAI API Compatibility**
92
+ - Exposes an endpoint at `/v1/chat/completions` that is functionally similar to the OpenAI Chat Completions API.
93
+ - Includes a **mandatory** `sender` field in agent responses.
94
+ - This field identifies which Swarm agent provided the response and must be preserved in the conversation history for proper handoffs between agents.
95
+ - While the framework is compatible with OpenAI-like API clients, it assumes the client application maintains the `sender` field and, ideally, displays it in the user interface.
96
+ - **Note:** Most OpenAI API-compatible applications will ignore the `sender` field by default and not display the agent name. Custom UI or logic is required to utilise and present this information.
97
+
98
+ 6. **Configurable LLMs**
99
+ - Supports multiple OpenAI-compatible providers in a single environment (e.g., `openai`, `grok`, `ollama`).
100
+ - Allows specifying different models/providers for different agents—even within the same blueprint.
101
+ - Use environment variable `DEFAULT_LLM` to specify default LLM model used by blueprints, e.g., `DEFAULT_LLM=deepseek-r1-distill-llama-70b`
102
+
103
+ ---
104
+
105
+ ## Quickstart
106
+
107
+ Follow these simple steps to get Open Swarm up and running:
108
+
109
+ 1. **Install the Package**
110
+ Run:
111
+ ```bash
112
+ pip install open-swarm
113
+ ```
114
+
115
+ 2. **Configure an LLM Provider**
116
+ When you run a blueprint for the first time, Open Swarm checks for a configuration file at `~/.swarm/swarm_config.json`. If the file is missing, it will automatically create a default configuration as shown below:
117
+ ```json
118
+ {
119
+ "llm": {
120
+ "default": {
121
+ "provider": "openai",
122
+ "model": "gpt-4o",
123
+ "base_url": "https://api.openai.com/v1",
124
+ "api_key": "${OPENAI_API_KEY}"
125
+ }
126
+ },
127
+ "mcpServers": {}
128
+ }
129
+ ```
130
+ Make sure to set the `OPENAI_API_KEY` environment variable with your valid OpenAI API key.
131
+
132
+ An example of using an alternative provider:
133
+
134
+ `swarm-cli config add --section llm --name deepseek-r1-distill-llama-70b --json '{"provider": "openai", "model": "deepseek-r1-distill-llama-70b", "base_url": "https://api.groq.com/openai/v1", "api_key": "${GROQ_API_KEY}"}' `
135
+
136
+
137
+ 3. **(Optional) Configure a Simple MCP Server**
138
+ To add an MCP server for additional utilities (e.g., file fetching), use the `swarm-cli config add --json '<multiline_json_block>'`. For example:
139
+
140
+ ```json
141
+ "filesystem": {
142
+ "command": "npx",
143
+ "args": [
144
+ "-y",
145
+ "@modelcontextprotocol/server-filesystem ${ALLOWED_PATH}"
146
+ ],
147
+ "env": {
148
+ "ALLOWED_PATH": "${ALLOWED_PATH}"
149
+ }
150
+ }
151
+ ```
152
+
153
+ 4. **Add an Example Blueprint**
154
+ Add an example blueprint by running:
155
+ ```bash
156
+ swarm-cli add /path/to/your/blueprint.py --name example
157
+ ```
158
+ This copies your blueprint into the managed blueprints directory.
159
+
160
+ Example blueprints are provided here: https://github.com/matthewhand/open-swarm/tree/main/blueprints
161
+
162
+ 5. **Run the Blueprint from CLI**
163
+ Execute the blueprint with:
164
+ ```bash
165
+ swarm-cli run example
166
+ ```
167
+
168
+ ---
169
+
170
+ ## Overview
171
+
172
+ Open Swarm provides the following core components:
173
+
174
+ - **Swarm CLI:**
175
+ A command-line tool for managing blueprints and configuration settings. It allows you to add, list, delete, run, and install blueprints, as well as update configuration entries for LLM providers and MCP servers.
176
+
177
+ - **Swarm API:**
178
+ An HTTP REST service that exposes endpoints such as `/v1/models` and `/v1/chat/completion(s)`. These endpoints let external applications interact with Open Swarm in an OpenAI API-compatible manner, publishing blueprints as models and processing chat completions. Additional endpoints can be exposed via blueprints.
179
+
180
+ - **Swarm SDK:**
181
+ Open Swarm can be used as a Python module. It is backwards compatible with the original OpenAI Swarm educational framework. It also adds many extensions including configuration loading, MCP server integration, Python Django DB and REST features, etc etc.
182
+
183
+ For detailed usage instructions, please refer to the [USERGUIDE.md](./USERGUIDE.md). For developer-specific guidance, see [DEVELOPMENT.md](./DEVELOPMENT.md).
184
+
185
+ ---
186
+
187
+
188
+ ## Blueprints
189
+
190
+ A **Blueprint** is a Python module that wraps:
191
+
192
+ - **Agent Logic**: Defines how each agent in the Swarm processes user messages, whether it calls tools, and how it decides to hand off to other agents.
193
+ - **Tools**: Specifies which agents have which tools (e.g., MCP-discovered tools, Python function calls).
194
+ - **Environment & Configuration**: Ensures required environment variables and JSON configs are validated prior to agent execution.
195
+
196
+ Once registered, a blueprint is discoverable at runtime, allowing the system to list and load agents on demand.
197
+
198
+ ### Personal Assistant Example
199
+
200
+ The **Personal Assistant Blueprint** demonstrates a hybrid approach, integrating **local Python function tools** with **MCP-discovered tools**. It consists of:
201
+
202
+ 1. **Personal Assistant Agent**
203
+ - Determines user intent and delegates queries accordingly.
204
+ - Routes weather-related queries to the `WeatherAgent`.
205
+ - Routes knowledge-based queries to the `DocumentationAgent`.
206
+
207
+ 2. **Weather Agent** (Uses Python Function Tools)
208
+ - Fetches current weather and forecasts via OpenWeatherMap.
209
+ - Uses a **locally defined Python function** rather than an MCP server.
210
+ - Requires `WEATHER_API_KEY` as an environment variable.
211
+
212
+ 3. **Documentation Agent** (Uses MCP-Discovered Tools)
213
+ - Retrieves relevant documentation via `rag-docs`.
214
+ - Uses the MCP function `search_documentation` to dynamically retrieve information.
215
+ - Requires the following environment variables:
216
+ - `OPENAI_API_KEY`
217
+ - `QDRANT_URL`
218
+ - `QDRANT_API_KEY`
219
+
220
+ This blueprint highlights **seamless multi-agent coordination** and the **flexibility of combining Python functions with MCP-discovered tools**.
221
+
222
+ ### Other Examples
223
+
224
+ Open Swarm includes a growing library of **Blueprint** examples:
225
+
226
+ | Blueprint Name | Description | Status |
227
+ |------------------------------|-----------------------------------------------------------------------------|-----------------------------------------|
228
+ | **Echo Blueprint** | A straightforward agent that simply echoes user inputs—ideal for testing or as a starter template. | Stable |
229
+ | **Suggestion Blueprint** | Blueprint providing suggestions and recommendations. | Stable |
230
+ | **Database and Web Blueprint** | Demonstrates MCP-based integration with an SQLite database and Brave Search, illustrating how to combine data retrieval with real-time web queries. | Stable |
231
+ | **University Blueprint** | Multi-agent system for university-related tasks. | Stable |
232
+ | **Divine Ops Blueprint** | Multi-agent system for handling system administration tasks using MCP tools (filesystem, SQLite, search, etc.). | Stable |
233
+ | **Nebucha Shellzzar Blueprint**| Example system administration blueprint. | Stable |
234
+ | **Personal Assistant Blueprint** | Combines real-time weather updates (Python function) with documentation search (`rag-docs`, MCP). Demonstrates mixed tooling. | Broken (uvx-based) |
235
+ | **Flowise Blueprint** | Integrates with Flowise for visual flow orchestration. | Broken (uvx-based, requires Flowise setup)|
236
+
237
+ ---
238
+ ---
239
+
240
+ ## Further Documentation
241
+
242
+ For advanced usage, sequence diagrams, or in-depth tooling examples, see [DEVELOPMENT.md](./DEVELOPMENT.md). Additional expansions and best practices for agent orchestration, LLM provider swapping, and more can be found in that document.
243
+
244
+ ---
245
+
246
+ ## License
247
+
248
+ Open Swarm is provided under the MIT License. Refer to the [LICENSE](LICENSE) file for full details.
249
+
250
+ ---
251
+
252
+ ## Acknowledgements
253
+
254
+ This project is based on the [OpenAI Swarm](https://github.com/openai/swarm) framework. We would like to acknowledge the original authors and contributors of this project for their work.
255
+ We also wish to credit [django_chatbot](https://github.com/MattiPaivike/django_chatbot) for the Django chatbot view.
256
+
257
+ ### Third-Party Libraries
258
+ - **[Marked.js](https://github.com/markedjs/marked)** (MIT License)
259
+ A fast, lightweight library for parsing Markdown into HTML.
260
+ - **[Tabler Icons](https://tablericons.com)** (MIT License)
261
+ A set of free, high-quality SVG icons for web projects, designed by Paweł Kuna.
@@ -0,0 +1,219 @@
1
+ > **DISCLAIMER:** This project is no longer relevant. OpenAI has released **openai-agents**, the successor to **swarm**.
2
+ >
3
+ > For experimental integration of Open Swarm features with OpenAI Agents (hosting agents as completion endpoints, running the same blueprints from the CLI, per-agent model/provider configuration, etc.), see the `experimental` branch.
4
+
5
+ # Open Swarm
6
+
7
+ <div align="center">
8
+ <img src="assets/images/openswarm-project-image.jpg" alt="Project Logo" width="70%"/>
9
+ </div>
10
+
11
+ **Open Swarm** is a versatile, modular framework for building intelligent, multi-agent systems. It's a **fork and actively maintained extension** of the [OpenAI Swarm](https://github.com/openai/swarm) framework. It includes modifications to support stateless RESTful operations and a plugin system for custom extensions that enhance agentic workflows.
12
+
13
+ ---
14
+
15
+ https://github.com/user-attachments/assets/1335f7fb-ff61-4e96-881c-7d3154eb9f14
16
+
17
+ (generated by www.gitpodcast.com)
18
+
19
+ ---
20
+
21
+ ## Table of Contents
22
+ - [Key Features](#key-features)
23
+ - [Quickstart](#quickstart)
24
+ - [Blueprints](#blueprints)
25
+ - [Further Documentation](#further-documentation)
26
+ - [License](#license)
27
+ - [Acknowledgements](#acknowledgements)
28
+
29
+ ---
30
+
31
+ ## Key Features
32
+
33
+ 1. **Multi-Agent Orchestration**
34
+ - Define multiple agents, each with unique instructions and roles.
35
+ - Agents coordinate tasks, share context, or hand off queries between one another.
36
+
37
+ 2. **Blueprint-Driven Architecture**
38
+ - Each **Blueprint** encapsulates logic, tool connections, and environment/config settings.
39
+ - Encourages reusable, modular patterns for different use cases.
40
+
41
+ 3. **Optional MCP Integration**
42
+ - Integrate with external tools (e.g., databases, web search, filesystems) through **MCP servers**.
43
+ - Note `npx` MCP servers work great but `uvx` MCP servers currently have issues.
44
+
45
+ 4. **CLI & REST Interface**
46
+ - Run from the command line or expose a Django-powered REST API for broader integration.
47
+ - Interactive web pages per blueprint at `/<blueprint_name>/`.
48
+
49
+ 5. **OpenAI API Compatibility**
50
+ - Exposes an endpoint at `/v1/chat/completions` that is functionally similar to the OpenAI Chat Completions API.
51
+ - Includes a **mandatory** `sender` field in agent responses.
52
+ - This field identifies which Swarm agent provided the response and must be preserved in the conversation history for proper handoffs between agents.
53
+ - While the framework is compatible with OpenAI-like API clients, it assumes the client application maintains the `sender` field and, ideally, displays it in the user interface.
54
+ - **Note:** Most OpenAI API-compatible applications will ignore the `sender` field by default and not display the agent name. Custom UI or logic is required to utilise and present this information.
55
+
56
+ 6. **Configurable LLMs**
57
+ - Supports multiple OpenAI-compatible providers in a single environment (e.g., `openai`, `grok`, `ollama`).
58
+ - Allows specifying different models/providers for different agents—even within the same blueprint.
59
+ - Use environment variable `DEFAULT_LLM` to specify default LLM model used by blueprints, e.g., `DEFAULT_LLM=deepseek-r1-distill-llama-70b`
60
+
61
+ ---
62
+
63
+ ## Quickstart
64
+
65
+ Follow these simple steps to get Open Swarm up and running:
66
+
67
+ 1. **Install the Package**
68
+ Run:
69
+ ```bash
70
+ pip install open-swarm
71
+ ```
72
+
73
+ 2. **Configure an LLM Provider**
74
+ When you run a blueprint for the first time, Open Swarm checks for a configuration file at `~/.swarm/swarm_config.json`. If the file is missing, it will automatically create a default configuration as shown below:
75
+ ```json
76
+ {
77
+ "llm": {
78
+ "default": {
79
+ "provider": "openai",
80
+ "model": "gpt-4o",
81
+ "base_url": "https://api.openai.com/v1",
82
+ "api_key": "${OPENAI_API_KEY}"
83
+ }
84
+ },
85
+ "mcpServers": {}
86
+ }
87
+ ```
88
+ Make sure to set the `OPENAI_API_KEY` environment variable with your valid OpenAI API key.
89
+
90
+ An example of using an alternative provider:
91
+
92
+ `swarm-cli config add --section llm --name deepseek-r1-distill-llama-70b --json '{"provider": "openai", "model": "deepseek-r1-distill-llama-70b", "base_url": "https://api.groq.com/openai/v1", "api_key": "${GROQ_API_KEY}"}' `
93
+
94
+
95
+ 3. **(Optional) Configure a Simple MCP Server**
96
+ To add an MCP server for additional utilities (e.g., file fetching), use the `swarm-cli config add --json '<multiline_json_block>'`. For example:
97
+
98
+ ```json
99
+ "filesystem": {
100
+ "command": "npx",
101
+ "args": [
102
+ "-y",
103
+ "@modelcontextprotocol/server-filesystem ${ALLOWED_PATH}"
104
+ ],
105
+ "env": {
106
+ "ALLOWED_PATH": "${ALLOWED_PATH}"
107
+ }
108
+ }
109
+ ```
110
+
111
+ 4. **Add an Example Blueprint**
112
+ Add an example blueprint by running:
113
+ ```bash
114
+ swarm-cli add /path/to/your/blueprint.py --name example
115
+ ```
116
+ This copies your blueprint into the managed blueprints directory.
117
+
118
+ Example blueprints are provided here: https://github.com/matthewhand/open-swarm/tree/main/blueprints
119
+
120
+ 5. **Run the Blueprint from CLI**
121
+ Execute the blueprint with:
122
+ ```bash
123
+ swarm-cli run example
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Overview
129
+
130
+ Open Swarm provides the following core components:
131
+
132
+ - **Swarm CLI:**
133
+ A command-line tool for managing blueprints and configuration settings. It allows you to add, list, delete, run, and install blueprints, as well as update configuration entries for LLM providers and MCP servers.
134
+
135
+ - **Swarm API:**
136
+ An HTTP REST service that exposes endpoints such as `/v1/models` and `/v1/chat/completion(s)`. These endpoints let external applications interact with Open Swarm in an OpenAI API-compatible manner, publishing blueprints as models and processing chat completions. Additional endpoints can be exposed via blueprints.
137
+
138
+ - **Swarm SDK:**
139
+ Open Swarm can be used as a Python module. It is backwards compatible with the original OpenAI Swarm educational framework. It also adds many extensions including configuration loading, MCP server integration, Python Django DB and REST features, etc etc.
140
+
141
+ For detailed usage instructions, please refer to the [USERGUIDE.md](./USERGUIDE.md). For developer-specific guidance, see [DEVELOPMENT.md](./DEVELOPMENT.md).
142
+
143
+ ---
144
+
145
+
146
+ ## Blueprints
147
+
148
+ A **Blueprint** is a Python module that wraps:
149
+
150
+ - **Agent Logic**: Defines how each agent in the Swarm processes user messages, whether it calls tools, and how it decides to hand off to other agents.
151
+ - **Tools**: Specifies which agents have which tools (e.g., MCP-discovered tools, Python function calls).
152
+ - **Environment & Configuration**: Ensures required environment variables and JSON configs are validated prior to agent execution.
153
+
154
+ Once registered, a blueprint is discoverable at runtime, allowing the system to list and load agents on demand.
155
+
156
+ ### Personal Assistant Example
157
+
158
+ The **Personal Assistant Blueprint** demonstrates a hybrid approach, integrating **local Python function tools** with **MCP-discovered tools**. It consists of:
159
+
160
+ 1. **Personal Assistant Agent**
161
+ - Determines user intent and delegates queries accordingly.
162
+ - Routes weather-related queries to the `WeatherAgent`.
163
+ - Routes knowledge-based queries to the `DocumentationAgent`.
164
+
165
+ 2. **Weather Agent** (Uses Python Function Tools)
166
+ - Fetches current weather and forecasts via OpenWeatherMap.
167
+ - Uses a **locally defined Python function** rather than an MCP server.
168
+ - Requires `WEATHER_API_KEY` as an environment variable.
169
+
170
+ 3. **Documentation Agent** (Uses MCP-Discovered Tools)
171
+ - Retrieves relevant documentation via `rag-docs`.
172
+ - Uses the MCP function `search_documentation` to dynamically retrieve information.
173
+ - Requires the following environment variables:
174
+ - `OPENAI_API_KEY`
175
+ - `QDRANT_URL`
176
+ - `QDRANT_API_KEY`
177
+
178
+ This blueprint highlights **seamless multi-agent coordination** and the **flexibility of combining Python functions with MCP-discovered tools**.
179
+
180
+ ### Other Examples
181
+
182
+ Open Swarm includes a growing library of **Blueprint** examples:
183
+
184
+ | Blueprint Name | Description | Status |
185
+ |------------------------------|-----------------------------------------------------------------------------|-----------------------------------------|
186
+ | **Echo Blueprint** | A straightforward agent that simply echoes user inputs—ideal for testing or as a starter template. | Stable |
187
+ | **Suggestion Blueprint** | Blueprint providing suggestions and recommendations. | Stable |
188
+ | **Database and Web Blueprint** | Demonstrates MCP-based integration with an SQLite database and Brave Search, illustrating how to combine data retrieval with real-time web queries. | Stable |
189
+ | **University Blueprint** | Multi-agent system for university-related tasks. | Stable |
190
+ | **Divine Ops Blueprint** | Multi-agent system for handling system administration tasks using MCP tools (filesystem, SQLite, search, etc.). | Stable |
191
+ | **Nebucha Shellzzar Blueprint**| Example system administration blueprint. | Stable |
192
+ | **Personal Assistant Blueprint** | Combines real-time weather updates (Python function) with documentation search (`rag-docs`, MCP). Demonstrates mixed tooling. | Broken (uvx-based) |
193
+ | **Flowise Blueprint** | Integrates with Flowise for visual flow orchestration. | Broken (uvx-based, requires Flowise setup)|
194
+
195
+ ---
196
+ ---
197
+
198
+ ## Further Documentation
199
+
200
+ For advanced usage, sequence diagrams, or in-depth tooling examples, see [DEVELOPMENT.md](./DEVELOPMENT.md). Additional expansions and best practices for agent orchestration, LLM provider swapping, and more can be found in that document.
201
+
202
+ ---
203
+
204
+ ## License
205
+
206
+ Open Swarm is provided under the MIT License. Refer to the [LICENSE](LICENSE) file for full details.
207
+
208
+ ---
209
+
210
+ ## Acknowledgements
211
+
212
+ This project is based on the [OpenAI Swarm](https://github.com/openai/swarm) framework. We would like to acknowledge the original authors and contributors of this project for their work.
213
+ We also wish to credit [django_chatbot](https://github.com/MattiPaivike/django_chatbot) for the Django chatbot view.
214
+
215
+ ### Third-Party Libraries
216
+ - **[Marked.js](https://github.com/markedjs/marked)** (MIT License)
217
+ A fast, lightweight library for parsing Markdown into HTML.
218
+ - **[Tabler Icons](https://tablericons.com)** (MIT License)
219
+ A set of free, high-quality SVG icons for web projects, designed by Paweł Kuna.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "open-swarm"
3
- version = "0.1.1748636259"
3
+ version = "0.1.1748636455"
4
4
  description = "A tool for orchestrating Swarm using both CLI and API."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -31,8 +31,6 @@ dependencies = [
31
31
  "pyinstaller>=6.12.0",
32
32
  "tiktoken>=0.9.0",
33
33
  "django-cors-headers>=4.7.0",
34
- "cachetools>=5.5.2",
35
- "openai-agents",
36
34
  ]
37
35
 
38
36
  [project.scripts]