Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 2b47c8e

Browse files
authored
feat: add model pull api support (#688)
1 parent fc225d2 commit 2b47c8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+551
-279
lines changed

cortex-js/src/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { DatabaseModule } from './infrastructure/database/database.module';
77
import { ChatModule } from './usecases/chat/chat.module';
88
import { AssistantsModule } from './usecases/assistants/assistants.module';
99
import { ExtensionModule } from './infrastructure/repositories/extensions/extension.module';
10-
import { ModelRepositoryModule } from './infrastructure/repositories/model/model.module';
10+
import { ModelRepositoryModule } from './infrastructure/repositories/models/model.module';
1111
import { CortexModule } from './usecases/cortex/cortex.module';
1212
import { ConfigModule } from '@nestjs/config';
1313
import { env } from 'node:process';
1414
import { SeedService } from './usecases/seed/seed.service';
15-
import { FileManagerModule } from './file-manager/file-manager.module';
15+
import { FileManagerModule } from './infrastructure/services/file-manager/file-manager.module';
1616
import { AppLoggerMiddleware } from './infrastructure/middlewares/app.logger.middleware';
1717

1818
@Module({

cortex-js/src/command.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ModelUpdateCommand } from './infrastructure/commanders/models/model-upd
2323
import { AssistantsModule } from './usecases/assistants/assistants.module';
2424
import { CliUsecasesModule } from './infrastructure/commanders/usecases/cli.usecases.module';
2525
import { MessagesModule } from './usecases/messages/messages.module';
26-
import { FileManagerModule } from './file-manager/file-manager.module';
26+
import { FileManagerModule } from './infrastructure/services/file-manager/file-manager.module';
2727
import { PSCommand } from './infrastructure/commanders/ps.command';
2828
import { KillCommand } from './infrastructure/commanders/kill.command';
2929
import { PresetCommand } from './infrastructure/commanders/presets.command';

cortex-js/src/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { CommandFactory } from 'nest-commander';
33
import { CommandModule } from './command.module';
44
import updateNotifier from 'update-notifier';
5-
import packageJson from './../package.json';
5+
import packageJson from '@/../package.json';
66

77
async function bootstrap() {
88
await CommandFactory.run(CommandModule, ['warn', 'error']);

cortex-js/src/domain/abstracts/engine.abstract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */
22
import stream from 'stream';
3-
import { Model, ModelSettingParams } from '../models/model.interface';
3+
import { Model, ModelSettingParams } from '@/domain/models/model.interface';
44
import { Extension } from './extension.abstract';
55

66
export abstract class EngineExtension extends Extension {

cortex-js/src/domain/models/huggingface.interface.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
export interface HuggingFaceModelVersion {
2+
rfilename: string;
3+
downloadUrl?: string;
4+
fileSize?: number;
5+
quantization?: Quantization;
6+
}
17
export interface HuggingFaceRepoData {
28
id: string;
39
modelId: string;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Extension } from '../abstracts/extension.abstract';
1+
import { Extension } from '@/domain/abstracts/extension.abstract';
22
import { Repository } from './repository.interface';
33

44
export abstract class ExtensionRepository extends Repository<Extension> {}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Model } from '../models/model.interface';
1+
import { Model } from '@/domain/models/model.interface';
22
import { Repository } from './repository.interface';
33

44
export abstract class ModelRepository extends Repository<Model> {}

cortex-js/src/infrastructure/commanders/models/model-get.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommandRunner, SubCommand } from 'nest-commander';
2-
import { ModelsCliUsecases } from '../usecases/models.cli.usecases';
2+
import { ModelsCliUsecases } from '@commanders/usecases/models.cli.usecases';
33
import { exit } from 'node:process';
44

55
@SubCommand({ name: 'get', description: 'Get a model by ID.' })

cortex-js/src/infrastructure/commanders/models/model-list.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommandRunner, SubCommand, Option } from 'nest-commander';
2-
import { ModelsCliUsecases } from '../usecases/models.cli.usecases';
2+
import { ModelsCliUsecases } from '@commanders/usecases/models.cli.usecases';
33

44
interface ModelListOptions {
55
format: 'table' | 'json';

cortex-js/src/infrastructure/commanders/models/model-pull.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CommandRunner, SubCommand } from 'nest-commander';
22
import { exit } from 'node:process';
3-
import { ModelsCliUsecases } from '../usecases/models.cli.usecases';
3+
import { ModelsCliUsecases } from '@commanders/usecases/models.cli.usecases';
44
import { ModelNotFoundException } from '@/infrastructure/exception/model-not-found.exception';
55

66
@SubCommand({

0 commit comments

Comments
 (0)