From c8fe71ccaf01befe39012fe034b1acf5c6ae740f Mon Sep 17 00:00:00 2001 From: Kye Date: Sat, 9 Dec 2023 20:10:26 -0800 Subject: [PATCH] [VORTEX] --- .../{omni_agent.py => vortex.py} | 27 +++++++++---------- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) rename playground/demos/optimize_llm_stack/{omni_agent.py => vortex.py} (51%) diff --git a/playground/demos/optimize_llm_stack/omni_agent.py b/playground/demos/optimize_llm_stack/vortex.py similarity index 51% rename from playground/demos/optimize_llm_stack/omni_agent.py rename to playground/demos/optimize_llm_stack/vortex.py index 1406c774..a96d65b2 100644 --- a/playground/demos/optimize_llm_stack/omni_agent.py +++ b/playground/demos/optimize_llm_stack/vortex.py @@ -1,3 +1,4 @@ +import subprocess import os from swarms.structs import Agent from swarms.memory import WeaviateClient @@ -5,34 +6,30 @@ from swarms.utils.phoenix_handler import phoenix_trace_decorator from swarms.models.vllm import vLLM from dotenv import load_dotenv -load_dotenv() +try: + import modal +except ImportError: + print(f"modal not installed, please install it with `pip install modal`") + subprocess.run(["pip", "install", "modal"]) + +load_dotenv() + # Model llm = vLLM() -# Weaviate -weaviate_client = WeaviateClient( - http_host="localhost", - http_port="8080", - http_secure=False, - grpc_host="localhost", - grpc_port="8081", - grpc_secure=False, - auth_client_secret="YOUR_APIKEY", - additional_headers={"X-OpenAI-Api-Key": "YOUR_OPENAI_APIKEY"}, - additional_config=None, # You can pass additional configuration here -) +# Modal +stub = modal.Stub(name="swarms") # Agent @phoenix_trace_decorator -@ +@stub.function(gpu="any") def agent(task: str): agent = Agent( llm = llm, max_loops=1, ) - out = agent.run(task=task) return out \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 37813594..31891686 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "2.6.5" +version = "2.6.6" description = "Swarms - Pytorch" license = "MIT" authors = ["Kye Gomez "]