# Technology Architecture

### How does this work?

HEXS consists of a factory smart contract as an entrance to an Agent creation. Smart Contract (Factory) deploys agent smart contracts and related instances for each model being fine-tuned by developers. These agents' smart contracts set up a Decentralized Autonomous Organization (DAO) contract with them to hold the future owners of this model. The owner joins the agent's DAO upon initialization, and new users of the fine-tuned model automatically become members.

Agent Contract holds an AI Agent Ledger that manages records of training shares and other metadata throughout the fine-tuning process. Pre-trained models sourced from open-source hubs like Hugging Face serve as the foundation and are fine-tuned using leased computation resources, such as GPUs from the Akash Blockchain.

Subsequently, the Agent playground is utilized to run and test the fine-tuned model's performance across various parameters and features, comparing it with other models on the marketplace. Developers then publish their research and deploy their fine-tuned models on the platform's Marketplace for monetization, enabling end-users to access and utilize them via API keys.

When a fine-tuned model is deployed, the AI Agent Ledger updates training shares and other values within the DAO accordingly with the distributed training formula. After deployment, end-users can purchase or access free APIs (per the model settings) to integrate these fine-tuned models into their applications, leveraging their specialized capabilities. This process facilitates developers in sharing and monetizing their work while providing valuable AI resources to end-users.

<figure><img src="https://661449516-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo2KdNuXHXLMwQlMCdTpZ%2Fuploads%2FzHsctnOVWS5fZ4881DvZ%2FScreenshot%202024-04-27%20at%203.34.58%E2%80%AFAM.png?alt=media&#x26;token=92575d3a-57d3-4844-87ad-b7c9f2a85272" alt=""><figcaption></figcaption></figure>

### HEXS consists of the following,

#### Hexs Smart Contract(Factory):&#x20;

The Hexs Smart Contracts(Factory) deploys agent smart contracts and other instances for every model which the developer is fine-tuning. The pre-trained models after getting finetuned are known as agents.

**Agent Smart Contract:** The agent smart contract initializes an AI agent Ledger and a DAO. The owner becomes the member of that agent's DAO at its initialization and each new user of that finetuned model keeps on becoming its member.

**AI Agent Ledger:** AI Agent Ledger is responsible for recording training shares and other metadata such as model trends,  ratings, etc. These recorded data are later shared with the DAO.

**Open Source Hubs:** Pre-trained models are leveraged from open-source hubs like Hugging Face. These pre-trained models will be finetuned using leased computation resources like GPUs from the Akash Blockchain.&#x20;

**Akash Blockchain:** Akash Blockchain offers computation power and resources which is an inexpensive and feasible supercloud network to train AI models.

**Agent Playground:** Agent Playground tests the finetuned model's working on various parameters to compare its benchmark scores and features with other models on the marketplace.

**Marketplace:** Marketplace allows developers to publish their research and deploy their work like the finetuned model on the platform so that they can be monetized and the end-users can use them. When a fine-tuned model is deployed in the marketplace, the AI Agent Ledger updates the training shares and other values in the DAO after deployment end-users can purchase APIs of these finetuned models to build applications using them.

### User flow,

The process begins with a developer downloading a model (fine-tuned or pre-trained) from the marketplace. Then the developer proceeds to fine-tune the downloaded model to a preferred niche using leased computational resources from Akash Blockchain.

Later, the developer deploys the model on the marketplace so that end-users can use it for a fee which would generate revenue or sell the model to interested buyers altogether.

### Distributed training formula,

The formula for calculating Distributed Training on Hexs incorporates user engagement, ratings, and model popularity, averaging these factors to determine the overall score.

### Who'll be using HEXS,

#### LLM Developers:&#x20;

LLM developers refine pre-trained Language Model Models (LLMs) or agents within the fine-tuned models space on the Hexs platform.

#### Application Developers:

Application developers utilize inexpensive APIs provided by the Hexs platform to develop their applications.

#### Users:

Users generate inexpensive inferencing from the models deployed on the Hexs marketplace using credits.
