patch failing calls to cortex
This commit is contained in:
parent
31971e7821
commit
39bb3f34d6
@ -51,7 +51,7 @@ export default class JanEngineManagementExtension extends EngineManagementExtens
|
||||
*/
|
||||
async onLoad() {
|
||||
// Update default local engine
|
||||
this.updateDefaultEngine()
|
||||
// this.updateDefaultEngine()
|
||||
|
||||
// Migrate
|
||||
this.migrate()
|
||||
@ -66,6 +66,7 @@ export default class JanEngineManagementExtension extends EngineManagementExtens
|
||||
* @returns A Promise that resolves to an object of list engines.
|
||||
*/
|
||||
async getEngines(): Promise<Engines> {
|
||||
return {}
|
||||
return this.apiInstance().then((api) =>
|
||||
api
|
||||
.get('v1/engines')
|
||||
@ -94,6 +95,7 @@ export default class JanEngineManagementExtension extends EngineManagementExtens
|
||||
* @returns A Promise that resolves to an array of installed engine.
|
||||
*/
|
||||
async getInstalledEngines(name: string): Promise<EngineVariant[]> {
|
||||
return []
|
||||
return this.apiInstance().then((api) =>
|
||||
api
|
||||
.get(`v1/engines/${name}`)
|
||||
|
||||
@ -23,7 +23,7 @@ import {
|
||||
} from '@janhq/core'
|
||||
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { createHmac } from 'crypto'
|
||||
// import { createHmac } from 'crypto'
|
||||
|
||||
type LlamacppConfig = {
|
||||
n_gpu_layers: number;
|
||||
@ -131,8 +131,9 @@ export default class llamacpp_extension extends AIEngine {
|
||||
}
|
||||
|
||||
private generateApiKey(modelId: string): string {
|
||||
const hash = createHmac('sha256', this.apiSecret).update(modelId).digest("base64")
|
||||
return hash
|
||||
return ''
|
||||
// const hash = createHmac('sha256', this.apiSecret).update(modelId).digest("base64")
|
||||
// return hash
|
||||
}
|
||||
|
||||
// Implement the required LocalProvider interface methods
|
||||
|
||||
@ -288,6 +288,7 @@ export default class JanModelExtension extends ModelExtension {
|
||||
* @param model
|
||||
*/
|
||||
async getSources(): Promise<ModelSource[]> {
|
||||
return []
|
||||
const sources = await this.apiInstance()
|
||||
.then((api) => api.get('v1/models/sources').json<Data<ModelSource>>())
|
||||
.then((e) => (typeof e === 'object' ? (e.data as ModelSource[]) : []))
|
||||
@ -304,6 +305,7 @@ export default class JanModelExtension extends ModelExtension {
|
||||
* @param model
|
||||
*/
|
||||
async addSource(source: string): Promise<any> {
|
||||
return
|
||||
return this.apiInstance().then((api) =>
|
||||
api.post('v1/models/sources', {
|
||||
json: {
|
||||
@ -353,6 +355,7 @@ export default class JanModelExtension extends ModelExtension {
|
||||
* @returns
|
||||
*/
|
||||
async fetchModels(): Promise<Model[]> {
|
||||
return []
|
||||
return this.apiInstance()
|
||||
.then((api) => api.get('v1/models?limit=-1').json<Data<Model>>())
|
||||
.then((e) =>
|
||||
@ -401,6 +404,7 @@ export default class JanModelExtension extends ModelExtension {
|
||||
* Fetch models from cortex.so
|
||||
*/
|
||||
fetchModelsHub = async () => {
|
||||
return
|
||||
const models = await this.fetchModels()
|
||||
|
||||
defaultModelSources.forEach((model) => {
|
||||
|
||||
@ -87,7 +87,7 @@ pub async fn load_llama_model(
|
||||
let mut command = Command::new(server_path);
|
||||
|
||||
let model_path = args[2].replace("-m", "");
|
||||
let api_key = args[1].replace("--api-key", "")
|
||||
let api_key = args[1].replace("--api-key", "");
|
||||
command.args(args);
|
||||
|
||||
// Optional: Redirect stdio if needed (e.g., for logging within Jan)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user