Metadata-Version: 2.1
Name: swarms-cloud
Version: 0.2.6
Summary: Swarms Cloud - Pytorch
Home-page: https://github.com/kyegomez/swarms-cloud
License: MIT
Keywords: artificial intelligence,deep learning,optimizers,Prompt Engineering
Author: Kye Gomez
Author-email: kye@apac.ai
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: einops
Requires-Dist: fastapi
Requires-Dist: pydantic (>2,<3)
Requires-Dist: shortuuid
Requires-Dist: skypilot
Requires-Dist: sse-starlette (==2.1.0)
Requires-Dist: stripe
Requires-Dist: swarms
Requires-Dist: torch
Requires-Dist: transformers
Requires-Dist: uvicorn
Project-URL: Documentation, https://github.com/kyegomez/swarms-cloud
Project-URL: Repository, https://github.com/kyegomez/swarms-cloud
Description-Content-Type: text/markdown

[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)

# 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](https://swarms.apac.ai/en/latest/swarms_cloud/available_models/)
- [Migrate from OpenAI to Swarms in 3 lines of code](https://swarms.apac.ai/en/latest/swarms_cloud/migrate_openai/)
- [Getting Started with SOTA Vision Language Models VLM](https://swarms.apac.ai/en/latest/swarms_cloud/getting_started/)
- [Enterprise Guide to High-Performance Multi-Agent LLM Deployments](https://swarms.apac.ai/en/latest/swarms_cloud/production_deployment/)


# 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
```python
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
```python
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

