xebia-functional / xef

Building applications with LLMs through composability, in Kotlin, Scala, ...
https://xef.ai
Apache License 2.0
177 stars 15 forks source link

abstract ModelType #405

Open Intex32 opened 1 year ago

Intex32 commented 1 year ago

Goal: generalize the ModelType class from OpenAI specific implementations to support multiple providers

I consider ModelType a formal description of a model and it's properties without any capabilities. This includes eg name, contextLength.

my suggestions:

depends on #393

Intex32 commented 1 year ago

After further assessment, I think maintaining a model structure (such as ModelType) besides the actual models with capabilities is not worth the effort. I suggest inlining the functionality of ModelType into the implementations of LLM. This is necessary as the encoding and context length is not the same for all models and providers and requires some more hierarchy. Currently, ModelType is heavily designed for OAI. This idea and it's consequences are subject of exploration in this issue.

ModelType held following properties:

ModelType's encoding type was used eg for summarization or adapting a prompt to the context size.