ai icon indicating copy to clipboard operation
ai copied to clipboard

Model Registry non-standard parameters

Open crtnx opened this issue 1 year ago • 0 comments

Feature Description

The current implementation of experimental model registry doesn't allow any parameters except a model id. There is no way to pass optional non-standard parameters to a model, like topK. The change should be simple enough (just for illustration):

languageModel(id: string, options: any): LanguageModel {
    const [providerId, modelId] = this.splitId(id);
    const model = this.getProvider(providerId).languageModel?.(modelId, options);

    if (model == null) {
      throw new NoSuchModelError({ modelId: id, modelType: 'language model' });
    }

    return model;
  }

Use Case

No response

Additional context

No response

crtnx avatar Jul 13 '24 17:07 crtnx