Swarms Cloud - Pytorch
Project description
Swarms Cloud
Infrastructure for scalable, reliable, and economical Multi-Modal Model API serving and deployment. We're using terraform to orchestrate infrastructure, FastAPI to host the models. If you're into deploying models for millions of people, join our discord and help contribute.
Guides
- Available Models
- Migrate from OpenAI to Swarms in 3 lines of code
- Getting Started with SOTA Vision Language Models VLM
- Enterprise Guide to High-Performance Multi-Agent LLM Deployments
Install
pip install swarms-cloud
Architecture
user -> request -> load balanncer -> node[gpu] -> fast api -> model
Scripts
sky serve up -n [NAME] --cloud aws
Calculate Pricing
from transformers import AutoTokenizer
from swarms_cloud import calculate_pricing
# Initialize the tokenizer
tokenizer = AutoTokenizer.from_pretrained("gpt2")
# Define the example texts
texts = ["This is the first example text.", "This is the second example text."]
# Calculate pricing and retrieve the results
total_tokens, total_sentences, total_words, total_characters, total_paragraphs, cost = calculate_pricing(texts, tokenizer)
# Print the total tokens processed
print(f"Total tokens processed: {total_tokens}")
# Print the total cost
print(f"Total cost: ${cost:.5f}")
Generate an API key
from swarms_cloud.api_key_generator import generate_api_key
out = generate_api_key(prefix="sk", length=30)
print(out)
Stack
- Backend: FastAPI
- Skypilot for container management
- Stripe for payment tracking
- Postresql for database
- TensorRT for inference
- Docker for cluster management
- Kubernetes for managing and autoscaling docker containers
- Terraform
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_cloud-0.2.6.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for swarms_cloud-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aaab6c60be91d56c5d8dd32449b27debf6e7f1cfc864c5ee62742394af5b32e |
|
MD5 | c9dda4cded09be00cc6ae154c65e3465 |
|
BLAKE2b-256 | bbf18092828c4bab50a2690d52b7ad666d69c0bf9418b87a664ca3aa37f7815c |