@devilsdev/rag-pipeline-utils 2.4.5 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ragrc.schema.json +83 -192
- package/CHANGELOG.md +431 -0
- package/README.md +418 -117
- package/SECURITY.md +5 -5
- package/dist/experimental.cjs +2 -0
- package/dist/experimental.d.ts +1 -0
- package/dist/experimental.mjs +5 -0
- package/dist/index.cjs +6442 -1355
- package/dist/index.d.ts +129 -2
- package/dist/index.mjs +1 -1
- package/dist/testing.cjs +2 -0
- package/dist/testing.d.ts +1 -0
- package/dist/testing.mjs +5 -0
- package/dist/types/adapters/ai-sdk.d.ts +53 -0
- package/dist/types/agentic/agentic-pipeline.d.ts +103 -0
- package/dist/types/agentic/iterative-retriever.d.ts +85 -0
- package/dist/types/agentic/query-planner.d.ts +145 -0
- package/dist/types/agentic/self-critique.d.ts +45 -0
- package/dist/types/ai/adaptive-retrieval.d.ts +44 -0
- package/dist/types/ai/federation/federated-learning-coordinator.d.ts +62 -0
- package/dist/types/ai/multimodal-processing.d.ts +32 -0
- package/dist/types/ai/multimodal.d.ts +39 -0
- package/dist/types/ai/retrieval-engine.d.ts +37 -0
- package/dist/types/ai/training/model-training-orchestrator.d.ts +31 -0
- package/dist/types/cache/component-keys.d.ts +7 -0
- package/dist/types/cache/memory-cache.d.ts +54 -0
- package/dist/types/cache/pipeline-cache.d.ts +66 -0
- package/dist/types/cache/redis-cache.d.ts +46 -0
- package/dist/types/chunking/chunking-engine.d.ts +70 -0
- package/dist/types/chunking/strategies/fixed-size.d.ts +17 -0
- package/dist/types/chunking/strategies/recursive.d.ts +20 -0
- package/dist/types/chunking/strategies/semantic.d.ts +19 -0
- package/dist/types/chunking/strategies/sentence.d.ts +13 -0
- package/dist/types/chunking/strategies/structure-aware.d.ts +19 -0
- package/dist/types/citation/citation-tracker.d.ts +64 -0
- package/dist/types/citation/hallucination-detector.d.ts +40 -0
- package/dist/types/citation/source-mapper.d.ts +37 -0
- package/dist/types/connectors/anthropic-connector.d.ts +97 -0
- package/dist/types/connectors/base-connector.d.ts +87 -0
- package/dist/types/connectors/cohere-connector.d.ts +94 -0
- package/dist/types/connectors/connector-utils.d.ts +110 -0
- package/dist/types/connectors/local-embedder.d.ts +95 -0
- package/dist/types/connectors/memory-retriever.d.ts +99 -0
- package/dist/types/connectors/ollama-connector.d.ts +115 -0
- package/dist/types/connectors/openai-connector.d.ts +129 -0
- package/dist/types/connectors/rag-prompt.d.ts +40 -0
- package/dist/types/core/create-pipeline.d.ts +8 -0
- package/dist/types/core/plugin-registry.d.ts +136 -0
- package/dist/types/core/stage-contracts.d.ts +36 -0
- package/dist/types/core/validate-plugin.d.ts +45 -0
- package/dist/types/cost/cost-calculator.d.ts +152 -0
- package/dist/types/cost/cost-tracker.d.ts +126 -0
- package/dist/types/cost/token-budget.d.ts +110 -0
- package/dist/types/dag/core/error-context.d.ts +239 -0
- package/dist/types/dag/core/execution-scheduler.d.ts +191 -0
- package/dist/types/dag/core/topology-validation.d.ts +226 -0
- package/dist/types/dag/dag-engine.d.ts +156 -0
- package/dist/types/dag/dag-node.d.ts +37 -0
- package/dist/types/dashboard/dashboard-generator.d.ts +127 -0
- package/dist/types/dashboard/metrics-aggregator.d.ts +218 -0
- package/dist/types/debug/execution-tracer.d.ts +57 -0
- package/dist/types/debug/trace-inspector.d.ts +31 -0
- package/dist/types/ecosystem/plugin-certification.d.ts +169 -0
- package/dist/types/enterprise/data-governance.d.ts +203 -0
- package/dist/types/enterprise/multi-tenancy.d.ts +137 -0
- package/dist/types/enterprise/sso-integration.d.ts +420 -0
- package/dist/types/evaluate/context-metrics.d.ts +55 -0
- package/dist/types/evaluate/faithfulness.d.ts +41 -0
- package/dist/types/evaluate/groundedness.d.ts +60 -0
- package/dist/types/evaluate/pipeline-evaluator.d.ts +88 -0
- package/dist/types/evaluate/relevance.d.ts +21 -0
- package/dist/types/evaluate/scoring.d.ts +123 -0
- package/dist/types/evaluate/semantic-similarity.d.ts +14 -0
- package/dist/types/experimental.d.ts +15 -0
- package/dist/types/graph/entity-extractor.d.ts +84 -0
- package/dist/types/graph/graph-index.d.ts +49 -0
- package/dist/types/graph/graph-retriever.d.ts +81 -0
- package/dist/types/graph/knowledge-graph.d.ts +129 -0
- package/dist/types/grounding/check-answer.d.ts +101 -0
- package/dist/types/guardrails/guardrails-pipeline.d.ts +63 -0
- package/dist/types/guardrails/injection-detector.d.ts +47 -0
- package/dist/types/guardrails/post-generation-guard.d.ts +61 -0
- package/dist/types/guardrails/pre-retrieval-guard.d.ts +64 -0
- package/dist/types/guardrails/retrieval-guard.d.ts +57 -0
- package/dist/types/mcp/mcp-server.d.ts +85 -0
- package/dist/types/mcp/mcp-tool-builder.d.ts +55 -0
- package/dist/types/reranker/cascade-reranker.d.ts +40 -0
- package/dist/types/reranker/embedding-reranker.d.ts +77 -0
- package/dist/types/reranker/scoring-reranker.d.ts +41 -0
- package/dist/types/retrieval/bm25-search.d.ts +43 -0
- package/dist/types/retrieval/file-vector-store.d.ts +99 -0
- package/dist/types/retrieval/hybrid-retriever.d.ts +35 -0
- package/dist/types/retrieval/rank-fusion.d.ts +10 -0
- package/dist/types/security/jwt-config.d.ts +80 -0
- package/dist/types/security/jwt-validator.d.ts +195 -0
- package/dist/types/security/plugin-sandbox.d.ts +158 -0
- package/dist/types/security/plugin-signature-verifier.d.ts +139 -0
- package/dist/types/security/validator.d.ts +5 -0
- package/dist/types/streaming/embedding-stream.d.ts +65 -0
- package/dist/types/streaming/sse-adapter.d.ts +59 -0
- package/dist/types/streaming/stream-router.d.ts +88 -0
- package/dist/types/streaming/streaming-embedder.d.ts +99 -0
- package/dist/types/streaming/websocket-adapter.d.ts +71 -0
- package/dist/types/templates/scaffold.d.ts +55 -0
- package/dist/types/templates/template-registry.d.ts +63 -0
- package/dist/types/testing.d.ts +168 -0
- package/dist/types/utils/embed-query.d.ts +20 -0
- package/dist/types/utils/logger.d.ts +50 -0
- package/dist/types/utils/rate-limiter.d.ts +66 -0
- package/dist/types/utils/retry.d.ts +27 -0
- package/dist/types/utils/run-abort.d.ts +34 -0
- package/dist/types/utils/secure-logging.d.ts +51 -0
- package/dist/types/utils/structured-logger.d.ts +126 -0
- package/package.json +72 -33
- package/src/adapters/ai-sdk.js +215 -0
- package/src/agentic/agentic-pipeline.js +75 -7
- package/src/agentic/iterative-retriever.js +47 -10
- package/src/agentic/query-planner.js +329 -78
- package/src/cache/component-keys.js +38 -0
- package/src/cache/memory-cache.js +87 -0
- package/src/cache/pipeline-cache.js +260 -0
- package/src/cache/redis-cache.js +83 -0
- package/src/citation/citation-tracker.js +6 -4
- package/src/citation/hallucination-detector.js +2 -2
- package/src/citation/source-mapper.js +15 -28
- package/src/cli/commands/ai.js +106 -0
- package/src/cli/commands/plugin-hub/event-handlers.js +6 -0
- package/src/cli/commands/plugin-hub/hub-commands.js +0 -74
- package/src/cli/commands/plugin-hub/local-commands.js +143 -0
- package/src/cli/commands/plugin-hub.js +114 -49
- package/src/cli/diagnostics/config-checker.js +76 -63
- package/src/cli/diagnostics/environment-checker.js +62 -31
- package/src/cli/diagnostics/plugin-checker.js +36 -89
- package/src/cli/doctor-command.js +39 -5
- package/src/cli/enhanced-cli-commands.js +104 -233
- package/src/cli/handlers/ai-handler.js +364 -0
- package/src/cli/handlers/diagnostics-handler.js +78 -31
- package/src/cli/handlers/ingest-handler.js +28 -22
- package/src/cli/handlers/init-handler.js +148 -25
- package/src/cli/handlers/query-handler.js +203 -25
- package/src/cli/handlers/run-handler.js +16 -167
- package/src/cli/handlers/serve-handler.js +60 -0
- package/src/cli/services/bench-stats.js +54 -0
- package/src/cli/services/benchmark.js +161 -0
- package/src/cli/services/feedback.js +155 -0
- package/src/cli/services/instrument.js +83 -0
- package/src/cli/services/rag-service.js +361 -0
- package/src/cli/shared/cli-utils.js +24 -7
- package/src/cli/shared/config-context.js +21 -0
- package/src/cli/wizard/config-builder.js +81 -0
- package/src/cli/wizard/init-wizard.js +602 -0
- package/src/config/component-factory.js +125 -0
- package/src/config/enhanced-ragrc-schema.js +0 -2
- package/src/config/load-config.js +29 -10
- package/src/config/load-plugin-config.js +46 -2
- package/src/config/validate-schema.js +4 -1
- package/src/connectors/anthropic-connector.js +115 -57
- package/src/connectors/base-connector.js +74 -19
- package/src/connectors/cohere-connector.js +108 -34
- package/src/connectors/connector-utils.js +302 -0
- package/src/connectors/local-embedder.js +63 -5
- package/src/connectors/memory-retriever.js +125 -14
- package/src/connectors/ollama-connector.js +112 -51
- package/src/connectors/openai-connector.js +153 -44
- package/src/connectors/rag-prompt.js +88 -0
- package/src/core/create-pipeline.js +307 -61
- package/src/core/performance/parallel-processor.js +62 -1
- package/src/core/plugin-registry.js +125 -26
- package/src/core/stage-contracts.js +36 -0
- package/src/core/validate-plugin.js +85 -0
- package/src/cost/cost-calculator.js +205 -32
- package/src/debug/execution-tracer.js +14 -4
- package/src/dev/dev-server.js +173 -11
- package/src/dev/hot-reload.js +44 -4
- package/src/ecosystem/plugin-checks.js +181 -0
- package/src/ecosystem/plugin-hub.js +50 -125
- package/src/ecosystem/plugin-installer.js +298 -0
- package/src/ecosystem/plugin-probe.js +127 -0
- package/src/ecosystem/plugin-scanner.js +185 -0
- package/src/ecosystem/tar-extract.js +114 -0
- package/src/enterprise/audit-logging.js +158 -29
- package/src/enterprise/sso-integration.js +716 -228
- package/src/evaluate/context-metrics.js +28 -16
- package/src/evaluate/evaluator.js +3 -3
- package/src/evaluate/faithfulness.js +18 -14
- package/src/evaluate/groundedness.js +43 -12
- package/src/evaluate/pipeline-evaluator.js +35 -8
- package/src/evaluate/scoring.js +251 -3
- package/src/evaluate/semantic-similarity.js +79 -0
- package/src/experimental.js +71 -0
- package/src/grounding/check-answer.js +173 -0
- package/src/guardrails/guardrails-pipeline.js +69 -7
- package/src/guardrails/injection-detector.js +283 -0
- package/src/guardrails/post-generation-guard.js +19 -0
- package/src/guardrails/pre-retrieval-guard.js +36 -36
- package/src/guardrails/retrieval-guard.js +58 -8
- package/src/index.js +58 -1
- package/src/loader/csv-loader.js +3 -2
- package/src/loader/document-reader.js +91 -0
- package/src/loader/html-loader.js +3 -1
- package/src/loader/markdown-loader.js +3 -2
- package/src/reranker/cascade-reranker.js +3 -0
- package/src/reranker/embedding-reranker.js +136 -21
- package/src/reranker/llm-reranker.js +79 -12
- package/src/reranker/scoring-reranker.js +3 -0
- package/src/retrieval/bm25-search.js +12 -6
- package/src/retrieval/file-vector-store.js +241 -0
- package/src/retrieval/hybrid-retriever.js +22 -19
- package/src/security/jwt-config.js +13 -2
- package/src/security/jwt-validator.js +139 -34
- package/src/security/plugin-sandbox.js +18 -1
- package/src/security/plugin-signature-verifier.js +245 -70
- package/src/testing.js +254 -0
- package/src/utils/deprecate.js +69 -0
- package/src/utils/embed-query.js +33 -0
- package/src/utils/input-sanitizer.js +19 -4
- package/src/utils/logger.js +34 -4
- package/src/utils/run-abort.js +102 -0
- package/src/ai/federated-learning.js +0 -211
- package/src/ai/federation.js +0 -71
- package/src/ai/index.js +0 -22
- package/src/ai/model-trainer.js +0 -217
- package/src/ai/model-training.js +0 -202
- package/src/ai/multimodal/multi-modal-processor.js +0 -345
- package/src/ai/orchestrator.js +0 -65
- package/src/ai/retrieval/adaptive-retrieval-engine.js +0 -398
- package/src/cli/commands/ai-ml/adaptive-commands.js +0 -178
- package/src/cli/commands/ai-ml/federated-commands.js +0 -207
- package/src/cli/commands/ai-ml/index.js +0 -17
- package/src/cli/commands/ai-ml/multimodal-commands.js +0 -187
- package/src/cli/commands/ai-ml/shared.js +0 -51
- package/src/cli/commands/ai-ml/training-commands.js +0 -228
- package/src/cli/commands/ai-ml.js +0 -386
- package/src/cli/commands/docs.js +0 -228
- package/src/cli/commands/dx.js +0 -538
- package/src/cli/commands/wizard.js +0 -627
- package/src/cli/input-sanitization-middleware.js +0 -356
- package/src/cli/interactive-wizard.js +0 -373
- package/src/cli/templates/development.template.json +0 -64
- package/src/cli/templates/minimal.template.json +0 -33
- package/src/cli/templates/production.template.json +0 -104
- package/src/cli/templates/testing.template.json +0 -45
- package/src/cli/wizard/configuration.js +0 -148
- package/src/cli/wizard/observability.js +0 -79
- package/src/cli/wizard/performance.js +0 -76
- package/src/cli/wizard/plugin-selection.js +0 -297
- package/src/cli/wizard/preview-save.js +0 -172
- package/src/cli/wizard/project-setup.js +0 -66
- package/src/core/pipeline-factory.js +0 -59
- package/src/dag/enhanced-dag-engine.js +0 -894
- package/src/dx/index.js +0 -40
- package/src/dx/integration-templates.js +0 -662
- package/src/dx/performance-profiler.js +0 -968
- package/src/dx/realtime-debugger.js +0 -755
- package/src/dx/visual-pipeline-builder.js +0 -578
- package/src/ingest.js +0 -59
- package/src/pipeline/pipeline.js +0 -18
- package/src/query.js +0 -117
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Federated learning CLI commands
|
|
3
|
-
* Handles federation creation, joining, rounds, and statistics
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const chalk = require("chalk");
|
|
7
|
-
const ora = require("ora");
|
|
8
|
-
const Table = require("cli-table3");
|
|
9
|
-
const { colorizeStatus } = require("./shared");
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Create a federated learning session
|
|
13
|
-
* @param {FederatedLearningCoordinator} federatedLearning - The federated learning coordinator instance
|
|
14
|
-
* @param {object} _options - Command options
|
|
15
|
-
*/
|
|
16
|
-
async function createFederation(federatedLearning, _options) {
|
|
17
|
-
const spinner = ora("Creating federated learning session...").start();
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
if (!_options.tenant) {
|
|
21
|
-
spinner.fail("Tenant ID is required");
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const modelConfig = {
|
|
26
|
-
_type: _options.modelType,
|
|
27
|
-
architecture: _options.architecture,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const federationOptions = {
|
|
31
|
-
minParticipants: parseInt(_options.minParticipants),
|
|
32
|
-
maxParticipants: parseInt(_options.maxParticipants),
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const federationId = await federatedLearning.createFederation(
|
|
36
|
-
_options.tenant,
|
|
37
|
-
modelConfig,
|
|
38
|
-
federationOptions,
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
spinner.succeed("Federation created successfully");
|
|
42
|
-
|
|
43
|
-
console.log(chalk.green("\n✓ Federated learning session created"));
|
|
44
|
-
// eslint-disable-line no-console
|
|
45
|
-
console.log(chalk.blue(`Federation ID: ${federationId}`));
|
|
46
|
-
// eslint-disable-line no-console
|
|
47
|
-
console.log(chalk.blue(`Model Type: ${_options.modelType}`));
|
|
48
|
-
// eslint-disable-line no-console
|
|
49
|
-
console.log(
|
|
50
|
-
chalk.blue(
|
|
51
|
-
`Min/Max Participants: ${_options.minParticipants}/${_options.maxParticipants}`,
|
|
52
|
-
),
|
|
53
|
-
);
|
|
54
|
-
// eslint-disable-line no-console
|
|
55
|
-
} catch (error) {
|
|
56
|
-
spinner.fail(`Federation creation failed: ${error.message}`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Join a federated learning session
|
|
62
|
-
* @param {FederatedLearningCoordinator} federatedLearning - The federated learning coordinator instance
|
|
63
|
-
* @param {string} federationId - Federation ID
|
|
64
|
-
* @param {object} _options - Command options
|
|
65
|
-
*/
|
|
66
|
-
async function joinFederation(federatedLearning, federationId, _options) {
|
|
67
|
-
const spinner = ora("Joining federated learning session...").start();
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
if (!_options.tenant) {
|
|
71
|
-
spinner.fail("Tenant ID is required");
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const participantInfo = {
|
|
76
|
-
tenantId: _options.tenant,
|
|
77
|
-
dataSize: parseInt(_options.dataSize) || 1000,
|
|
78
|
-
computeCapacity: parseFloat(_options.computeCapacity) || 0.8,
|
|
79
|
-
networkBandwidth: 100,
|
|
80
|
-
privacyLevel: _options.privacyLevel,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const participantId = await federatedLearning.registerParticipant(
|
|
84
|
-
federationId,
|
|
85
|
-
participantInfo,
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
spinner.succeed("Successfully joined federation");
|
|
89
|
-
|
|
90
|
-
console.log(chalk.green("\n✓ Joined federated learning session"));
|
|
91
|
-
// eslint-disable-line no-console
|
|
92
|
-
console.log(chalk.blue(`Participant ID: ${participantId}`));
|
|
93
|
-
// eslint-disable-line no-console
|
|
94
|
-
console.log(chalk.blue(`Federation ID: ${federationId}`));
|
|
95
|
-
// eslint-disable-line no-console
|
|
96
|
-
} catch (error) {
|
|
97
|
-
spinner.fail(`Failed to join federation: ${error.message}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Start a federated learning round
|
|
103
|
-
* @param {FederatedLearningCoordinator} federatedLearning - The federated learning coordinator instance
|
|
104
|
-
* @param {string} federationId - Federation ID
|
|
105
|
-
*/
|
|
106
|
-
async function startFederatedRound(federatedLearning, federationId) {
|
|
107
|
-
const spinner = ora("Starting federated learning round...").start();
|
|
108
|
-
|
|
109
|
-
try {
|
|
110
|
-
const result = await federatedLearning.startFederatedRound(federationId);
|
|
111
|
-
|
|
112
|
-
spinner.succeed("Federated round completed");
|
|
113
|
-
|
|
114
|
-
console.log(chalk.green("\n✓ Federated learning round completed"));
|
|
115
|
-
// eslint-disable-line no-console
|
|
116
|
-
console.log(chalk.blue(`Round: ${result.round}`));
|
|
117
|
-
// eslint-disable-line no-console
|
|
118
|
-
console.log(chalk.blue(`Participants: ${result.participants}`));
|
|
119
|
-
// eslint-disable-line no-console
|
|
120
|
-
console.log(
|
|
121
|
-
chalk.blue(`Converged: ${result.convergence.converged ? "Yes" : "No"}`),
|
|
122
|
-
);
|
|
123
|
-
// eslint-disable-line no-console
|
|
124
|
-
console.log(
|
|
125
|
-
chalk.blue(
|
|
126
|
-
`Global Accuracy: ${result.convergence.globalAccuracy?.toFixed(4)}`,
|
|
127
|
-
),
|
|
128
|
-
);
|
|
129
|
-
// eslint-disable-line no-console
|
|
130
|
-
} catch (error) {
|
|
131
|
-
spinner.fail(`Federated round failed: ${error.message}`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Show federation statistics
|
|
137
|
-
* @param {FederatedLearningCoordinator} federatedLearning - The federated learning coordinator instance
|
|
138
|
-
* @param {string} federationId - Federation ID
|
|
139
|
-
* @param {object} _options - Command options
|
|
140
|
-
*/
|
|
141
|
-
async function showFederationStats(federatedLearning, federationId, _options) {
|
|
142
|
-
const spinner = ora("Fetching federation statistics...").start();
|
|
143
|
-
|
|
144
|
-
try {
|
|
145
|
-
const stats = await federatedLearning.getFederationStats(federationId);
|
|
146
|
-
|
|
147
|
-
spinner.succeed("Statistics retrieved");
|
|
148
|
-
|
|
149
|
-
const table = new Table({
|
|
150
|
-
head: ["Property", "Value"],
|
|
151
|
-
colWidths: [25, 40],
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
table.push(
|
|
155
|
-
["Federation ID", stats.federation.id],
|
|
156
|
-
["Status", colorizeStatus(stats.federation.status)],
|
|
157
|
-
["Current Round", stats.federation.currentRound],
|
|
158
|
-
["Total Participants", stats.federation.totalParticipants],
|
|
159
|
-
["Active Participants", stats.federation.activeParticipants],
|
|
160
|
-
["Model Type", stats.federation.modelType],
|
|
161
|
-
[
|
|
162
|
-
"Average Accuracy",
|
|
163
|
-
stats.performance.averageAccuracy?.toFixed(4) || "N/A",
|
|
164
|
-
],
|
|
165
|
-
["Total Data Size", stats.performance.totalDataSize],
|
|
166
|
-
[
|
|
167
|
-
"Privacy Enabled",
|
|
168
|
-
stats.privacy.differentialPrivacyEnabled ? "Yes" : "No",
|
|
169
|
-
],
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
console.log(table.toString());
|
|
173
|
-
// eslint-disable-line no-console
|
|
174
|
-
|
|
175
|
-
if (_options.detailed && stats.participants.length > 0) {
|
|
176
|
-
console.log(chalk.blue("\nParticipant Details:"));
|
|
177
|
-
// eslint-disable-line no-console
|
|
178
|
-
|
|
179
|
-
const participantTable = new Table({
|
|
180
|
-
head: ["Tenant ID", "Data Size", "Accuracy", "Rounds", "Status"],
|
|
181
|
-
colWidths: [15, 12, 12, 8, 12],
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
stats.participants.forEach((participant) => {
|
|
185
|
-
participantTable.push([
|
|
186
|
-
participant.tenantId,
|
|
187
|
-
participant.dataSize,
|
|
188
|
-
participant.performance.accuracy?.toFixed(4) || "N/A",
|
|
189
|
-
participant.performance.rounds,
|
|
190
|
-
participant.status,
|
|
191
|
-
]);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
console.log(participantTable.toString());
|
|
195
|
-
// eslint-disable-line no-console
|
|
196
|
-
}
|
|
197
|
-
} catch (error) {
|
|
198
|
-
spinner.fail(`Failed to get statistics: ${error.message}`);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
module.exports = {
|
|
203
|
-
createFederation,
|
|
204
|
-
joinFederation,
|
|
205
|
-
startFederatedRound,
|
|
206
|
-
showFederationStats,
|
|
207
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI/ML domain module barrel export
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const trainingCommands = require("./training-commands");
|
|
6
|
-
const adaptiveCommands = require("./adaptive-commands");
|
|
7
|
-
const multimodalCommands = require("./multimodal-commands");
|
|
8
|
-
const federatedCommands = require("./federated-commands");
|
|
9
|
-
const shared = require("./shared");
|
|
10
|
-
|
|
11
|
-
module.exports = {
|
|
12
|
-
trainingCommands,
|
|
13
|
-
adaptiveCommands,
|
|
14
|
-
multimodalCommands,
|
|
15
|
-
federatedCommands,
|
|
16
|
-
shared,
|
|
17
|
-
};
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-modal processing CLI commands
|
|
3
|
-
* Handles content processing, multi-modal search, and content description
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const chalk = require("chalk");
|
|
7
|
-
const ora = require("ora");
|
|
8
|
-
const fs = require("fs").promises;
|
|
9
|
-
const { detectContentType } = require("./shared");
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Process multi-modal content
|
|
13
|
-
* @param {MultiModalProcessor} multiModalProcessor - The multi-modal processor instance
|
|
14
|
-
* @param {string} contentPath - Path to the content file
|
|
15
|
-
* @param {object} _options - Command options
|
|
16
|
-
*/
|
|
17
|
-
async function processMultiModalContent(
|
|
18
|
-
multiModalProcessor,
|
|
19
|
-
contentPath,
|
|
20
|
-
_options,
|
|
21
|
-
) {
|
|
22
|
-
const spinner = ora("Processing multi-modal content...").start();
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
if (!_options.tenant) {
|
|
26
|
-
spinner.fail("Tenant ID is required");
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Read content file
|
|
31
|
-
const stats = await fs.stat(contentPath);
|
|
32
|
-
const content = {
|
|
33
|
-
_type: detectContentType(contentPath),
|
|
34
|
-
size: stats.size,
|
|
35
|
-
path: contentPath,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// Add additional content based on type
|
|
39
|
-
if (content._type.startsWith("text/")) {
|
|
40
|
-
content.text = await fs.readFile(contentPath, "utf-8");
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
spinner.text = "Processing content...";
|
|
44
|
-
const result = await multiModalProcessor.processContent(
|
|
45
|
-
_options.tenant,
|
|
46
|
-
content,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
spinner.succeed("Content processed successfully");
|
|
50
|
-
|
|
51
|
-
console.log(chalk.green("\n✓ Multi-modal processing completed"));
|
|
52
|
-
// eslint-disable-line no-console
|
|
53
|
-
console.log(chalk.blue(`Content ID: ${result.id}`));
|
|
54
|
-
// eslint-disable-line no-console
|
|
55
|
-
console.log(
|
|
56
|
-
chalk.blue(
|
|
57
|
-
`Modalities detected: ${Object.keys(result.modalities).join(", ")}`,
|
|
58
|
-
),
|
|
59
|
-
);
|
|
60
|
-
// eslint-disable-line no-console
|
|
61
|
-
console.log(
|
|
62
|
-
chalk.blue(`Processing time: ${result.metadata.processingTime}ms`),
|
|
63
|
-
);
|
|
64
|
-
// eslint-disable-line no-console
|
|
65
|
-
|
|
66
|
-
if (_options.output) {
|
|
67
|
-
await fs.writeFile(_options.output, JSON.stringify(result, null, 2));
|
|
68
|
-
console.log(chalk.gray(`Results saved to: ${_options.output}`));
|
|
69
|
-
// eslint-disable-line no-console
|
|
70
|
-
}
|
|
71
|
-
} catch (error) {
|
|
72
|
-
spinner.fail(`Content processing failed: ${error.message}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Perform multi-modal search
|
|
78
|
-
* @param {MultiModalProcessor} multiModalProcessor - The multi-modal processor instance
|
|
79
|
-
* @param {string} tenantId - Tenant ID
|
|
80
|
-
* @param {object} _options - Command options
|
|
81
|
-
*/
|
|
82
|
-
async function multiModalSearch(multiModalProcessor, tenantId, _options) {
|
|
83
|
-
const spinner = ora("Performing multi-modal search...").start();
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
const query = {};
|
|
87
|
-
|
|
88
|
-
if (_options.query) {
|
|
89
|
-
query.text = _options.query;
|
|
90
|
-
query._type = "text";
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (_options.image) {
|
|
94
|
-
query.image = await fs.readFile(_options.image);
|
|
95
|
-
query._type = "image";
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (_options.audio) {
|
|
99
|
-
query.audio = await fs.readFile(_options.audio);
|
|
100
|
-
query._type = "audio";
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (Object.keys(query).length === 0) {
|
|
104
|
-
spinner.fail("At least one query _type must be provided");
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const searchOptions = {
|
|
109
|
-
maxResults: parseInt(_options.maxResults),
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const results = await multiModalProcessor.multiModalSearch(
|
|
113
|
-
tenantId,
|
|
114
|
-
query,
|
|
115
|
-
searchOptions,
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
spinner.succeed(`Found ${results.results.length} results`);
|
|
119
|
-
|
|
120
|
-
console.log(chalk.blue("\nMulti-modal Search Results:"));
|
|
121
|
-
// eslint-disable-line no-console
|
|
122
|
-
console.log(chalk.gray("=".repeat(50)));
|
|
123
|
-
// eslint-disable-line no-console
|
|
124
|
-
|
|
125
|
-
results.results.forEach((result, index) => {
|
|
126
|
-
console.log(
|
|
127
|
-
chalk.green(`\n${index + 1}. Content ID: ${result.contentId}`),
|
|
128
|
-
);
|
|
129
|
-
// eslint-disable-line no-console
|
|
130
|
-
console.log(
|
|
131
|
-
chalk.gray(
|
|
132
|
-
` Multi-modal Score: ${result.multiModalScore?.toFixed(4)}`,
|
|
133
|
-
),
|
|
134
|
-
);
|
|
135
|
-
// eslint-disable-line no-console
|
|
136
|
-
console.log(
|
|
137
|
-
chalk.gray(` Modalities: ${result.modalities?.join(", ")}`),
|
|
138
|
-
);
|
|
139
|
-
// eslint-disable-line no-console
|
|
140
|
-
console.log(chalk.gray(` Rank: ${result.rank}`));
|
|
141
|
-
// eslint-disable-line no-console
|
|
142
|
-
});
|
|
143
|
-
} catch (error) {
|
|
144
|
-
spinner.fail(`Multi-modal search failed: ${error.message}`);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Generate content description
|
|
150
|
-
* @param {MultiModalProcessor} multiModalProcessor - The multi-modal processor instance
|
|
151
|
-
* @param {string} contentId - Content ID
|
|
152
|
-
* @param {object} _options - Command options
|
|
153
|
-
*/
|
|
154
|
-
async function describeContent(multiModalProcessor, contentId, _options) {
|
|
155
|
-
const spinner = ora("Generating content description...").start();
|
|
156
|
-
|
|
157
|
-
try {
|
|
158
|
-
const descriptions = await multiModalProcessor.generateContentDescription(
|
|
159
|
-
contentId,
|
|
160
|
-
{
|
|
161
|
-
detailed: !!_options.detailed,
|
|
162
|
-
},
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
spinner.succeed("Description generated");
|
|
166
|
-
|
|
167
|
-
console.log(chalk.blue("\nContent Descriptions:"));
|
|
168
|
-
// eslint-disable-line no-console
|
|
169
|
-
console.log(chalk.gray("=".repeat(50)));
|
|
170
|
-
// eslint-disable-line no-console
|
|
171
|
-
|
|
172
|
-
for (const [modality, description] of Object.entries(descriptions)) {
|
|
173
|
-
console.log(chalk.green(`\n${modality.toUpperCase()}:`));
|
|
174
|
-
// eslint-disable-line no-console
|
|
175
|
-
console.log(description);
|
|
176
|
-
// eslint-disable-line no-console
|
|
177
|
-
}
|
|
178
|
-
} catch (error) {
|
|
179
|
-
spinner.fail(`Description generation failed: ${error.message}`);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
module.exports = {
|
|
184
|
-
processMultiModalContent,
|
|
185
|
-
multiModalSearch,
|
|
186
|
-
describeContent,
|
|
187
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared utilities for AI/ML CLI commands
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const chalk = require("chalk");
|
|
6
|
-
const _path = require("path");
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Colorize status text based on status value
|
|
10
|
-
* @param {string} status - Status string to colorize
|
|
11
|
-
* @returns {string} Chalk-colorized status string
|
|
12
|
-
*/
|
|
13
|
-
function colorizeStatus(status) {
|
|
14
|
-
switch (status) {
|
|
15
|
-
case "completed":
|
|
16
|
-
case "ready":
|
|
17
|
-
case "active":
|
|
18
|
-
return chalk.green(status);
|
|
19
|
-
case "failed":
|
|
20
|
-
case "error":
|
|
21
|
-
return chalk.red(status);
|
|
22
|
-
case "running":
|
|
23
|
-
case "training":
|
|
24
|
-
return chalk.yellow(status);
|
|
25
|
-
default:
|
|
26
|
-
return chalk.gray(status);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Detect content type from file extension
|
|
32
|
-
* @param {string} filePath - Path to the file
|
|
33
|
-
* @returns {string} MIME type string
|
|
34
|
-
*/
|
|
35
|
-
function detectContentType(filePath) {
|
|
36
|
-
const ext = _path.extname(filePath).toLowerCase();
|
|
37
|
-
|
|
38
|
-
if ([".jpg", ".jpeg", ".png", ".gif", ".webp"].includes(ext)) {
|
|
39
|
-
return "image/jpeg";
|
|
40
|
-
} else if ([".mp3", ".wav", ".flac", ".ogg"].includes(ext)) {
|
|
41
|
-
return "audio/mpeg";
|
|
42
|
-
} else if ([".mp4", ".avi", ".mov", ".webm"].includes(ext)) {
|
|
43
|
-
return "video/mp4";
|
|
44
|
-
} else if ([".txt", ".md", ".json"].includes(ext)) {
|
|
45
|
-
return "text/plain";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return "application/octet-stream";
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
module.exports = { colorizeStatus, detectContentType };
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Training-related CLI commands
|
|
3
|
-
* Handles model training, fine-tuning, status checking, and deployment
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const chalk = require("chalk");
|
|
7
|
-
const ora = require("ora");
|
|
8
|
-
const Table = require("cli-table3");
|
|
9
|
-
const { colorizeStatus } = require("./shared");
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Train a custom embedding model
|
|
13
|
-
* @param {ModelTrainingOrchestrator} modelTrainer - The model training orchestrator instance
|
|
14
|
-
* @param {object} _options - Command options
|
|
15
|
-
*/
|
|
16
|
-
async function trainEmbeddingModel(modelTrainer, _options) {
|
|
17
|
-
const spinner = ora("Initializing embedding model training...").start();
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
if (!_options.tenant) {
|
|
21
|
-
spinner.fail("Tenant ID is required");
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const trainingConfig = {
|
|
26
|
-
modelType: "embedding",
|
|
27
|
-
architecture: _options.architecture,
|
|
28
|
-
dataset: {
|
|
29
|
-
path: _options.dataset,
|
|
30
|
-
_type: "text_pairs",
|
|
31
|
-
},
|
|
32
|
-
hyperparameters: {
|
|
33
|
-
epochs: parseInt(_options.epochs),
|
|
34
|
-
batchSize: parseInt(_options.batchSize),
|
|
35
|
-
learningRate: parseFloat(_options.learningRate),
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
spinner.text = "Creating training job...";
|
|
40
|
-
const jobId = await modelTrainer.createTrainingJob(
|
|
41
|
-
_options.tenant,
|
|
42
|
-
trainingConfig,
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
if (_options.optimize) {
|
|
46
|
-
spinner.text = "Starting hyperparameter optimization...";
|
|
47
|
-
const optimizationConfig = {
|
|
48
|
-
...trainingConfig,
|
|
49
|
-
hyperparameters: {
|
|
50
|
-
learningRate: [0.0001, 0.001, 0.01],
|
|
51
|
-
batchSize: [16, 32, 64],
|
|
52
|
-
hiddenSize: [256, 512, 768],
|
|
53
|
-
},
|
|
54
|
-
optimization: {
|
|
55
|
-
strategy: "bayesian",
|
|
56
|
-
maxTrials: 10,
|
|
57
|
-
metric: "accuracy",
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const optimizationId = await modelTrainer.optimizeHyperparameters(
|
|
62
|
-
_options.tenant,
|
|
63
|
-
optimizationConfig,
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
spinner.succeed(`Hyperparameter optimization started: ${optimizationId}`);
|
|
67
|
-
} else {
|
|
68
|
-
spinner.text = "Starting training...";
|
|
69
|
-
await modelTrainer.startTraining(jobId);
|
|
70
|
-
spinner.succeed(`Training started: ${jobId}`);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
console.log(chalk.green("\n✓ Training initiated successfully"));
|
|
74
|
-
// eslint-disable-line no-console
|
|
75
|
-
console.log(chalk.blue(`Job ID: ${jobId}`));
|
|
76
|
-
// eslint-disable-line no-console
|
|
77
|
-
console.log(
|
|
78
|
-
chalk.gray(
|
|
79
|
-
`Use 'rag-pipeline ai train status ${jobId}' to check progress`,
|
|
80
|
-
),
|
|
81
|
-
);
|
|
82
|
-
// eslint-disable-line no-console
|
|
83
|
-
} catch (error) {
|
|
84
|
-
spinner.fail(`Training failed: ${error.message}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Fine-tune a language model
|
|
90
|
-
* @param {ModelTrainingOrchestrator} modelTrainer - The model training orchestrator instance
|
|
91
|
-
* @param {object} _options - Command options
|
|
92
|
-
*/
|
|
93
|
-
async function fineTuneLLM(modelTrainer, _options) {
|
|
94
|
-
const spinner = ora("Initializing LLM fine-tuning...").start();
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
if (!_options.tenant) {
|
|
98
|
-
spinner.fail("Tenant ID is required");
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const trainingConfig = {
|
|
103
|
-
modelType: "llm",
|
|
104
|
-
baseModel: _options.baseModel,
|
|
105
|
-
dataset: {
|
|
106
|
-
path: _options.dataset,
|
|
107
|
-
_type: "instruction_following",
|
|
108
|
-
},
|
|
109
|
-
fineTuning: {
|
|
110
|
-
method: _options.lora ? "lora" : "full",
|
|
111
|
-
epochs: parseInt(_options.epochs),
|
|
112
|
-
learningRate: 0.0001,
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
spinner.text = "Creating fine-tuning job...";
|
|
117
|
-
const jobId = await modelTrainer.createTrainingJob(
|
|
118
|
-
_options.tenant,
|
|
119
|
-
trainingConfig,
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
spinner.text = "Starting fine-tuning...";
|
|
123
|
-
await modelTrainer.startTraining(jobId);
|
|
124
|
-
|
|
125
|
-
spinner.succeed(`Fine-tuning started: ${jobId}`);
|
|
126
|
-
console.log(chalk.green("\n✓ LLM fine-tuning initiated"));
|
|
127
|
-
// eslint-disable-line no-console
|
|
128
|
-
console.log(chalk.blue(`Job ID: ${jobId}`));
|
|
129
|
-
// eslint-disable-line no-console
|
|
130
|
-
} catch (error) {
|
|
131
|
-
spinner.fail(`Fine-tuning failed: ${error.message}`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Check training job status
|
|
137
|
-
* @param {ModelTrainingOrchestrator} modelTrainer - The model training orchestrator instance
|
|
138
|
-
* @param {string} jobId - Training job ID
|
|
139
|
-
*/
|
|
140
|
-
async function checkTrainingStatus(modelTrainer, jobId) {
|
|
141
|
-
const spinner = ora("Checking training status...").start();
|
|
142
|
-
|
|
143
|
-
try {
|
|
144
|
-
const status = await modelTrainer.getTrainingStatus(jobId);
|
|
145
|
-
spinner.stop();
|
|
146
|
-
|
|
147
|
-
const table = new Table({
|
|
148
|
-
head: ["Property", "Value"],
|
|
149
|
-
colWidths: [20, 50],
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
table.push(
|
|
153
|
-
["Job ID", jobId],
|
|
154
|
-
["Status", colorizeStatus(status.status)],
|
|
155
|
-
["Progress", `${status.progress}%`],
|
|
156
|
-
["Current Epoch", `${status.currentEpoch}/${status.totalEpochs}`],
|
|
157
|
-
["Accuracy", status.metrics?.accuracy?.toFixed(4) || "N/A"],
|
|
158
|
-
["Loss", status.metrics?.loss?.toFixed(4) || "N/A"],
|
|
159
|
-
["Estimated Time", status.estimatedTimeRemaining || "N/A"],
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
console.log(table.toString());
|
|
163
|
-
// eslint-disable-line no-console
|
|
164
|
-
|
|
165
|
-
if (status.status === "completed") {
|
|
166
|
-
console.log(chalk.green("\n✓ Training completed successfully!"));
|
|
167
|
-
// eslint-disable-line no-console
|
|
168
|
-
console.log(
|
|
169
|
-
chalk.blue(
|
|
170
|
-
`Use 'rag-pipeline ai train deploy ${jobId}' to deploy the model`,
|
|
171
|
-
),
|
|
172
|
-
);
|
|
173
|
-
// eslint-disable-line no-console
|
|
174
|
-
} else if (status.status === "failed") {
|
|
175
|
-
console.log(chalk.red("\n✗ Training failed"));
|
|
176
|
-
// eslint-disable-line no-console
|
|
177
|
-
if (status.error) {
|
|
178
|
-
console.log(chalk.gray(`Error: ${status.error}`));
|
|
179
|
-
// eslint-disable-line no-console
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
} catch (error) {
|
|
183
|
-
spinner.fail(`Failed to get status: ${error.message}`);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Deploy a trained model
|
|
189
|
-
* @param {ModelTrainingOrchestrator} modelTrainer - The model training orchestrator instance
|
|
190
|
-
* @param {string} jobId - Training job ID
|
|
191
|
-
* @param {object} _options - Command options
|
|
192
|
-
*/
|
|
193
|
-
async function deployModel(modelTrainer, jobId, _options) {
|
|
194
|
-
const spinner = ora("Deploying model...").start();
|
|
195
|
-
|
|
196
|
-
try {
|
|
197
|
-
const deploymentConfig = {
|
|
198
|
-
environment: _options.environment,
|
|
199
|
-
scalingConfig: {
|
|
200
|
-
minInstances: 1,
|
|
201
|
-
maxInstances: _options.autoScale ? 5 : 1,
|
|
202
|
-
autoScale: !!_options.autoScale,
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const deploymentId = await modelTrainer.deployModel(
|
|
207
|
-
jobId,
|
|
208
|
-
deploymentConfig,
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
spinner.succeed(`Model deployed: ${deploymentId}`);
|
|
212
|
-
console.log(chalk.green("\n✓ Model deployment successful"));
|
|
213
|
-
// eslint-disable-line no-console
|
|
214
|
-
console.log(chalk.blue(`Deployment ID: ${deploymentId}`));
|
|
215
|
-
// eslint-disable-line no-console
|
|
216
|
-
console.log(chalk.blue(`Environment: ${_options.environment}`));
|
|
217
|
-
// eslint-disable-line no-console
|
|
218
|
-
} catch (error) {
|
|
219
|
-
spinner.fail(`Deployment failed: ${error.message}`);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
module.exports = {
|
|
224
|
-
trainEmbeddingModel,
|
|
225
|
-
fineTuneLLM,
|
|
226
|
-
checkTrainingStatus,
|
|
227
|
-
deployModel,
|
|
228
|
-
};
|