add standalone template parameter in yaml model config
This commit is contained in:
parent
5919c5d360
commit
ff26d16329
2 changed files with 23 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ async function modelConfigToBaseLLM({
|
|||
logger: llmLogger,
|
||||
uniqueId,
|
||||
title: model.name,
|
||||
template: model.template,
|
||||
promptTemplates: model.promptTemplates,
|
||||
baseChatSystemMessage: model.chatOptions?.baseSystemMessage,
|
||||
capabilities: {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,27 @@ const promptTemplatesSchema = z.object({
|
|||
});
|
||||
export type PromptTemplates = z.infer<typeof promptTemplatesSchema>;
|
||||
|
||||
const templateSchema = z.enum([
|
||||
"llama2",
|
||||
"alpaca",
|
||||
"zephyr",
|
||||
"phi2",
|
||||
"phind",
|
||||
"anthropic",
|
||||
"chatml",
|
||||
"none",
|
||||
"openchat",
|
||||
"deepseek",
|
||||
"xwin-coder",
|
||||
"neural-chat",
|
||||
"codellama-70b",
|
||||
"llava",
|
||||
"gemma",
|
||||
"granite",
|
||||
"llama3",
|
||||
]);
|
||||
export type Template = z.infer<typeof templateSchema>;
|
||||
|
||||
const baseModelFields = {
|
||||
name: z.string(),
|
||||
model: z.string(),
|
||||
|
|
@ -80,6 +101,7 @@ const baseModelFields = {
|
|||
embedOptions: embedOptionsSchema.optional(),
|
||||
chatOptions: chatOptionsSchema.optional(),
|
||||
promptTemplates: promptTemplatesSchema.optional(),
|
||||
template: templateSchema.optional(),
|
||||
useLegacyCompletionsEndpoint: z.boolean().optional(),
|
||||
env: z
|
||||
.record(z.string(), z.union([z.string(), z.boolean(), z.number()]))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue