• Fetches a model configuration based on its name, and then fills in missing properties (if any) with the given default values or from the found model configuration.

    Parameters

    • name: string

      The name of the model to load its configuration.

    • models: ModelConf[]

      List of available model configurations.

    • Optionalctx: number

      Default context to be used if not provided in the found model configuration.

    • Optionaltemplate: string

      Default template string to be used if not provided in the found model configuration.

    • Optionalgpu_layers: number

    Returns ModelConf

    • The fetched or constructed model configuration based on the provided parameters.
    const models = [
    { name: 'somemodel.gguf', ctx: 2048, template: 'alpaca' }
    ];

    const conf = loadModelFromConf('somemodel.gguf', models);
    console.log(conf); // { name: 'somemodel.gguf', ctx: 2048, template: 'alpaca' }