fix: add engine in payload for nitro chat completion api

This commit is contained in:
marknguyen1302 2024-08-28 11:34:35 +07:00
parent 1c5b6355d9
commit 20f0e4301e
2 changed files with 5 additions and 2 deletions

View File

@ -341,6 +341,11 @@ export const chatCompletions = async (request: any, reply: any) => {
request.body.stop = request.body.stop.slice(0, 4)
}
// add engine for new cortex cpp engine
if (requestedModel.engine === 'nitro') {
request.body.engine = 'cortex.llamacpp'
}
const fetch = require('node-fetch')
const response = await fetch(apiUrl, {
method: 'POST',

View File

@ -6,9 +6,7 @@ import {
Model,
ModelExtension,
OptionType,
baseName,
fs,
joinPath,
} from '@janhq/core'
import { atom, useSetAtom } from 'jotai'