Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [0.8.0]

📦 **NPM:** https://www.npmjs.com/package/@qvac/sdk/v/0.8.0

This release adds support for pivot translations in the Bergamot engine, enabling translation between language pairs that don't have direct models by using an intermediate language (typically English).

---

### ✨ What's New

**Pivot Translation Support**

The SDK now supports **pivot translations** for the Bergamot translation engine. This powerful feature allows you to translate between language pairs even when a direct translation model isn't available, by automatically routing through an intermediate language.

**Enhanced Logging for Pivot Models**

Model registration now provides clearer logging when pivot models are loaded, showing both the primary and pivot model names.

---

## [0.7.0]

📦 **NPM:** https://www.npmjs.com/package/@qvac/sdk/v/0.7.0
Expand Down
59 changes: 55 additions & 4 deletions packages/sdk/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,36 @@ Additional requirements per license Section 1.b.i:
must prominently display "Built with Llama" on a related website,
user interface, blog post, about page, or product documentation.

# Model Use Restrictions (Open RAIL++-M)

As a user of the QVAC SDK and its associated model registry, you agree not to use the Model or its Derivatives:

1. **Illegal Acts:** In any way that violates any applicable national, federal, state, local or international law or regulation.
2. **Harm to Minors:** For the purpose of exploiting, harming or attempting to exploit or harm minors in any way.
3. **Malicious Content:** To generate or disseminate verifiably false information and/or content with the purpose of harming others.
4. **Personal Data:** To generate or disseminate personal identifiable information that can be used to harm an individual.
5. **Defamation & Harassment:** To defame, disparage or otherwise harass others.
6. **Automated Decisions:** For fully automated decision making that adversely impacts an individual's legal rights or otherwise creates or modifies a binding, enforceable obligation.
7. **Discrimination:** For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics.
8. **Exploitation:** To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to such group in a manner that causes or is likely to cause that person or another person physical or psychological harm.
9. **Medical Advice:** To provide medical advice and medical results interpretation.
10. **Justice & Law Enforcement:** To generate or disseminate information for use by administration of justice, law enforcement, immigration or asylum processes, such as predicting an individual will commit fraud/crime commitment (e.g. by text profiling, drawing causal relationships between assertions made in documents, indiscriminate and untargeted scraping).

---
*Note: These restrictions must be included in any distribution of the Model or Derivatives thereof to your end-users.*

=========================================================================
Third-Party Model Licenses
=========================================================================

--- apache-2.0 (Apache License 2.0) ---

crnn_mobilenet_v3_small
https://github.com/felixdittrich92/OnnxTR
db_mobilenet_v3_large
https://github.com/felixdittrich92/OnnxTR
db_resnet50
https://github.com/felixdittrich92/OnnxTR
de-tiny-ggml-model-f16
https://huggingface.co/primeline/whisper-tiny-german-1224
detector_craft
Expand All @@ -51,6 +75,10 @@ Third-Party Model Licenses
https://huggingface.co/jmb95/laser-dolphin-mixtral-2x7b-dpo-GGUF
en-base-ggml-model-f16
https://huggingface.co/openai/whisper-base
FLUX.2-klein-4B
https://huggingface.co/black-forest-labs/FLUX.2-klein-4B
FLUX.2-klein-4B-GGUF
https://huggingface.co/unsloth/FLUX.2-klein-4B-GGUF
fr-base-ggml-model-f16
https://huggingface.co/personalizedrefrigerator/whisper-base-fr
fr-tiny-ggml-model-f16
Expand Down Expand Up @@ -107,10 +135,14 @@ Third-Party Model Licenses
https://huggingface.co/CheeLi03/whisper-tiny-ja-puct-4k
laser-dolphin-mixtral-2x7b-dpo-GGUF
https://huggingface.co/jmb95/laser-dolphin-mixtral-2x7b-dpo-GGUF
LightOnOCR-2-1B-ocr-soup-GGUF
https://huggingface.co/noctrex/LightOnOCR-2-1B-ocr-soup-GGUF
Llama_3.2_1B_Intruct_Tool_Calling_V2-GGUF
https://huggingface.co/mav23/Llama_3.2_1B_Intruct_Tool_Calling_V2-GGUF
nb-tiny-ggml-model
https://huggingface.co/NbAiLab/nb-whisper-tiny
parseq
https://github.com/felixdittrich92/OnnxTR
pt-base-ggml-model-f16
https://huggingface.co/mariana-coelho-9/whisper-base-pt
Qwen3-0.6B-GGUF
Expand All @@ -119,6 +151,8 @@ Third-Party Model Licenses
https://huggingface.co/unsloth/Qwen3-1.7B-GGUF
Qwen3-1.7B-Q4_0-00001-of-00005
https://huggingface.co/unsloth/Qwen3-1.7B-GGUF
Qwen3-4B-GGUF
https://huggingface.co/unsloth/Qwen3-4B-GGUF
Qwen3-4B-Q4_0-00001-of-00005
https://huggingface.co/unsloth/Qwen3-4B-GGUF
Qwen3-4B-Q4_K_M
Expand Down Expand Up @@ -168,6 +202,8 @@ Third-Party Model Licenses

--- cc-by-4.0 (Creative Commons Attribution 4.0 International) ---

AfriqueGemma-4B-GGUF
https://huggingface.co/mradermacher/AfriqueGemma-4B-GGUF
decoder_joint-model
https://huggingface.co/istupakov/parakeet-tdt-0.6b-v3-onnx
encoder-model
Expand Down Expand Up @@ -208,6 +244,12 @@ Third-Party Model Licenses

--- mit (MIT License) ---

bitnet_b1_58-3B-TQ2_0
https://huggingface.co/1bitLLM/bitnet_b1_58-3B
bitnet_b1_58-large-TQ2_0
https://huggingface.co/1bitLLM/bitnet_b1_58-large
bitnet_b1_58-xl-TQ2_0
https://huggingface.co/1bitLLM/bitnet_b1_58-xl
chatterbox-multilingual-ONNX
https://huggingface.co/onnx-community/chatterbox-multilingual-ONNX
chatterbox-turbo-ONNX
Expand Down Expand Up @@ -287,6 +329,13 @@ Third-Party Model Licenses
Supertonic-TTS-ONNX
https://huggingface.co/onnx-community/Supertonic-TTS-ONNX

--- openrail++ ---

stable-diffusion-v2-1-GGUF
https://huggingface.co/gpustack/stable-diffusion-v2-1-GGUF
stable-diffusion-xl-base-1.0-GGUF
https://huggingface.co/gpustack/stable-diffusion-xl-base-1.0-GGUF

=========================================================================
Modification Notice
=========================================================================
Expand All @@ -312,24 +361,26 @@ JavaScript Dependencies
@qvac/dl-base@0.2.0
@qvac/dl-filesystem@0.2.0
@qvac/dl-hyperdrive@0.2.0
@qvac/embed-llamacpp@0.10.7
@qvac/embed-llamacpp@0.11.3
https://github.com/tetherto/qvac-lib-infer-llamacpp-embed
@qvac/error@0.1.1
@qvac/infer-base@0.1.1
@qvac/infer-base@0.2.2
@qvac/langdetect-text@0.1.1
@qvac/llm-llamacpp@0.8.9
@qvac/llm-llamacpp@0.9.2
https://github.com/tetherto/qvac-lib-infer-llamacpp-llm
@qvac/logging@0.1.0
@qvac/ocr-onnx@0.1.7
@qvac/ocr-onnx@0.2.0
https://github.com/tetherto/qvac-lib-inference-addon-onnx-ocr-fasttext
@qvac/rag@0.4.2
@qvac/registry-client@0.2.0
@qvac/registry-schema@0.1.1
@qvac/response@0.1.2
@qvac/transcription-parakeet@0.1.9
https://github.com/tetherto/qvac
@qvac/transcription-whispercpp@0.3.18
https://github.com/tetherto/qvac-lib-infer-whispercpp
@qvac/translation-nmtcpp@0.3.9
@qvac/translation-nmtcpp@0.6.1
https://github.com/tetherto/qvac-lib-infer-nmtcpp
@qvac/tts-onnx@0.5.4
adaptive-timeout@1.0.1
Expand Down
5 changes: 2 additions & 3 deletions packages/sdk/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions packages/sdk/changelog/0.8.0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SDK v0.8.0

## Summary
Added pivot translation support for Bergamot models, enabling two-step translations through an intermediate language.

## Features
- **Pivot Translation Support**: Added support for pivot translations in Bergamot engine, allowing translation between language pairs without direct models by using English as an intermediate language
- **Enhanced Model Registration Logging**: Improved logging for pivot translations to show both primary and pivot model names

## Changes

### feat: sdk pivot support
- Added pivot model name extraction and passing through the model loading pipeline
- Updated model registration to display both model names for pivot translations
- Modified logging output to show format like "(Spanish to Italian via English to Italian)"

## Technical Details
- Updated `loadModelServerParamsSchema` to include optional `pivotModelName` field
- Modified `registerModel` function to accept and use `pivotModelName` parameter
- Enhanced logging in `model-registry.ts` to display pivot model information
- Added pivot model name extraction using `modelInputToNameSchema` in load-model handler

## Dependencies
No dependency changes in this release.
83 changes: 83 additions & 0 deletions packages/sdk/changelog/0.8.0/CHANGELOG_LLM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# SDK v0.8.0

📦 **NPM:** https://www.npmjs.com/package/@qvac/sdk/v/0.8.0

This release adds support for pivot translations in the Bergamot engine, enabling translation between language pairs that don't have direct models by using an intermediate language (typically English).

---

## ✨ What's New

### Pivot Translation Support

The SDK now supports **pivot translations** for the Bergamot translation engine. This powerful feature allows you to translate between language pairs even when a direct translation model isn't available, by automatically routing through an intermediate language.

**Example: Spanish to Italian via English**
```typescript
import { loadModel, translate } from "@qvac/sdk";

// Load Spanish to English as the primary model
// and English to Italian as the pivot model
const modelId = await loadModel({
modelSrc: BERGAMOT_ES_EN,
modelType: "translation",
modelConfig: {
engine: "Bergamot",
pivotModel: {
modelSrc: BERGAMOT_EN_IT,
}
}
});

// Translates Spanish → English → Italian automatically
const result = await translate({
modelId,
text: "Hola mundo"
});
// Result: "Ciao mondo"
```

### Enhanced Logging for Pivot Models

Model registration now provides clearer logging when pivot models are loaded, showing both the primary and pivot model names:

```
Local model registered: abc123 (Spanish to English via English to Italian) -> /path/to/model
```

This makes it easier to debug and understand which models are being used in your translation pipeline.

---

## 🔧 Technical Improvements

- Added `pivotModelName` parameter throughout the model loading pipeline
- Enhanced model registry to track and display pivot model information
- Improved model name extraction for both primary and pivot models
- Better logging clarity for complex translation workflows

---

## 📝 Migration Guide

This release is fully backward compatible. No changes are required to existing code.

To start using pivot translations, simply add a `pivotModel` configuration when loading a Bergamot translation model:

```typescript
modelConfig: {
engine: "Bergamot",
pivotModel: {
modelSrc: BERGAMOT_EN_XX, // Your pivot model
// Optional: pivot model specific parameters
beamsize: 4,
temperature: 0.3
}
}
```

---

## 📚 Documentation

For more examples and detailed documentation on pivot translations, see the [translation examples](https://github.com/qvac/qvac/tree/main/packages/sdk/examples/translation) in the SDK repository.
83 changes: 83 additions & 0 deletions packages/sdk/examples/translation/translation-bergamot-pivot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import {BERGAMOT_ES_EN, BERGAMOT_EN_IT, loadModel, translate, unloadModel} from "@qvac/sdk";

/**
* Example: Pivot Translation with Bergamot
*
* Demonstrates translating Spanish to Italian through English as a pivot language.
* This requires two models:
* 1. Spanish → English (primary model)
* 2. English → Italian (pivot model)
*
* The API structure follows the standard Bergamot model pattern:
* - modelSrc: Primary translation model
* - modelConfig: Configuration with Bergamot-specific settings
* - modelConfig.pivotModel: Configuration for the secondary model
*/

// Spanish to Italian via English pivot example
try {
// Load the primary model (Spanish → English) with pivot configuration
const modelId = await loadModel({
modelSrc: BERGAMOT_ES_EN, // Primary model: Spanish → English
modelType: "nmt",
modelConfig: {
engine: "Bergamot",
from: "es",
to: "it", // Final target language (SDK handles the pivot internally)
beamsize: 4,
normalize: 1,
temperature: 0.3,
topk: 100,
// Pivot model configuration (English → Italian)
pivotModel: {
modelSrc: BERGAMOT_EN_IT, // Source for English → Italian model
// Bergamot-specific generation parameters for pivot model
beamsize: 4,
temperature: 0.3,
topk: 100,
normalize: 1,
lengthpenalty: 1.2,
}
},
onProgress: (progress) => {
console.log(progress);
},
});

console.log(`✅ Pivot translation model loaded: ${modelId}`);
console.log(" Primary: Spanish → English");
console.log(" Pivot: English → Italian");

// Spanish text to translate
const spanishText = `Era una mañana soleada cuando María decidió visitar el mercado local.
Compró frutas frescas, verduras y flores para su casa.
El vendedor le recomendó las mejores manzanas de la temporada.`;

console.log("\n📝 Original Spanish text:");
console.log(spanishText);

// Translate Spanish → English → Italian
const result = translate({
modelId,
text: spanishText,
modelType: "nmt",
stream: false,
});

const italianText = await result.text;

console.log("\n🇮🇹 Translated to Italian (via English):");
console.log(italianText);

// Expected output (approximate):
// "Era una mattina di sole quando Maria decise di visitare il mercato locale.
// Ha comprato frutta fresca, verdura e fiori per la sua casa.
// Il venditore ha consigliato le migliori mele della stagione."

await unloadModel({ modelId });
console.log("\n✅ Model unloaded successfully");

} catch (error) {
console.error("❌ Error:", error);
process.exit(1);
}
Loading
Loading