Skip to main content

Swarms - Pytorch

Project description

Swarming banner icon

Swarms is a modular framework that enables reliable and useful multi-agent collaboration at scale to automate real-world tasks.

GitHub issues GitHub forks GitHub stars GitHub licenseGitHub star chartDependency Status Downloads

Join the Agora discordShare on Twitter Share on Facebook Share on LinkedIn

Share on Reddit Share on Hacker News Share on Pinterest Share on WhatsApp


Installation

pip3 install --upgrade swarms


Usage

Run example in Collab: Open In Colab

Flow Example

  • Reliable Structure that provides LLMS autonomy
  • Extremely Customizeable with stopping conditions, interactivity, dynamical temperature, loop intervals, and so much more
  • Enterprise Grade + Production Grade: Flow is designed and optimized for automating real-world tasks at scale!
from swarms.models import OpenAIChat
from swarms.structs import Flow

api_key = ""

# Initialize the language model, this model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC
llm = OpenAIChat(
    openai_api_key=api_key,
    temperature=0.5,
)

## Initialize the workflow
flow = Flow(
    llm=llm,
    max_loops=2,
    dashboard=True,

)

out = flow.run("Generate a 10,000 word blog on health and wellness.")

SequentialWorkflow

  • A Sequential swarm of autonomous agents where each agent's outputs are fed into the next agent
  • Save and Restore Workflow states!
  • Integrate Flow's with various LLMs and Multi-Modality Models
from swarms.models import OpenAIChat, BioGPT, Anthropic
from swarms.structs import Flow
from swarms.structs.sequential_workflow import SequentialWorkflow


# Example usage
api_key = (
    ""  # Your actual API key here
)

# Initialize the language flow
llm = OpenAIChat(
    openai_api_key=api_key,
    temperature=0.5,
    max_tokens=3000,
)

biochat = BioGPT()

# Use Anthropic
anthropic = Anthropic()

# Initialize the agent with the language flow
agent1 = Flow(llm=llm, max_loops=1, dashboard=False)

# Create another agent for a different task
agent2 = Flow(llm=llm, max_loops=1, dashboard=False)

# Create another agent for a different task
agent3 = Flow(llm=biochat, max_loops=1, dashboard=False)

# agent4 = Flow(llm=anthropic, max_loops="auto")

# Create the workflow
workflow = SequentialWorkflow(max_loops=1)

# Add tasks to the workflow
workflow.add("Generate a 10,000 word blog on health and wellness.", agent1)

# Suppose the next task takes the output of the first task as input
workflow.add("Summarize the generated blog", agent2)

workflow.add("Create a references sheet of materials for the curriculm", agent3)

# Run the workflow
workflow.run()

# Output the results
for task in workflow.tasks:
    print(f"Task: {task.description}, Result: {task.result}")

Multi Modal Autonomous Agents

  • Run the flow with multiple modalities useful for various real-world tasks in manufacturing, logistics, and health.
from swarms.structs import Flow
from swarms.models.gpt4_vision_api import GPT4VisionAPI

# Initialize the llm
llm = GPT4VisionAPI()

task = "Analyze this image of an assembly line and identify any issues such as misaligned parts, defects, or deviations from the standard assembly process. IF there is anything unsafe in the image, explain why it is unsafe and how it could be improved."
img = "assembly_line.jpg"

## Initialize the workflow
flow = Flow(
    llm=llm,
    max_loops=1,
    dashboard=True,
)

# Run the flow
flow.run(task=task, img=img)

Features 🤖

The Swarms framework is designed with a strong emphasis on reliability, performance, and production-grade readiness. Below are the key features that make Swarms an ideal choice for enterprise-level AI deployments.

🚀 Production-Grade Readiness

  • Scalable Architecture: Built to scale effortlessly with your growing business needs.
  • Enterprise-Level Security: Incorporates top-notch security features to safeguard your data and operations.
  • Containerization and Microservices: Easily deployable in containerized environments, supporting microservices architecture.

⚙️ Reliability and Robustness

  • Fault Tolerance: Designed to handle failures gracefully, ensuring uninterrupted operations.
  • Consistent Performance: Maintains high performance even under heavy loads or complex computational demands.
  • Automated Backup and Recovery: Features automatic backup and recovery processes, reducing the risk of data loss.

💡 Advanced AI Capabilities

The Swarms framework is equipped with a suite of advanced AI capabilities designed to cater to a wide range of applications and scenarios, ensuring versatility and cutting-edge performance.

Multi-Modal Autonomous Agents

  • Versatile Model Support: Seamlessly works with various AI models, including NLP, computer vision, and more, for comprehensive multi-modal capabilities.
  • Context-Aware Processing: Employs context-aware processing techniques to ensure relevant and accurate responses from agents.

Function Calling Models for API Execution

  • Automated API Interactions: Function calling models that can autonomously execute API calls, enabling seamless integration with external services and data sources.
  • Dynamic Response Handling: Capable of processing and adapting to responses from APIs for real-time decision making.

Varied Architectures of Swarms

  • Flexible Configuration: Supports multiple swarm architectures, from centralized to decentralized, for diverse application needs.
  • Customizable Agent Roles: Allows customization of agent roles and behaviors within the swarm to optimize performance and efficiency.

Generative Models

  • Advanced Generative Capabilities: Incorporates state-of-the-art generative models to create content, simulate scenarios, or predict outcomes.
  • Creative Problem Solving: Utilizes generative AI for innovative problem-solving approaches and idea generation.

Enhanced Decision-Making

  • AI-Powered Decision Algorithms: Employs advanced algorithms for swift and effective decision-making in complex scenarios.
  • Risk Assessment and Management: Capable of assessing risks and managing uncertain situations with AI-driven insights.

Real-Time Adaptation and Learning

  • Continuous Learning: Agents can continuously learn and adapt from new data, improving their performance and accuracy over time.
  • Environment Adaptability: Designed to adapt to different operational environments, enhancing robustness and reliability.

🔄 Efficient Workflow Automation

  • Streamlined Task Management: Simplifies complex tasks with automated workflows, reducing manual intervention.
  • Customizable Workflows: Offers customizable workflow options to fit specific business needs and requirements.
  • Real-Time Analytics and Reporting: Provides real-time insights into agent performance and system health.

🌐 Wide-Ranging Integration

  • API-First Design: Easily integrates with existing systems and third-party applications via robust APIs.
  • Cloud Compatibility: Fully compatible with major cloud platforms for flexible deployment options.
  • Continuous Integration/Continuous Deployment (CI/CD): Supports CI/CD practices for seamless updates and deployment.

📊 Performance Optimization

  • Resource Management: Efficiently manages computational resources for optimal performance.
  • Load Balancing: Automatically balances workloads to maintain system stability and responsiveness.
  • Performance Monitoring Tools: Includes comprehensive monitoring tools for tracking and optimizing performance.

🛡️ Security and Compliance

  • Data Encryption: Implements end-to-end encryption for data at rest and in transit.
  • Compliance Standards Adherence: Adheres to major compliance standards ensuring legal and ethical usage.
  • Regular Security Updates: Regular updates to address emerging security threats and vulnerabilities.

💬 Community and Support

  • Extensive Documentation: Detailed documentation for easy implementation and troubleshooting.
  • Active Developer Community: A vibrant community for sharing ideas, solutions, and best practices.
  • Professional Support: Access to professional support for enterprise-level assistance and guidance.

Swarms framework is not just a tool but a robust, scalable, and secure partner in your AI journey, ready to tackle the challenges of modern AI applications in a business environment.

Documentation

Contribute

Community

Discovery Call

Book a discovery call with the Swarms team to learn how to optimize and scale your swarm! Click here to book a time that works for you!

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarms-2.4.2.tar.gz (202.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarms-2.4.2-py3-none-any.whl (251.9 kB view details)

Uploaded Python 3

File details

Details for the file swarms-2.4.2.tar.gz.

File metadata

  • Download URL: swarms-2.4.2.tar.gz
  • Upload date:
  • Size: 202.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for swarms-2.4.2.tar.gz
Algorithm Hash digest
SHA256 b3497d09483157cb9628645bac704dbdf86fa7e0424cd4f1f48e4bdc2068229e
MD5 e9c1094ee28a8fe2e6555b3eef11d1b3
BLAKE2b-256 96c74195fc4a06870ec80e465fb5e6fd14428c0ffc7d5c5a6b2668c62e344fa9

See more details on using hashes here.

File details

Details for the file swarms-2.4.2-py3-none-any.whl.

File metadata

  • Download URL: swarms-2.4.2-py3-none-any.whl
  • Upload date:
  • Size: 251.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for swarms-2.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f0eb630e42666fdb7d2ad835e426d178065115958d97392a579cb84f924237ce
MD5 41dba58c2161f97fd3b6d13d800c7c8d
BLAKE2b-256 4c4bff3cdc5287f83a24a81e7afafdff7fdcd1971f08f39c3909f00c5b630d57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page