open-swarm 0.1.1748636259__tar.gz → 0.1.1748636295__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.1748636295/PKG-INFO +257 -0
  2. open_swarm-0.1.1748636295/README.md +215 -0
  3. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/pyproject.toml +1 -3
  4. open_swarm-0.1.1748636295/src/open_swarm.egg-info/PKG-INFO +257 -0
  5. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/open_swarm.egg-info/SOURCES.txt +7 -0
  6. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/open_swarm.egg-info/requires.txt +0 -2
  7. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/__init__.py +2 -0
  8. open_swarm-0.1.1748636295/src/swarm/core.py +411 -0
  9. open_swarm-0.1.1748636295/src/swarm/extensions/blueprint/agent_utils.py +45 -0
  10. open_swarm-0.1.1748636295/src/swarm/extensions/blueprint/blueprint_base.py +562 -0
  11. open_swarm-0.1.1748636295/src/swarm/extensions/blueprint/django_utils.py +203 -0
  12. open_swarm-0.1.1748636295/src/swarm/extensions/blueprint/interactive_mode.py +107 -0
  13. open_swarm-0.1.1748636295/src/swarm/extensions/blueprint/output_utils.py +82 -0
  14. open_swarm-0.1.1748636295/src/swarm/extensions/config/config_loader.py +352 -0
  15. open_swarm-0.1.1748636295/src/swarm/extensions/mcp/__init__.py +1 -0
  16. open_swarm-0.1.1748636295/src/swarm/extensions/mcp/cache_utils.py +32 -0
  17. open_swarm-0.1.1748636295/src/swarm/extensions/mcp/mcp_client.py +233 -0
  18. open_swarm-0.1.1748636295/src/swarm/extensions/mcp/mcp_tool_provider.py +135 -0
  19. open_swarm-0.1.1748636295/src/swarm/extensions/mcp/mcp_utils.py +260 -0
  20. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/llm/chat_completion.py +19 -48
  21. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/settings.py +106 -70
  22. open_swarm-0.1.1748636295/src/swarm/types.py +91 -0
  23. open_swarm-0.1.1748636295/src/swarm/views/chat_views.py +83 -0
  24. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/views/utils.py +1 -3
  25. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_blueprint_base_unit.py +1 -1
  26. open_swarm-0.1.1748636295/tests/test_chat.py +190 -0
  27. open_swarm-0.1.1748636295/tests/test_config_loader.py +166 -0
  28. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_core_chatmessage.py +1 -1
  29. open_swarm-0.1.1748636295/tests/test_swarm_init.py +31 -0
  30. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/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.1748636295}/LICENSE +0 -0
  45. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/setup.cfg +0 -0
  46. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/open_swarm.egg-info/dependency_links.txt +0 -0
  47. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/open_swarm.egg-info/entry_points.txt +0 -0
  48. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/open_swarm.egg-info/top_level.txt +0 -0
  49. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/agent/__init__.py +0 -0
  50. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/agent/agent.py +0 -0
  51. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/apps.py +0 -0
  52. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/auth.py +0 -0
  53. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/consumers.py +0 -0
  54. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/__init__.py +0 -0
  55. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/blueprint/__init__.py +0 -0
  56. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/blueprint/blueprint_discovery.py +0 -0
  57. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/blueprint/blueprint_utils.py +0 -0
  58. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/blueprint/common_utils.py +0 -0
  59. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/blueprint/modes/rest_mode.py +0 -0
  60. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/blueprint/spinner.py +0 -0
  61. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/__init__.py +0 -0
  62. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/blueprint_runner.py +0 -0
  63. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/cli_args.py +0 -0
  64. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/commands/__init__.py +0 -0
  65. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/commands/blueprint_management.py +0 -0
  66. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/commands/config_management.py +0 -0
  67. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/commands/edit_config.py +0 -0
  68. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/commands/list_blueprints.py +0 -0
  69. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/commands/validate_env.py +0 -0
  70. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/commands/validate_envvars.py +0 -0
  71. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/interactive_shell.py +0 -0
  72. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/main.py +0 -0
  73. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/selection.py +0 -0
  74. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/utils/discover_commands.py +0 -0
  75. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/utils/env_setup.py +0 -0
  76. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/cli/utils.py +0 -0
  77. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/config/__init__.py +0 -0
  78. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/config/config_manager.py +0 -0
  79. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/config/server_config.py +0 -0
  80. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/config/setup_wizard.py +0 -0
  81. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/config/utils/__init__.py +0 -0
  82. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/config/utils/logger.py +0 -0
  83. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/launchers/__init__.py +0 -0
  84. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/launchers/build_launchers.py +0 -0
  85. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/launchers/build_swarm_wrapper.py +0 -0
  86. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/launchers/swarm_api.py +0 -0
  87. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/launchers/swarm_cli.py +0 -0
  88. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/extensions/launchers/swarm_wrapper.py +0 -0
  89. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/messages.py +0 -0
  90. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/migrations/0010_initial_chat_models.py +0 -0
  91. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/migrations/__init__.py +0 -0
  92. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/models.py +0 -0
  93. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/repl/__init__.py +0 -0
  94. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/repl/repl.py +0 -0
  95. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/serializers.py +0 -0
  96. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/tool_executor.py +0 -0
  97. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/urls.py +0 -0
  98. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/util.py +0 -0
  99. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/color_utils.py +0 -0
  100. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/context_utils.py +0 -0
  101. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/general_utils.py +0 -0
  102. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/logger.py +0 -0
  103. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/logger_setup.py +0 -0
  104. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/message_sequence.py +0 -0
  105. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/message_utils.py +0 -0
  106. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/utils/redact.py +0 -0
  107. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/views/__init__.py +0 -0
  108. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/views/api_views.py +0 -0
  109. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/views/core_views.py +0 -0
  110. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/views/message_views.py +0 -0
  111. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/views/model_views.py +0 -0
  112. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/views/web_views.py +0 -0
  113. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/src/swarm/wsgi.py +0 -0
  114. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_apps.py +0 -0
  115. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_blueprint_base.py +0 -0
  116. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_blueprint_discovery.py +0 -0
  117. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_blueprint_filter.py +0 -0
  118. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_blueprint_loading.py +0 -0
  119. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_blueprint_runner.py +0 -0
  120. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_blueprints.py +0 -0
  121. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_cli_mode_selection.py +0 -0
  122. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_core_filter_duplicate_system_messages.py +0 -0
  123. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_core_filter_messages.py +0 -0
  124. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_core_truncate_message_history.py +0 -0
  125. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_core_update_null_content.py +0 -0
  126. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_dummy.py +0 -0
  127. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_list_models.py +0 -0
  128. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_message_sequence.py +0 -0
  129. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_models.py +0 -0
  130. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_openai_api_key_handling.py +0 -0
  131. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_redact.py +0 -0
  132. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_resource_timeout.py +0 -0
  133. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_settings.py +0 -0
  134. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_setup_wizard.py +0 -0
  135. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_truncate_message_history.py +0 -0
  136. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_util.py +0 -0
  137. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_utils_coverage.py +0 -0
  138. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_views.py +0 -0
  139. {open_swarm-0.1.1748636259 → open_swarm-0.1.1748636295}/tests/test_wsgi.py +0 -0
@@ -0,0 +1,257 @@
1
+ Metadata-Version: 2.4
2
+ Name: open-swarm
3
+ Version: 0.1.1748636295
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
+ # Open Swarm
44
+
45
+ <div align="center">
46
+ <img src="assets/images/openswarm-project-image.jpg" alt="Project Logo" width="70%"/>
47
+ </div>
48
+
49
+ **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.
50
+
51
+ ---
52
+
53
+ https://github.com/user-attachments/assets/1335f7fb-ff61-4e96-881c-7d3154eb9f14
54
+
55
+ (generated by www.gitpodcast.com)
56
+
57
+ ---
58
+
59
+ ## Table of Contents
60
+ - [Key Features](#key-features)
61
+ - [Quickstart](#quickstart)
62
+ - [Blueprints](#blueprints)
63
+ - [Further Documentation](#further-documentation)
64
+ - [License](#license)
65
+ - [Acknowledgements](#acknowledgements)
66
+
67
+ ---
68
+
69
+ ## Key Features
70
+
71
+ 1. **Multi-Agent Orchestration**
72
+ - Define multiple agents, each with unique instructions and roles.
73
+ - Agents coordinate tasks, share context, or hand off queries between one another.
74
+
75
+ 2. **Blueprint-Driven Architecture**
76
+ - Each **Blueprint** encapsulates logic, tool connections, and environment/config settings.
77
+ - Encourages reusable, modular patterns for different use cases.
78
+
79
+ 3. **Optional MCP Integration**
80
+ - Integrate with external tools (e.g., databases, web search, filesystems) through **MCP servers**.
81
+ - Note `npx` MCP servers work great but `uvx` MCP servers currently have issues.
82
+
83
+ 4. **CLI & REST Interface**
84
+ - Run from the command line or expose a Django-powered REST API for broader integration.
85
+ - Interactive web pages per blueprint at `/<blueprint_name>/`.
86
+
87
+ 5. **OpenAI API Compatibility**
88
+ - Exposes an endpoint at `/v1/chat/completions` that is functionally similar to the OpenAI Chat Completions API.
89
+ - Includes a **mandatory** `sender` field in agent responses.
90
+ - This field identifies which Swarm agent provided the response and must be preserved in the conversation history for proper handoffs between agents.
91
+ - 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.
92
+ - **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.
93
+
94
+ 6. **Configurable LLMs**
95
+ - Supports multiple OpenAI-compatible providers in a single environment (e.g., `openai`, `grok`, `ollama`).
96
+ - Allows specifying different models/providers for different agents—even within the same blueprint.
97
+ - Use environment variable `DEFAULT_LLM` to specify default LLM model used by blueprints, e.g., `DEFAULT_LLM=deepseek-r1-distill-llama-70b`
98
+
99
+ ---
100
+
101
+ ## Quickstart
102
+
103
+ Follow these simple steps to get Open Swarm up and running:
104
+
105
+ 1. **Install the Package**
106
+ Run:
107
+ ```bash
108
+ pip install open-swarm
109
+ ```
110
+
111
+ 2. **Configure an LLM Provider**
112
+ 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:
113
+ ```json
114
+ {
115
+ "llm": {
116
+ "default": {
117
+ "provider": "openai",
118
+ "model": "gpt-4o",
119
+ "base_url": "https://api.openai.com/v1",
120
+ "api_key": "${OPENAI_API_KEY}"
121
+ }
122
+ },
123
+ "mcpServers": {}
124
+ }
125
+ ```
126
+ Make sure to set the `OPENAI_API_KEY` environment variable with your valid OpenAI API key.
127
+
128
+ An example of using an alternative provider:
129
+
130
+ `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}"}' `
131
+
132
+
133
+ 3. **(Optional) Configure a Simple MCP Server**
134
+ To add an MCP server for additional utilities (e.g., file fetching), use the `swarm-cli config add --json '<multiline_json_block>'`. For example:
135
+
136
+ ```json
137
+ "filesystem": {
138
+ "command": "npx",
139
+ "args": [
140
+ "-y",
141
+ "@modelcontextprotocol/server-filesystem ${ALLOWED_PATH}"
142
+ ],
143
+ "env": {
144
+ "ALLOWED_PATH": "${ALLOWED_PATH}"
145
+ }
146
+ }
147
+ ```
148
+
149
+ 4. **Add an Example Blueprint**
150
+ Add an example blueprint by running:
151
+ ```bash
152
+ swarm-cli add /path/to/your/blueprint.py --name example
153
+ ```
154
+ This copies your blueprint into the managed blueprints directory.
155
+
156
+ Example blueprints are provided here: https://github.com/matthewhand/open-swarm/tree/main/blueprints
157
+
158
+ 5. **Run the Blueprint from CLI**
159
+ Execute the blueprint with:
160
+ ```bash
161
+ swarm-cli run example
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Overview
167
+
168
+ Open Swarm provides the following core components:
169
+
170
+ - **Swarm CLI:**
171
+ 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.
172
+
173
+ - **Swarm API:**
174
+ 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.
175
+
176
+ - **Swarm SDK:**
177
+ 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.
178
+
179
+ For detailed usage instructions, please refer to the [USERGUIDE.md](./USERGUIDE.md). For developer-specific guidance, see [DEVELOPMENT.md](./DEVELOPMENT.md).
180
+
181
+ ---
182
+
183
+
184
+ ## Blueprints
185
+
186
+ A **Blueprint** is a Python module that wraps:
187
+
188
+ - **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.
189
+ - **Tools**: Specifies which agents have which tools (e.g., MCP-discovered tools, Python function calls).
190
+ - **Environment & Configuration**: Ensures required environment variables and JSON configs are validated prior to agent execution.
191
+
192
+ Once registered, a blueprint is discoverable at runtime, allowing the system to list and load agents on demand.
193
+
194
+ ### Personal Assistant Example
195
+
196
+ The **Personal Assistant Blueprint** demonstrates a hybrid approach, integrating **local Python function tools** with **MCP-discovered tools**. It consists of:
197
+
198
+ 1. **Personal Assistant Agent**
199
+ - Determines user intent and delegates queries accordingly.
200
+ - Routes weather-related queries to the `WeatherAgent`.
201
+ - Routes knowledge-based queries to the `DocumentationAgent`.
202
+
203
+ 2. **Weather Agent** (Uses Python Function Tools)
204
+ - Fetches current weather and forecasts via OpenWeatherMap.
205
+ - Uses a **locally defined Python function** rather than an MCP server.
206
+ - Requires `WEATHER_API_KEY` as an environment variable.
207
+
208
+ 3. **Documentation Agent** (Uses MCP-Discovered Tools)
209
+ - Retrieves relevant documentation via `rag-docs`.
210
+ - Uses the MCP function `search_documentation` to dynamically retrieve information.
211
+ - Requires the following environment variables:
212
+ - `OPENAI_API_KEY`
213
+ - `QDRANT_URL`
214
+ - `QDRANT_API_KEY`
215
+
216
+ This blueprint highlights **seamless multi-agent coordination** and the **flexibility of combining Python functions with MCP-discovered tools**.
217
+
218
+ ### Other Examples
219
+
220
+ Open Swarm includes a growing library of **Blueprint** examples:
221
+
222
+ | Blueprint Name | Description | Status |
223
+ |------------------------------|-----------------------------------------------------------------------------|-----------------------------------------|
224
+ | **Echo Blueprint** | A straightforward agent that simply echoes user inputs—ideal for testing or as a starter template. | Stable |
225
+ | **Suggestion Blueprint** | Blueprint providing suggestions and recommendations. | Stable |
226
+ | **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 |
227
+ | **University Blueprint** | Multi-agent system for university-related tasks. | Stable |
228
+ | **Divine Ops Blueprint** | Multi-agent system for handling system administration tasks using MCP tools (filesystem, SQLite, search, etc.). | Stable |
229
+ | **Nebucha Shellzzar Blueprint**| Example system administration blueprint. | Stable |
230
+ | **Personal Assistant Blueprint** | Combines real-time weather updates (Python function) with documentation search (`rag-docs`, MCP). Demonstrates mixed tooling. | Broken (uvx-based) |
231
+ | **Flowise Blueprint** | Integrates with Flowise for visual flow orchestration. | Broken (uvx-based, requires Flowise setup)|
232
+
233
+ ---
234
+ ---
235
+
236
+ ## Further Documentation
237
+
238
+ 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.
239
+
240
+ ---
241
+
242
+ ## License
243
+
244
+ Open Swarm is provided under the MIT License. Refer to the [LICENSE](LICENSE) file for full details.
245
+
246
+ ---
247
+
248
+ ## Acknowledgements
249
+
250
+ 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.
251
+ We also wish to credit [django_chatbot](https://github.com/MattiPaivike/django_chatbot) for the Django chatbot view.
252
+
253
+ ### Third-Party Libraries
254
+ - **[Marked.js](https://github.com/markedjs/marked)** (MIT License)
255
+ A fast, lightweight library for parsing Markdown into HTML.
256
+ - **[Tabler Icons](https://tablericons.com)** (MIT License)
257
+ A set of free, high-quality SVG icons for web projects, designed by Paweł Kuna.
@@ -0,0 +1,215 @@
1
+ # Open Swarm
2
+
3
+ <div align="center">
4
+ <img src="assets/images/openswarm-project-image.jpg" alt="Project Logo" width="70%"/>
5
+ </div>
6
+
7
+ **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.
8
+
9
+ ---
10
+
11
+ https://github.com/user-attachments/assets/1335f7fb-ff61-4e96-881c-7d3154eb9f14
12
+
13
+ (generated by www.gitpodcast.com)
14
+
15
+ ---
16
+
17
+ ## Table of Contents
18
+ - [Key Features](#key-features)
19
+ - [Quickstart](#quickstart)
20
+ - [Blueprints](#blueprints)
21
+ - [Further Documentation](#further-documentation)
22
+ - [License](#license)
23
+ - [Acknowledgements](#acknowledgements)
24
+
25
+ ---
26
+
27
+ ## Key Features
28
+
29
+ 1. **Multi-Agent Orchestration**
30
+ - Define multiple agents, each with unique instructions and roles.
31
+ - Agents coordinate tasks, share context, or hand off queries between one another.
32
+
33
+ 2. **Blueprint-Driven Architecture**
34
+ - Each **Blueprint** encapsulates logic, tool connections, and environment/config settings.
35
+ - Encourages reusable, modular patterns for different use cases.
36
+
37
+ 3. **Optional MCP Integration**
38
+ - Integrate with external tools (e.g., databases, web search, filesystems) through **MCP servers**.
39
+ - Note `npx` MCP servers work great but `uvx` MCP servers currently have issues.
40
+
41
+ 4. **CLI & REST Interface**
42
+ - Run from the command line or expose a Django-powered REST API for broader integration.
43
+ - Interactive web pages per blueprint at `/<blueprint_name>/`.
44
+
45
+ 5. **OpenAI API Compatibility**
46
+ - Exposes an endpoint at `/v1/chat/completions` that is functionally similar to the OpenAI Chat Completions API.
47
+ - Includes a **mandatory** `sender` field in agent responses.
48
+ - This field identifies which Swarm agent provided the response and must be preserved in the conversation history for proper handoffs between agents.
49
+ - 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.
50
+ - **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.
51
+
52
+ 6. **Configurable LLMs**
53
+ - Supports multiple OpenAI-compatible providers in a single environment (e.g., `openai`, `grok`, `ollama`).
54
+ - Allows specifying different models/providers for different agents—even within the same blueprint.
55
+ - Use environment variable `DEFAULT_LLM` to specify default LLM model used by blueprints, e.g., `DEFAULT_LLM=deepseek-r1-distill-llama-70b`
56
+
57
+ ---
58
+
59
+ ## Quickstart
60
+
61
+ Follow these simple steps to get Open Swarm up and running:
62
+
63
+ 1. **Install the Package**
64
+ Run:
65
+ ```bash
66
+ pip install open-swarm
67
+ ```
68
+
69
+ 2. **Configure an LLM Provider**
70
+ 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:
71
+ ```json
72
+ {
73
+ "llm": {
74
+ "default": {
75
+ "provider": "openai",
76
+ "model": "gpt-4o",
77
+ "base_url": "https://api.openai.com/v1",
78
+ "api_key": "${OPENAI_API_KEY}"
79
+ }
80
+ },
81
+ "mcpServers": {}
82
+ }
83
+ ```
84
+ Make sure to set the `OPENAI_API_KEY` environment variable with your valid OpenAI API key.
85
+
86
+ An example of using an alternative provider:
87
+
88
+ `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}"}' `
89
+
90
+
91
+ 3. **(Optional) Configure a Simple MCP Server**
92
+ To add an MCP server for additional utilities (e.g., file fetching), use the `swarm-cli config add --json '<multiline_json_block>'`. For example:
93
+
94
+ ```json
95
+ "filesystem": {
96
+ "command": "npx",
97
+ "args": [
98
+ "-y",
99
+ "@modelcontextprotocol/server-filesystem ${ALLOWED_PATH}"
100
+ ],
101
+ "env": {
102
+ "ALLOWED_PATH": "${ALLOWED_PATH}"
103
+ }
104
+ }
105
+ ```
106
+
107
+ 4. **Add an Example Blueprint**
108
+ Add an example blueprint by running:
109
+ ```bash
110
+ swarm-cli add /path/to/your/blueprint.py --name example
111
+ ```
112
+ This copies your blueprint into the managed blueprints directory.
113
+
114
+ Example blueprints are provided here: https://github.com/matthewhand/open-swarm/tree/main/blueprints
115
+
116
+ 5. **Run the Blueprint from CLI**
117
+ Execute the blueprint with:
118
+ ```bash
119
+ swarm-cli run example
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Overview
125
+
126
+ Open Swarm provides the following core components:
127
+
128
+ - **Swarm CLI:**
129
+ 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.
130
+
131
+ - **Swarm API:**
132
+ 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.
133
+
134
+ - **Swarm SDK:**
135
+ 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.
136
+
137
+ For detailed usage instructions, please refer to the [USERGUIDE.md](./USERGUIDE.md). For developer-specific guidance, see [DEVELOPMENT.md](./DEVELOPMENT.md).
138
+
139
+ ---
140
+
141
+
142
+ ## Blueprints
143
+
144
+ A **Blueprint** is a Python module that wraps:
145
+
146
+ - **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.
147
+ - **Tools**: Specifies which agents have which tools (e.g., MCP-discovered tools, Python function calls).
148
+ - **Environment & Configuration**: Ensures required environment variables and JSON configs are validated prior to agent execution.
149
+
150
+ Once registered, a blueprint is discoverable at runtime, allowing the system to list and load agents on demand.
151
+
152
+ ### Personal Assistant Example
153
+
154
+ The **Personal Assistant Blueprint** demonstrates a hybrid approach, integrating **local Python function tools** with **MCP-discovered tools**. It consists of:
155
+
156
+ 1. **Personal Assistant Agent**
157
+ - Determines user intent and delegates queries accordingly.
158
+ - Routes weather-related queries to the `WeatherAgent`.
159
+ - Routes knowledge-based queries to the `DocumentationAgent`.
160
+
161
+ 2. **Weather Agent** (Uses Python Function Tools)
162
+ - Fetches current weather and forecasts via OpenWeatherMap.
163
+ - Uses a **locally defined Python function** rather than an MCP server.
164
+ - Requires `WEATHER_API_KEY` as an environment variable.
165
+
166
+ 3. **Documentation Agent** (Uses MCP-Discovered Tools)
167
+ - Retrieves relevant documentation via `rag-docs`.
168
+ - Uses the MCP function `search_documentation` to dynamically retrieve information.
169
+ - Requires the following environment variables:
170
+ - `OPENAI_API_KEY`
171
+ - `QDRANT_URL`
172
+ - `QDRANT_API_KEY`
173
+
174
+ This blueprint highlights **seamless multi-agent coordination** and the **flexibility of combining Python functions with MCP-discovered tools**.
175
+
176
+ ### Other Examples
177
+
178
+ Open Swarm includes a growing library of **Blueprint** examples:
179
+
180
+ | Blueprint Name | Description | Status |
181
+ |------------------------------|-----------------------------------------------------------------------------|-----------------------------------------|
182
+ | **Echo Blueprint** | A straightforward agent that simply echoes user inputs—ideal for testing or as a starter template. | Stable |
183
+ | **Suggestion Blueprint** | Blueprint providing suggestions and recommendations. | Stable |
184
+ | **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 |
185
+ | **University Blueprint** | Multi-agent system for university-related tasks. | Stable |
186
+ | **Divine Ops Blueprint** | Multi-agent system for handling system administration tasks using MCP tools (filesystem, SQLite, search, etc.). | Stable |
187
+ | **Nebucha Shellzzar Blueprint**| Example system administration blueprint. | Stable |
188
+ | **Personal Assistant Blueprint** | Combines real-time weather updates (Python function) with documentation search (`rag-docs`, MCP). Demonstrates mixed tooling. | Broken (uvx-based) |
189
+ | **Flowise Blueprint** | Integrates with Flowise for visual flow orchestration. | Broken (uvx-based, requires Flowise setup)|
190
+
191
+ ---
192
+ ---
193
+
194
+ ## Further Documentation
195
+
196
+ 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.
197
+
198
+ ---
199
+
200
+ ## License
201
+
202
+ Open Swarm is provided under the MIT License. Refer to the [LICENSE](LICENSE) file for full details.
203
+
204
+ ---
205
+
206
+ ## Acknowledgements
207
+
208
+ 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.
209
+ We also wish to credit [django_chatbot](https://github.com/MattiPaivike/django_chatbot) for the Django chatbot view.
210
+
211
+ ### Third-Party Libraries
212
+ - **[Marked.js](https://github.com/markedjs/marked)** (MIT License)
213
+ A fast, lightweight library for parsing Markdown into HTML.
214
+ - **[Tabler Icons](https://tablericons.com)** (MIT License)
215
+ 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.1748636295"
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]