Custom model or app
Specify your application or model with a Python script
Using a Python function as the entry-point, you can define a custom model to test with Empirical. This method can be also used to test an application, which does pre or post-processing around the LLM call or chains multiple LLM calls together.
Run configuration
A minimal configuration looks like:
Set to “py-script”
Specify path to the Python file, which must have a function def execute
(see file structure)
JSON object of parameters passed to the execute
method to customize script behavior
A custom name or label for this run (auto-generated if not specified)
File structure
The Python file is expected to have a method called execute
with the following
signature:
Function arguments
A dict object of key-value pairs with inputs picked up from the dataset
A dict object of key-value pairs that can be used to modify the script’s behavior. Parameters are defined in the run configuration.
Function return type
The function is expected to return the output object with value
(string) as the
required field.
Example
The RAG example
uses this model provider to test a RAG application. The metadata
field is used to capture the retrieved context.