Search

Model Sidecars

Model Sidecars

The concept of a model sidecar is to allow us have shared code in a model that other models can use. The implementation of sidecars is in the model runtime actions. Basically in your model.yml you would refer to one or more model sidecars, these would be the URI’s of models that you want downloaded alongside your model. For example:

# A very simple first model that isn't trainable

slug: llm-taxonomy-model
orgSlug: kodexa
version: 1.0.0
type: store
storeType: MODEL
name: LLM Taxonomy Model
metadata:
  type: model
  modelRuntimeRef: kodexa/base-model-runtime
  modelSidecars:
  - kodexa/kodexa-langchain-model:1.0.0

In this snippet of the llm-taxonomy-model we see that we want to have the kodexa-langchain-model available as a sidecar. With this in place you can now import classes from the module that is part of this model, for example in your llm-taxonomy-model you can use

from kodexa_langchain.utils import get_bedrock_client
bedrock_client = get_bedrock_client(region="us-east-1")

On this page