Smart Contracts in OMRP
The Optimal Model Retrieval Protocol (OMRP) primarily relies on one key smart contract to manage its decentralized operations: the Discovery Contract. This contract handles crucial aspects of the model selection process. This section details the structure and functionality of the Discovery Contract.
Discovery Contract
The Discovery Contract is central to OMRP's model selection process, providing on-chain verification and execution of the final model selection step.
Key features:
Implements the promptEval() function
Executes the Generative Algorithm for model ranking and selection
Ensures transparency and immutability of the selection process
promptEval() Function
The promptEval() function is responsible for evaluating the results of the off-chain k-NN search and finalizing the model selection process.
This function takes a hash of the user's prompt (for verification purposes), an array of model IDs, and their corresponding similarity scores. It returns an array of selected model IDs.
Generative Algorithm Implementation
The Generative Algorithm is implemented within the Discovery Contract to rank and select suitable models based on the similarity scores and any additional criteria.
This internal function processes the model IDs and their similarity scores to produce a ranked list of model IDs.
Model Selection Configuration
The contract includes functions to configure the model selection process, allowing for adjustments to the selection criteria or algorithm parameters.
This allows the contract owner to update the selection criteria as needed, providing flexibility in the model selection process.
Events and Logging
The contract emits events to provide transparency and enable off-chain systems to track the model selection process.
These events allow external systems to monitor the contract's operations and provide data for analytics and auditing purposes.
The Discovery Contract forms the backbone of the on-chain component of OMRP, ensuring a transparent and verifiable model selection process. It works in concert with the off-chain components to provide a secure, efficient, and decentralized model discovery service within the larger AI ecosystem.
Last updated