Skip to main content

A FastAPI-based backend enabling seamless multi-agent orchestration and API integration for LangSwarm applications.

Project description

LangSwarm-Backend

LangSwarm-Backend is a lightweight, FastAPI-based backend designed to support LangSwarm's multi-agent ecosystem. It provides a scalable API layer and serves as the core integration point for managing and coordinating agent interactions.

Features

  • FastAPI Framework: High-performance API for seamless communication with LangSwarm agents.
  • Docker-Compatible: Easily deployable as a container on local or cloud environments.
  • Scalable Architecture: Built to run on Cloud Run or other serverless platforms for automatic scaling.
  • Multi-Agent Orchestration: Handles API requests, message routing, and task execution for LangSwarm agents.

Requirements

  • Python 3.10 or higher
  • Dependencies listed in requirements.txt

Installation

Install LangSwarm-Backend and its dependencies via pip:

pip install langswarm-backend

Usage

Local Development

Run the backend locally:

python langswarm-backend/main.py

Access the API at http://localhost:8080.

Deployment with Docker

Build and run the Docker container:

docker build -t langswarm-backend .
docker run -p 8080:8080 langswarm-backend

Deployment on Cloud Run

  1. Build the Docker image:
    docker build -t gcr.io/[PROJECT-ID]/langswarm-backend .
    
  2. Push the image to Google Artifact Registry:
    docker push gcr.io/[PROJECT-ID]/langswarm-backend
    
  3. Deploy to Cloud Run:
    gcloud run deploy langswarm-backend \
        --image gcr.io/[PROJECT-ID]/langswarm-backend \
        --region [REGION] \
        --platform managed \
        --allow-unauthenticated
    

Environment Variables

  • APP_PORT: Port to expose the backend (default: 8080).
  • Additional variables can be configured via .env.

API Endpoints

Example: Message Handling

  • POST /send-message: Sends a message to the backend.
    {
      "sender": "agent1",
      "content": "Hello, World!"
    }
    
  • GET /get-messages: Retrieves all messages.

Contributing

We welcome contributions to improve LangSwarm-Backend. To get started:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Submit a pull request for review.

License

LangSwarm-Backend is licensed under the MIT License.

Support

For issues or questions, please open a GitHub issue or contact our team.

Project details


Download files

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

Source Distribution

langswarm_backend-0.0.5.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

langswarm_backend-0.0.5-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file langswarm_backend-0.0.5.tar.gz.

File metadata

  • Download URL: langswarm_backend-0.0.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for langswarm_backend-0.0.5.tar.gz
Algorithm Hash digest
SHA256 3e55b705b3fde5c48e557dab414008edca94a1f4032c543eed89010e316b740e
MD5 cea817386b4ff426b777011e72d9ed9d
BLAKE2b-256 0ebf687889fd566d5ae651d3664a37af2c527d82dac3d852f3fca5f078d6035d

See more details on using hashes here.

File details

Details for the file langswarm_backend-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for langswarm_backend-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a37674c0076347696733e63317ac0081430a3d039a501feae5ea6a4e57dd2927
MD5 21b8fce7ccc37718514bf56413ff5bd2
BLAKE2b-256 c45b01c27752107123d89fd2ebd064ee98f6fa93e97bc7504e861418c325f30c

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