Swarm Models - Pytorch
Project description
Swarms Models
Leverage LLM APIs with Unparalleled Speed, Security, and Reliability
Why Swarm Models?
-
Multi-Provider Support: Effortlessly integrate APIs from various providers into your projects.
-
Bleeding-Edge Speed: Experience lightning-fast performance optimized for efficiency.
-
Robust Security: Built with top-notch security protocols to protect your data and API keys.
-
Ease of Use: Simple initialization and execution with intuitive
.run(task)
and__call__
methods. -
Scalability: Designed to handle everything from small scripts to large-scale applications.
Code Example
from swarm_models import OpenAIChat
import os
# Get the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")
# Create an instance of the OpenAIChat class
model = OpenAIChat(openai_api_key=api_key, model_name="gpt-4o-mini")
# Query the model with a question
out = model(
"What is the best state to register a business in the US for the least amount of taxes?"
)
# Print the model's response
print(out)
How It Works
Swarm Models simplifies the way you interact with different APIs by providing a unified interface for all models.
1. Install Swarm Models
$ pip3 install swarm-models
2. Set Your Keys
OPENAI_API_KEY="your_openai_api_key"
GROQ_API_KEY="your_groq_api_key"
ANTHROPIC_API_KEY="your_anthropic_api_key"
AZURE_OPENAI_API_KEY="your_azure_openai_api_key"
3. Initialize a Model
Import the desired model from the package and initialize it with your API key or necessary configuration.
from swarm_models import YourDesiredModel
model = YourDesiredModel(api_key='your_api_key', *args, **kwargs)
4. Run Your Task
Use the .run(task)
method or simply call the model like model(task)
with your task.
task = "Define your task here"
result = model.run(task)
# Or equivalently
#result = model(task)
5. Enjoy the Results
print(result)
Get Started Now
Ready to streamline your API integrations and boost your application's performance?
-
Install the Package
$ pip install swarm-models
-
Explore the Documentation
Dive into our comprehensive Documentation to learn more about the available models and features.
-
Join the Community
Connect with other developers on our GitHub and contribute to the project.
Download Now | Documentation | GitHub
Available Models
Model Name | Description |
---|---|
OpenAIChat |
Chat model for OpenAI's GPT-3 and GPT-4 APIs. |
Anthropic |
Model for interacting with Anthropic's APIs. |
AzureOpenAI |
Azure's implementation of OpenAI's models. |
Dalle3 |
Model for generating images from text prompts. |
NvidiaLlama31B |
Llama model for causal language generation. |
Fuyu |
Multi-modal model for image and text processing. |
Gemini |
Multi-modal model for vision and language tasks. |
Vilt |
Vision-and-Language Transformer for question answering. |
TogetherLLM |
Model for collaborative language tasks. |
FireWorksAI |
Model for generating creative content. |
ReplicateChat |
Chat model for replicating conversations. |
HuggingfaceLLM |
Interface for Hugging Face models. |
CogVLMMultiModal |
Multi-modal model for vision and language tasks. |
LayoutLMDocumentQA |
Model for document question answering. |
GPT4VisionAPI |
Model for analyzing images with GPT-4 capabilities. |
LlamaForCausalLM |
Causal language model from the Llama family. |
Frequently Asked Questions
Q: Which providers are supported?
A: Swarm Models supports a wide range of API providers. Check out the documentation for a full list.
Q: How do I secure my API keys?
A: We recommend using environment variables or a secure key management system. Swarm Models ensures your keys are handled securely within the package.
Contact Us
Join our Discord to stay updated and get support.
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
Built Distribution
Hashes for swarm_models-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54124085147dc7a515c4b579b2e129107a37858c52149fb20218481d2f386d7c |
|
MD5 | 97ffd70520fe5d84b6fc92856c5522b9 |
|
BLAKE2b-256 | c4bf7c7333874f15d31a22f1f5462f1eb25a8c04869f32ab4a59191065835c9b |