From a745426d09598ceda3a0440e4b0a6d5034362717 Mon Sep 17 00:00:00 2001 From: Reza Rahemtola Date: Sun, 10 Nov 2024 03:48:33 +0900 Subject: [PATCH] feat: Model links updated for first public release --- README.md | 19 ++++------- backend/.env.example | 4 +-- libertai_agents/.gitignore | 5 ++- libertai_agents/README.md | 15 ++------- .../libertai_agents/models/base.py | 1 - .../libertai_agents/models/models.py | 13 +++----- libertai_agents/main.py | 32 ------------------- libertai_agents/pyproject.toml | 6 ++-- 8 files changed, 23 insertions(+), 72 deletions(-) delete mode 100644 libertai_agents/main.py diff --git a/README.md b/README.md index 7765a61..4290ea4 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,11 @@ # LibertAI Agents -## Supported models +LibertAI Agents are highly customizable assistants that operates in a decentralized and confidential environment.\ +They can be given tools to perform tasks (search something on the web, make a transaction on-chain...), making them +powerful companions. -We support multiple open-source models that have agentic capabilities. +> 💡 Agents are currently in private beta, contact the team [on Telegram](https://t.me/libertai) if you +want to try it out!\ +We are planning some improvements and will listen to beta tester's feedbacks before releasing a stable version. -- [Hermes 2 Pro - Llama 3 8B](https://huggingface.co/NousResearch/Hermes-2-Pro-Llama-3-8B) -- ⏳ [Hermes 3 - Llama-3.1 8B](https://huggingface.co/NousResearch/Hermes-3-Llama-3.1-8B) -- ⏳ [Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407) - -## Using a gated model - -Some models, like [Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407) are gated ( -generally to require you to accept some usage conditions).\ -To use those models, you need to create an [access token](https://huggingface.co/settings/tokens) from your Hugging Face -account and give it to the `get_model` function. \ No newline at end of file +This repository contains the source code of the actual [Python framework](https://pypi.org/project/libertai-agents) that you can use to create your agents, along with the backend used internally to manage their deployment on [Aleph.im](https://aleph.im)'s decentralized and confidential VMs. diff --git a/backend/.env.example b/backend/.env.example index 32f6651..5d0fd59 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,10 +1,10 @@ # Use the testnet in development # ALEPH_API_URL=https://api.twentysix.testnet.network -# Sender of the messages on Aleph -ALEPH_SENDER=0x00 # Owner of the messages on Aleph (has given permissions to the sender) ALEPH_OWNER=0x00 +# Sender of the messages on Aleph +ALEPH_SENDER=0x00 # Private key of the address to send messages with ALEPH_SENDER_SK= # Public key of the address to send messages with diff --git a/libertai_agents/.gitignore b/libertai_agents/.gitignore index 5cb9268..8b2533b 100644 --- a/libertai_agents/.gitignore +++ b/libertai_agents/.gitignore @@ -1,2 +1,5 @@ /venv -/dist \ No newline at end of file +/dist + +# Development test file +/dev.py \ No newline at end of file diff --git a/libertai_agents/README.md b/libertai_agents/README.md index 7765a61..e4231c4 100644 --- a/libertai_agents/README.md +++ b/libertai_agents/README.md @@ -1,16 +1,7 @@ # LibertAI Agents -## Supported models +Framework to create and deploy decentralized agents 🚀 -We support multiple open-source models that have agentic capabilities. +> ⚠ This framework is in beta and might undergo some breaking changes before the stable release. -- [Hermes 2 Pro - Llama 3 8B](https://huggingface.co/NousResearch/Hermes-2-Pro-Llama-3-8B) -- ⏳ [Hermes 3 - Llama-3.1 8B](https://huggingface.co/NousResearch/Hermes-3-Llama-3.1-8B) -- ⏳ [Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407) - -## Using a gated model - -Some models, like [Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407) are gated ( -generally to require you to accept some usage conditions).\ -To use those models, you need to create an [access token](https://huggingface.co/settings/tokens) from your Hugging Face -account and give it to the `get_model` function. \ No newline at end of file +Take a look at [our documentation](https://docs.libertai.io/agents) to get started! \ No newline at end of file diff --git a/libertai_agents/libertai_agents/models/base.py b/libertai_agents/libertai_agents/models/base.py index 8fdb85b..8081994 100644 --- a/libertai_agents/libertai_agents/models/base.py +++ b/libertai_agents/libertai_agents/models/base.py @@ -8,7 +8,6 @@ logging.getLogger("transformers").disabled = True ModelId = Literal[ - "NousResearch/Hermes-2-Pro-Llama-3-8B", "NousResearch/Hermes-3-Llama-3.1-8B", "mistralai/Mistral-Nemo-Instruct-2407" ] diff --git a/libertai_agents/libertai_agents/models/models.py b/libertai_agents/libertai_agents/models/models.py index 4c13b53..3348b4c 100644 --- a/libertai_agents/libertai_agents/models/models.py +++ b/libertai_agents/libertai_agents/models/models.py @@ -16,17 +16,12 @@ class ModelConfiguration(BaseModel): MODEL_IDS: list[ModelId] = list(typing.get_args(ModelId)) -# TODO: update URLs with prod, and check context size (if we deploy it with a lower one) MODELS_CONFIG: dict[ModelId, ModelConfiguration] = { - "NousResearch/Hermes-2-Pro-Llama-3-8B": ModelConfiguration( - vm_url="https://curated.aleph.cloud/vm/84df52ac4466d121ef3bb409bb14f315de7be4ce600e8948d71df6485aa5bcc3/completion", - context_length=8192, - constructor=HermesModel), - "NousResearch/Hermes-3-Llama-3.1-8B": ModelConfiguration(vm_url="http://localhost:8080/completion", - context_length=131_072, + "NousResearch/Hermes-3-Llama-3.1-8B": ModelConfiguration(vm_url="https://curated.aleph.cloud/vm/84df52ac4466d121ef3bb409bb14f315de7be4ce600e8948d71df6485aa5bcc3/completion", + context_length=4096, constructor=HermesModel), - "mistralai/Mistral-Nemo-Instruct-2407": ModelConfiguration(vm_url="http://localhost:8080/completion", - context_length=131_072, + "mistralai/Mistral-Nemo-Instruct-2407": ModelConfiguration(vm_url="https://curated.aleph.cloud/vm/2c4ad0bf343fb12924936cbc801732d95ce90f84cd895aa8bee82c0a062815c2/completion", + context_length=4096, constructor=MistralModel) } diff --git a/libertai_agents/main.py b/libertai_agents/main.py deleted file mode 100644 index 5202817..0000000 --- a/libertai_agents/main.py +++ /dev/null @@ -1,32 +0,0 @@ -import asyncio - -from libertai_agents.agents import ChatAgent -from libertai_agents.interfaces.messages import Message, MessageRoleEnum -from libertai_agents.models import get_model - - -async def get_current_temperature(location: str, unit: str) -> float: - """ - Get the current temperature at a location. - - Args: - location: The location to get the temperature for, in the format "City, Country" - unit: The unit to return the temperature in. (choices: ["celsius", "fahrenheit"]) - Returns: - The current temperature at the specified location in the specified units, as a float. - """ - return 22. # A real function should probably actually get the temperature! - - -agent = ChatAgent(model=get_model("NousResearch/Hermes-2-Pro-Llama-3-8B"), - system_prompt="You are a helpful assistant", - tools=[get_current_temperature], expose_api=False) - - -async def main(): - async for message in agent.generate_answer( - [Message(role=MessageRoleEnum.user, content="What is the temperature in Paris and in Lyon?")]): - print(message) - - -asyncio.run(main()) diff --git a/libertai_agents/pyproject.toml b/libertai_agents/pyproject.toml index e96cada..f195c3a 100644 --- a/libertai_agents/pyproject.toml +++ b/libertai_agents/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] name = "libertai-agents" -version = "0.0.18" -description = "" +version = "0.0.1" +description = "Framework to create and deploy decentralized agents" authors = ["LibertAI.io team "] readme = "README.md" homepage = "https://libertai.io" repository = "https://github.com/LibertAI/libertai-agents" -documentation = "https://docs.libertai.io" +documentation = "https://docs.libertai.io/agents" classifiers = [ "Operating System :: OS Independent", "Intended Audience :: Developers",