Overview

This document provides an overview of three key model classes used in the SDK: Model, OpenAIModel, and SagemakerModel. These classes are designed to facilitate the integration and usage of various LLMs in your applications. Each class inherits from the base Model class, which provides a consistent interface for setting up and running models with specific API keys and hyperparameters.

  • The Model class is an abstract class and cannot be instantiated directly. Subclasses like OpenAIModel and SagemakerModel provide specific implementations for their respective platforms.
  • The api_keys parameter is essential and must be provided for the model to function correctly.
  • Each subclass is responsible for handling the specific setup and execution of its respective platform’s model.

Fields (Model Class)

ParameterTypeDefaultDescriptionRequired
api_keysDict[str, str]N/AAPI keys needed to run the model.Yes
llmOptional[LLM]None, Nomadic creates the LlamaIndex LLM for you. However, you can also define any LlamaIndex LLM here.The language model (LLM) instance used to run the experimentNo
required_api_keysClassVar[Set[str]]set()A set of API keys that the model expects to receive.No
hyperparametersClassVar[Dict]DEFAULT_HYPERPARAMETER_SEARCH_SPACEA dictionary defining the hyperparameters that can be tuned for the model.No
namestr"my model"The name of the model.No
client_idOptional[str]NoneID of Model on the Nomadic Workspace, if synchedNo

Methods

  • get_required_api_keys() -> Set[str]: Returns the set of expected API keys for the model.
  • get_hyperparameters() -> Dict: Returns the hyperparameters that can be tuned for the model.
  • run(**kwargs) -> RunResult: Abstract method that must be implemented by subclasses to execute the model with the provided parameters and return a RunResult object.

Supported Model Subclasses