docs: update

This commit is contained in:
xxnuo
2026-01-10 00:26:39 +08:00
parent 4387fdccd4
commit c8acf05e02
4 changed files with 317 additions and 153 deletions

View File

@@ -2,8 +2,6 @@
[中文](../README.md) | [English](README_en.md) | [日本語](README_ja.md) | [Français](README_fr.md) | [Deutsch](README_de.md)
<!-- <img src="../images/icon.png" width="64px" height="64px" align="right" alt="MTran"> -->
Ein ultraschneller Offline-Übersetzungsmodell-Server mit minimalem Ressourcenverbrauch. Keine Grafikkarte erforderlich. Durchschnittliche Antwortzeit von 50 ms pro Anfrage. Unterstützt die Übersetzung der weltweit wichtigsten Sprachen.
Beachten Sie, dass dieser Modellserver auf die Designziele `Offline-Übersetzung`, `Reaktionsgeschwindigkeit`, `plattformübergreifende Bereitstellung` und `lokale Ausführung` fokussiert ist, um `unbegrenzte kostenlose Übersetzungen` zu erreichen. Aufgrund von Einschränkungen bei der Modellgröße und Optimierung wird die Übersetzungsqualität sicherlich nicht so gut sein wie die von großen Sprachmodellen. Für qualitativ hochwertige Übersetzungen wird die Verwendung von Online-APIs für große Sprachmodelle empfohlen.
@@ -14,25 +12,39 @@ Beachten Sie, dass dieser Modellserver auf die Designziele `Offline-Übersetzung
## Online Demo
| Website | TOKEN | Andere Schnittstelle | Anbieter |
| -------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------- | -------- |
| `https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__` | `__IpacEL_MT_API_TOKEN__` | Immersive Translate: `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
| Website | TOKEN | Andere Schnittstelle | Anbieter |
| ------------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------- |
| [ipacel.cc](https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__) | `__IpacEL_MT_API_TOKEN__` | Immersive Translate: `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
Vielen Dank an die Mitwirkenden der Community für die Bereitstellung von Testdiensten für Benutzer!
## Gebrauchsanweisung
Laden Sie die neueste Version für Ihre Plattform von [Releases](https://github.com/xxnuo/MTranServer/releases) herunter und starten Sie das Programm einfach über die Befehlszeile, um es zu verwenden.
### Schnellstart
[MTranServer](https://github.com/xxnuo/MTranServer) ist hauptsächlich für Serverumgebungen gedacht, daher sind derzeit nur der Befehlszeilendienst und die Docker-Bereitstellung verfügbar.
```bash
npx mtranserver@latest
```
Es ist geplant, ein Desktop-Programm und eine Browser-Erweiterung für eine bequemere Nutzung bereitzustellen. Bitte bleiben Sie dran.
> `npx` kann durch einen beliebigen Paketmanager ersetzt werden, z. B. `bunx`, `pnpx` usw.
> **Wichtiger Hinweis:**
>
> Bei der erstmaligen Übersetzung eines Sprachpaares lädt der Server automatisch das entsprechende Übersetzungsmodell herunter (sofern der Offline-Modus nicht aktiviert ist). Dieser Vorgang kann je nach Netzwerkgeschwindigkeit und Modellgröße einige Zeit in Anspruch nehmen. Nach dem Herunterladen des Modells profitieren nachfolgende Übersetzungsanfragen von einer Antwortzeit im Millisekundenbereich. Es wird empfohlen, vor der eigentlichen Verwendung eine Übersetzung zu testen, damit der Server das Modell vorab herunterladen und laden kann.
>
> Das Programm wird häufig aktualisiert. Wenn Sie auf Probleme stoßen, versuchen Sie, auf die neueste Version zu aktualisieren.
> Bei der erstmaligen Übersetzung eines Sprachpaares lädt der Server automatisch das entsprechende Übersetzungsmodell herunter (sofern der Offline-Modus nicht aktiviert ist). Dieser Vorgang kann je nach Netzwerkgeschwindigkeit und Modellgröße einige Zeit in Anspruch nehmen. Nach dem Herunterladen des Modells profitieren nachfolgende Übersetzungsanfragen von einer Antwortzeit im Millisekundenbereich. Es wird empfohlen, vor der eigentlichen Verwendung eine Übersetzung zu testen, damit der Server das Modell vorab herunterladen und laden kann. Das Programm wird häufig aktualisiert. Wenn Sie auf Probleme stoßen, versuchen Sie, auf die neueste Version zu aktualisieren.
### Schnellinstallation
```bash
npm i -g mtranserver@latest
```
> `npm` kann durch einen beliebigen Paketmanager ersetzt werden, z. B. `bun`, `pnpm` usw.
Starten Sie anschließend `mtranserver`.
### Manueller Download
Laden Sie die neueste Version für Ihre Plattform von [Releases](https://github.com/xxnuo/MTranServer/releases) herunter und starten Sie das Programm einfach über die Befehlszeile, um es zu verwenden.
Nach dem Start des Servers werden die Adresse der im Programm enthaltenen einfachen Benutzeroberfläche und die Adresse der Online-Dokumentation im Protokoll ausgegeben. Hier ist eine Vorschau:
@@ -40,29 +52,6 @@ Nach dem Start des Servers werden die Adresse der im Programm enthaltenen einfac
![Dokumentation](../images/swagger.png)
### Befehlszeilenparameter
```bash
./mtranserver [Optionen]
Optionen:
-version, -v Versionsinformationen anzeigen
-log-level string Protokollierungsgrad (debug, info, warn, error) (Standard "warn")
-config-dir string Konfigurationsverzeichnis (Standard "~/.config/mtran/server")
-model-dir string Modellverzeichnis (Standard "~/.config/mtran/models")
-host string Server-Abhöradresse (Standard "0.0.0.0")
-port string Server-Port (Standard "8989")
-ui Web-UI aktivieren (Standard true)
-offline Offline-Modus aktivieren, neue Modelle nicht automatisch herunterladen (Standard false)
-worker-idle-timeout int Worker-Leerlauf-Timeout (Sekunden) (Standard 300)
Beispiele:
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
### Docker Compose Bereitstellung
Erstellen Sie ein leeres Verzeichnis und darin eine `compose.yml` Datei mit folgendem Inhalt:
@@ -78,7 +67,6 @@ services:
environment:
- MT_HOST=0.0.0.0
- MT_PORT=8989
- MT_ENABLE_UI=true
- MT_OFFLINE=false
# - MT_API_TOKEN=ihr_geheimer_token_hier
volumes:
@@ -90,7 +78,33 @@ docker pull xxnuo/mtranserver:latest
docker compose up -d
```
#### Übersetzung-Plugin kompatible Schnittstellen
### Desktop-App
TODO: Noch in Arbeit. Das Electron-Paket ist etwas zu groß, ich suche noch nach einer besseren Lösung.
## Ökosystem-Projekte
### IDE-Plugins
#### MTranCode Kommentar-Übersetzungs-Plugin
Unterstützt VS Code, Cursor, Augment und andere VS-Code-basierte IDEs.
Suchen Sie im Plugin-Marktplatz nach `MTranCode`, um das Kommentar-Übersetzungs-Plugin zu installieren.
Das Plugin ruft standardmäßig den Server unter `http://localhost:8989` für Kommentar- und Code-Übersetzungen auf. Sie können dies in den Einstellungen anpassen.
Dieses Plugin ist ein Fork von [vscode-comment-translate](https://github.com/intellism/vscode-comment-translate).
### Browser-Erweiterung
#### MTranBrowser
TODO: In aktiver Entwicklung.
> Wenn Sie ein abgeleitetes Projekt entwickeln, können Sie gerne eine PR einreichen. Ich füge Ihr Projekt zur Ökosystem-Liste hinzu.
## Kompatible Schnittstellen
Der Server bietet kompatible Schnittstellen für mehrere Übersetzungs-Plugins:
@@ -99,9 +113,10 @@ Der Server bietet kompatible Schnittstellen für mehrere Übersetzungs-Plugins:
| `/imme` | POST | Schnittstelle für Immersive Translate Plugin | [Immersive Translate](https://immersivetranslate.com/) |
| `/kiss` | POST | Schnittstelle für Kiss Translator Plugin | [Kiss Translator](https://github.com/fishjar/kiss-translator) |
| `/deepl` | POST | DeepL API v2 kompatible Schnittstelle | Clients, die die DeepL API unterstützen |
| `/hcfy` | POST | Selection Translator kompatible Schnittstelle | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
| `/hcfy` | POST | Selection Translator kompatible Schnittstelle | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
| `/google/language/translate/v2` | POST | Google Translate API v2 kompatible Schnittstelle | Clients, die die Google Translate API unterstützen |
| `/google/translate_a/single` | GET | Google translate_a/single kompatible Schnittstelle | Clients, die Google Web Translate unterstützen |
| `/hcfy` | POST | Selection Translator kompatible Schnittstelle | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
**Plugin-Konfigurationsanleitung:**
@@ -125,6 +140,32 @@ Der Server bietet kompatible Schnittstellen für mehrere Übersetzungs-Plugins:
**Normale Benutzer können den Dienst nutzen, indem sie die Schnittstellenadresse des Plugins gemäß dem Tabelleninhalt konfigurieren.**
### Befehlszeilenparameter
```bash
./mtranserver [Optionen]
Optionen:
-version, -v Versionsinformationen anzeigen
-log-level string Protokollierungsgrad (debug, info, warn, error) (Standard "warn")
-config-dir string Konfigurationsverzeichnis (Standard "~/.config/mtran/server")
-model-dir string Modellverzeichnis (Standard "~/.config/mtran/models")
-host string Server-Abhöradresse (Standard "0.0.0.0")
-port string Server-Port (Standard "8989")
-ui Web-UI aktivieren (Standard true)
-offline Offline-Modus aktivieren, neue Modelle nicht automatisch herunterladen (Standard false)
-worker-idle-timeout int Worker-Leerlauf-Timeout (Sekunden) (Standard 300)
--download pairs... Modelle für bestimmte Sprachpaare herunterladen (z. B. --download en_zh zh_en)
--languages Alle unterstützten Sprachpaare zum Download auflisten
Hinweis: `--download` und `--languages` benötigen eine Netzwerkverbindung und funktionieren nicht im Offline-Modus.
Beispiele:
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
## Ähnliche Projekte
Hier sind einige Projekte mit ähnlichen Funktionen. Wenn Sie andere Bedürfnisse haben, können Sie diese Projekte ausprobieren:
@@ -134,7 +175,7 @@ Hier sind einige Projekte mit ähnlichen Funktionen. Wenn Sie andere Bedürfniss
| [NLLB](https://github.com/facebookresearch/fairseq/tree/nllb) | Sehr hoch | Schlecht | Durchschnittlich | Langsam | Die Android-Portierung [RTranslator](https://github.com/niedev/RTranslator) hat viele Optimierungen, aber der Ressourcenverbrauch ist immer noch hoch und es ist nicht schnell |
| [LibreTranslate](https://github.com/LibreTranslate/LibreTranslate) | Sehr hoch | Durchschnittlich | Durchschnittlich | Mittel | Mittelklasse-CPU verarbeitet 3 Sätze/s, High-End-CPU 15-20 Sätze/s. [Details](https://community.libretranslate.com/t/performance-benchmark-data/486) |
| [OPUS-MT](https://github.com/OpenNMT/CTranslate2#benchmarks) | Hoch | Durchschnittlich | Eher schlecht | Schnell | [Leistungstests](https://github.com/OpenNMT/CTranslate2#benchmarks) |
| Andere große Modelle | Extrem hoch | Dynamisch | Sehr gut | Sehr langsam | Hohe Hardwareanforderungen. Wenn Sie eine Übersetzung mit hoher Nebenläufigkeit benötigen, wird empfohlen, das vllm-Framework zu verwenden, um die Nebenläufigkeit über den Speicher- und VRAM-Verbrauch zu steuern |
| Andere große Modelle | Extrem hoch | Dynamisch | Sehr gut | Sehr langsam | Hohe Hardwareanforderungen. Wenn Sie eine Übersetzung mit hoher Nebenläufigkeit benötigen, wird empfohlen, das vllm-Framework zu verwenden. |
| Dieses Projekt | Niedrig | Hoch | Durchschnittlich | Extrem schnell | Durchschnittliche Antwortzeit von 50 ms pro Anfrage. |
> Die Daten in der Tabelle beziehen sich auf einfache Tests mit CPU, Englisch-Chinesisch-Szenarien, keine strengen Tests, Vergleich von nicht quantisierten Versionen, nur als Referenz.

View File

@@ -2,8 +2,6 @@
[中文](../README.md) | [English](README_en.md) | [日本語](README_ja.md) | [Français](README_fr.md) | [Deutsch](README_de.md)
<!-- <img src="../images/icon.png" width="64px" height="64px" align="right" alt="MTran"> -->
A high-performance offline translation model server with minimal resource requirements - no GPU needed. Average response time of 50ms per request. Supports translation of major languages worldwide.
Note: This model server focuses on `offline translation`, `response speed`, `cross-platform deployment`, and `local execution` to achieve `unlimited free translation`. Due to model size and optimization constraints, the translation quality will not match that of large language models. For high-quality translation, consider using online large language model APIs.
@@ -14,25 +12,39 @@ Note: This model server focuses on `offline translation`, `response speed`, `cro
## Online Demo
| Website | TOKEN | Other Interface | Provider |
| -------------------------------- | ------------------------- | ------------------------------------------------------------------------------ | -------- |
| `https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__` | `__IpacEL_MT_API_TOKEN__` | Immersive Translate: `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
| Website | TOKEN | Other Interface | Provider |
| ------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------ | -------------------------------------- |
| [ipacel.cc](https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__) | `__IpacEL_MT_API_TOKEN__` | Immersive Translate: `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
Thanks to community contributors for providing trial services for users!
## Usage Guide
Download the latest version from [Releases](https://github.com/xxnuo/MTranServer/releases) and start the program in the command line.
### Quick Start
[MTranServer](https://github.com/xxnuo/MTranServer) is mainly for server use, so currently only command line service and Docker deployment are available.
Plans are in place to provide a desktop application and browser extension for easier use, so stay tuned.
```bash
npx mtranserver@latest
```
> `npx` can be replaced with any package manager you prefer, such as `bunx`, `pnpx`, etc.
> **Important Note:**
>
> When translating a language pair for the first time, the server will automatically download the corresponding translation model (unless offline mode is enabled). This process may take some time depending on your network speed and model size. After the model is downloaded, subsequent translation requests will enjoy millisecond-level response speeds. It is recommended to test a translation once before formal use to allow the server to pre-download and load the model.
>
> The program is frequently updated. If you encounter problems, please try updating to the latest version.
> When translating a language pair for the first time, the server will automatically download the corresponding translation model (unless offline mode is enabled). This process may take some time depending on your network speed and model size. After the model is downloaded, subsequent translation requests will enjoy millisecond-level response speeds. It is recommended to test a translation once before formal use to allow the server to pre-download and load the model. The program is frequently updated. If you encounter problems, please try updating to the latest version.
### Quick Install
```bash
npm i -g mtranserver@latest
```
> `npm` can be replaced with any package manager you prefer, such as `bun`, `pnpm`, etc.
Then run `mtranserver`.
### Manual Download
Download the latest version from [Releases](https://github.com/xxnuo/MTranServer/releases) and start the program in the command line.
After the server starts, the console will output the address of the simple UI and the online documentation address. Below is a preview:
@@ -40,29 +52,6 @@ After the server starts, the console will output the address of the simple UI an
![Documentation](../images/swagger.png)
### Command Line Options
```bash
./mtranserver [options]
Options:
-version, -v Show version information
-log-level string Log level (debug, info, warn, error) (default "warn")
-config-dir string Configuration directory (default "~/.config/mtran/server")
-model-dir string Model directory (default "~/.config/mtran/models")
-host string Server host address (default "0.0.0.0")
-port string Server port (default "8989")
-ui Enable Web UI (default true)
-offline Enable offline mode, disable automatic model download (default false)
-worker-idle-timeout int Worker idle timeout in seconds (default 300)
Examples:
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
### Docker Compose Deployment
Create a `compose.yml` file in an empty directory, with the following content:
@@ -78,7 +67,6 @@ services:
environment:
- MT_HOST=0.0.0.0
- MT_PORT=8989
- MT_ENABLE_UI=true
- MT_OFFLINE=false
# - MT_API_TOKEN=your_secret_token_here
volumes:
@@ -90,7 +78,33 @@ docker pull xxnuo/mtranserver:latest
docker compose up -d
```
#### Translation Plugin Compatible Endpoints
### Desktop App
TODO: Still working on it. The Electron package is a bit too large, and I am still looking for a better solution.
## Ecosystem Projects
### IDE Plugins
#### MTranCode Comment Translation Plugin
Supports VS Code, Cursor, Augment, and other VS Code-based IDEs.
Search for `MTranCode` in the extension marketplace to install the comment translation plugin.
The plugin defaults to calling the server at `http://localhost:8989` for comment and code translation. You can adjust it in settings.
This plugin is forked from [vscode-comment-translate](https://github.com/intellism/vscode-comment-translate).
### Browser Extension
#### MTranBrowser
TODO: Under active development.
> If you develop a derivative project, feel free to submit a PR. I will add your project to the ecosystem list.
## Compatible Interfaces
The server provides compatible endpoints for multiple translation plugins:
@@ -99,9 +113,10 @@ The server provides compatible endpoints for multiple translation plugins:
| `/imme` | POST | Immersive Translation plugin endpoint | [Immersive Translation](https://immersivetranslate.com/) |
| `/kiss` | POST | Kiss Translator plugin endpoint | [Kiss Translator](https://github.com/fishjar/kiss-translator) |
| `/deepl` | POST | DeepL API v2 compatible endpoint | Clients supporting DeepL API |
| `/hcfy` | POST | Selection Translator compatible endpoint | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
| `/hcfy` | POST | Selection Translator compatible endpoint | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
| `/google/language/translate/v2` | POST | Google Translate API v2 compatible endpoint | Clients supporting Google Translate API |
| `/google/translate_a/single` | GET | Google translate_a/single compatible endpoint | Clients supporting Google web translation |
| `/hcfy` | POST | Selection Translator compatible endpoint | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
**Plugin Configuration Guide:**
@@ -125,6 +140,32 @@ The server provides compatible endpoints for multiple translation plugins:
**Regular users can start using the service after setting up the plugin interface address according to the table above.**
### Command Line Options
```bash
./mtranserver [options]
Options:
-version, -v Show version information
-log-level string Log level (debug, info, warn, error) (default "warn")
-config-dir string Configuration directory (default "~/.config/mtran/server")
-model-dir string Model directory (default "~/.config/mtran/models")
-host string Server host address (default "0.0.0.0")
-port string Server port (default "8989")
-ui Enable Web UI (default true)
-offline Enable offline mode, disable automatic model download (default false)
-worker-idle-timeout int Worker idle timeout in seconds (default 300)
--download pairs... Download models for specific language pairs (e.g. --download en_zh zh_en)
--languages List all supported language pairs for download
Note: `--download` and `--languages` require network access and do not work in offline mode.
Examples:
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
## Comparison with Similar Projects
Here are some similar projects, you can try them if you have other needs:
@@ -134,7 +175,7 @@ Here are some similar projects, you can try them if you have other needs:
| [NLLB](https://github.com/facebookresearch/fairseq/tree/nllb) | Very High | Poor | Average | Slow | Android port [RTranslator](https://github.com/niedev/RTranslator) has many optimizations, but still has high resource usage and is not fast |
| [LibreTranslate](https://github.com/LibreTranslate/LibreTranslate) | Very High | Average | Average | Medium | Mid-range CPU processes 3 sentences/s, high-end CPU processes 15-20 sentences/s. [Details](https://community.libretranslate.com/t/performance-benchmark-data/486) |
| [OPUS-MT](https://github.com/OpenNMT/CTranslate2#benchmarks) | High | Average | Below Average | Fast | [Performance Tests](https://github.com/OpenNMT/CTranslate2#benchmarks) |
| Any LLM | Extremely High | Dynamic | Very Good | Very Slow | High hardware requirements. If you need high concurrency translation, it is recommended to use vllm framework to control translation concurrency through memory and VRAM usage. |
| Any LLM | Extremely High | Dynamic | Very Good | Very Slow | High hardware requirements. If you need high concurrency translation, it is recommended to use vllm framework. |
| MTranServer (This Project) | Low | High | Average | Ultra Fast | 50ms average response time per request. |
> Table data is for CPU, English to Chinese scenarios simple testing, not strict testing, non-quantized version comparison, for reference only.

View File

@@ -2,8 +2,6 @@
[中文](../README.md) | [English](README_en.md) | [日本語](README_ja.md) | [Français](README_fr.md) | [Deutsch](README_de.md)
<!-- <img src="../images/icon.png" width="64px" height="64px" align="right" alt="MTran"> -->
Un serveur de modèle de traduction hors ligne ultra-rapide avec une consommation de ressources minimale. Aucune carte graphique requise. Temps de réponse moyen de 50 ms par requête. Prend en charge la traduction des principales langues du monde.
Notez que ce serveur de modèle se concentre sur la `traduction hors ligne`, la `vitesse de réponse`, le `déploiement multiplateforme` et l'`exécution locale` pour atteindre l'objectif de `traduction gratuite illimitée`. En raison des contraintes de taille et d'optimisation du modèle, la qualité de la traduction ne sera certainement pas aussi bonne que celle des grands modèles de traduction. Pour une traduction de haute qualité, il est recommandé d'utiliser les API de grands modèles en ligne.
@@ -14,25 +12,39 @@ Notez que ce serveur de modèle se concentre sur la `traduction hors ligne`, la
## Démo en ligne
| Site Web | TOKEN | Autre interface | Fournisseur |
| -------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------- | ----------- |
| `https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__` | `__IpacEL_MT_API_TOKEN__` | Immersive Translate : `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
| Site Web | TOKEN | Autre interface | Fournisseur |
| ------------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------- |
| [ipacel.cc](https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__) | `__IpacEL_MT_API_TOKEN__` | Immersive Translate : `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
Merci aux contributeurs de la communauté pour fournir des services d'essai aux utilisateurs !
## Guide d'utilisation
Téléchargez la dernière version pour votre plateforme depuis les [Releases](https://github.com/xxnuo/MTranServer/releases), et lancez simplement le programme en ligne de commande pour l'utiliser.
### Démarrage rapide
[MTranServer](https://github.com/xxnuo/MTranServer) est principalement destiné à un environnement serveur, c'est pourquoi seuls le service en ligne de commande et le déploiement Docker sont actuellement disponibles.
```bash
npx mtranserver@latest
```
Il est prévu de fournir une application de bureau et une extension de navigateur pour faciliter l'utilisation, restez à l'écoute.
> `npx` peut être remplacé par le gestionnaire de paquets que vous préférez, comme `bunx`, `pnpx`, etc.
> **Remarque importante :**
>
> Lors de la première traduction d'une paire de langues, le serveur téléchargera automatiquement le modèle de traduction correspondant (sauf si le mode hors ligne est activé). Ce processus peut prendre un certain temps en fonction de la vitesse de votre réseau et de la taille du modèle. Une fois le modèle téléchargé, les requêtes de traduction suivantes bénéficieront d'un temps de réponse de l'ordre de la milliseconde. Il est recommandé de tester une traduction avant l'utilisation réelle pour permettre au serveur de pré-télécharger et de charger le modèle.
>
> Le programme est souvent mis à jour. Si vous rencontrez des problèmes, essayez de mettre à jour vers la dernière version.
> Lors de la première traduction d'une paire de langues, le serveur téléchargera automatiquement le modèle de traduction correspondant (sauf si le mode hors ligne est activé). Ce processus peut prendre un certain temps en fonction de la vitesse de votre réseau et de la taille du modèle. Une fois le modèle téléchargé, les requêtes de traduction suivantes bénéficieront d'un temps de réponse de l'ordre de la milliseconde. Il est recommandé de tester une traduction avant l'utilisation réelle pour permettre au serveur de pré-télécharger et de charger le modèle. Le programme est souvent mis à jour. Si vous rencontrez des problèmes, essayez de mettre à jour vers la dernière version.
### Installation rapide
```bash
npm i -g mtranserver@latest
```
> `npm` peut être remplacé par le gestionnaire de paquets que vous préférez, comme `bun`, `pnpm`, etc.
Puis lancez `mtranserver`.
### Téléchargement manuel
Téléchargez la dernière version pour votre plateforme depuis les [Releases](https://github.com/xxnuo/MTranServer/releases), et lancez simplement le programme en ligne de commande pour l'utiliser.
Après le démarrage du serveur, l'adresse de l'interface utilisateur simple incluse dans le programme et l'adresse de la documentation en ligne seront affichées dans les journaux. Voici un aperçu :
@@ -40,29 +52,6 @@ Après le démarrage du serveur, l'adresse de l'interface utilisateur simple inc
![Documentation](../images/swagger.png)
### Arguments de la ligne de commande
```bash
./mtranserver [options]
Options :
-version, -v Afficher les informations de version
-log-level string Niveau de journalisation (debug, info, warn, error) (par défaut "warn")
-config-dir string Répertoire de configuration (par défaut "~/.config/mtran/server")
-model-dir string Répertoire des modèles (par défaut "~/.config/mtran/models")
-host string Adresse d'écoute du serveur (par défaut "0.0.0.0")
-port string Port du serveur (par défaut "8989")
-ui Activer l'interface Web (par défaut true)
-offline Activer le mode hors ligne, ne pas télécharger automatiquement les nouveaux modèles (par défaut false)
-worker-idle-timeout int Délai d'inactivité du Worker en secondes (par défaut 300)
Exemples :
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
### Déploiement Docker Compose
Créez un répertoire vide, puis créez un fichier `compose.yml` avec le contenu suivant :
@@ -78,7 +67,6 @@ services:
environment:
- MT_HOST=0.0.0.0
- MT_PORT=8989
- MT_ENABLE_UI=true
- MT_OFFLINE=false
# - MT_API_TOKEN=votre_jeton_secret_ici
volumes:
@@ -90,7 +78,33 @@ docker pull xxnuo/mtranserver:latest
docker compose up -d
```
#### Interface compatible avec les plugins de traduction
### Application de bureau
TODO: En cours de développement. Le paquet Electron est un peu trop volumineux, je cherche encore une meilleure solution.
## Écosystème
### Plugins IDE
#### Plugin de traduction de commentaires MTranCode
Prend en charge VS Code, Cursor, Augment et d'autres IDE basés sur VS Code.
Recherchez `MTranCode` dans la boutique d'extensions pour installer le plugin de traduction de commentaires.
Par défaut, le plugin appelle le serveur `http://localhost:8989` pour la traduction des commentaires et du code. Vous pouvez l'ajuster dans les paramètres.
Ce plugin est forké de [vscode-comment-translate](https://github.com/intellism/vscode-comment-translate).
### Extension de navigateur
#### MTranBrowser
TODO: En cours de développement.
> Si vous développez un projet dérivé, n'hésitez pas à soumettre une PR. J'ajouterai votre projet à la liste de l'écosystème.
## Interfaces compatibles
Le serveur fournit plusieurs interfaces compatibles avec les plugins de traduction :
@@ -99,9 +113,10 @@ Le serveur fournit plusieurs interfaces compatibles avec les plugins de traducti
| `/imme` | POST | Interface pour le plugin Immersive Translate | [Immersive Translate](https://immersivetranslate.com/) |
| `/kiss` | POST | Interface pour le plugin Kiss Translator | [Kiss Translator](https://github.com/fishjar/kiss-translator) |
| `/deepl` | POST | Interface compatible DeepL API v2 | Clients supportant l'API DeepL |
| `/hcfy` | POST | Interface compatible Selection Translator | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
| `/hcfy` | POST | Interface compatible Selection Translator | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
| `/google/language/translate/v2` | POST | Interface compatible Google Translate API v2 | Clients supportant l'API Google Translate |
| `/google/translate_a/single` | GET | Interface compatible Google translate_a/single | Clients supportant la traduction web Google |
| `/hcfy` | POST | Interface compatible Selection Translator | [Selection Translator](https://github.com/Selection-Translator/crx-selection-translate) |
**Guide de configuration des plugins :**
@@ -125,6 +140,32 @@ Le serveur fournit plusieurs interfaces compatibles avec les plugins de traducti
**Les utilisateurs ordinaires peuvent utiliser le service en configurant l'adresse de l'interface du plugin selon le contenu du tableau.**
### Arguments de la ligne de commande
```bash
./mtranserver [options]
Options :
-version, -v Afficher les informations de version
-log-level string Niveau de journalisation (debug, info, warn, error) (par défaut "warn")
-config-dir string Répertoire de configuration (par défaut "~/.config/mtran/server")
-model-dir string Répertoire des modèles (par défaut "~/.config/mtran/models")
-host string Adresse d'écoute du serveur (par défaut "0.0.0.0")
-port string Port du serveur (par défaut "8989")
-ui Activer l'interface Web (par défaut true)
-offline Activer le mode hors ligne, ne pas télécharger automatiquement les nouveaux modèles (par défaut false)
-worker-idle-timeout int Délai d'inactivité du Worker en secondes (par défaut 300)
--download pairs... Télécharger les modèles pour des paires de langues spécifiques (ex. --download en_zh zh_en)
--languages Lister toutes les paires de langues disponibles au téléchargement
Remarque : `--download` et `--languages` nécessitent une connexion réseau et ne fonctionnent pas en mode hors ligne.
Exemples :
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
## Projets similaires
Voici quelques projets avec des fonctionnalités similaires. Si vous avez d'autres besoins, vous pouvez essayer ces projets :
@@ -134,7 +175,7 @@ Voici quelques projets avec des fonctionnalités similaires. Si vous avez d'autr
| [NLLB](https://github.com/facebookresearch/fairseq/tree/nllb) | Très élevée | Mauvaise | Moyenne | Lente | Le portage Android [RTranslator](https://github.com/niedev/RTranslator) a de nombreuses optimisations, mais l'utilisation des ressources reste élevée et ce n'est pas rapide |
| [LibreTranslate](https://github.com/LibreTranslate/LibreTranslate) | Très élevée | Moyenne | Moyenne | Moyenne | Un CPU milieu de gamme traite 3 phrases/s, un CPU haut de gamme 15-20 phrases/s. [Détails](https://community.libretranslate.com/t/performance-benchmark-data/486) |
| [OPUS-MT](https://github.com/OpenNMT/CTranslate2#benchmarks) | Élevée | Moyenne | Assez mauvaise | Rapide | [Tests de performance](https://github.com/OpenNMT/CTranslate2#benchmarks) |
| Autres grands modèles | Ultra élevée | Dynamique | Très bonne | Très lente | Exigences matérielles élevées. Si vous avez besoin d'une traduction à haute concurrence, il est recommandé d'utiliser le framework vllm pour contrôler la concurrence via l'utilisation de la mémoire et de la VRAM |
| Autres grands modèles | Ultra élevée | Dynamique | Très bonne | Très lente | Exigences matérielles élevées. Si vous avez besoin d'une traduction à haute concurrence, il est recommandé d'utiliser le framework vllm. |
| Ce projet | Faible | Élevée | Moyenne | Ultra rapide | Temps de réponse moyen de 50 ms par requête. |
> Les données du tableau sont pour des tests simples CPU, scénarios anglais vers chinois, pas des tests stricts, comparaison de versions non quantifiées, pour référence seulement.

View File

@@ -2,8 +2,6 @@
[中文](../README.md) | [English](README_en.md) | [日本語](README_ja.md) | [Français](README_fr.md) | [Deutsch](README_de.md)
<!-- <img src="../images/icon.png" width="64px" height="64px" align="right" alt="MTran"> -->
超低リソース消費、超高速なオフライン翻訳モデルサーバーです。グラフィックカードは不要です。リクエストあたりの平均応答時間は50ミリ秒です。世界の主要言語の翻訳をサポートしています。
注意:このモデルサーバーは、`オフライン翻訳``応答速度``クロスプラットフォーム展開``ローカル実行`による`無制限の無料翻訳`という設計目標に焦点を当てており、モデルサイズと最適化の制限により、翻訳品質は大モデル翻訳の効果には及びません。高品質な翻訳が必要な場合は、オンラインの大規模言語モデルAPIの使用をお勧めします。
@@ -14,25 +12,39 @@
## オンラインデモ
| ウェブサイト | TOKEN | その他のインターフェース | 提供者 |
| -------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------- | ------- |
| `https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__` | `__IpacEL_MT_API_TOKEN__` | 没入型翻訳: `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
| ウェブサイト | TOKEN | その他のインターフェース | 提供者 |
| --------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------ |
| [ipacel.cc](https://MTranServer.ipacel.cc/ui/?token=__IpacEL_MT_API_TOKEN__) | `__IpacEL_MT_API_TOKEN__` | 没入型翻訳: `https://MTranServer.ipacel.cc/imme?token=__IpacEL_MT_API_TOKEN__` | [@ApliNi](https://github.com/ApliNi) |
ユーザーに試用サービスを提供してくださるコミュニティの貢献者に感謝します!
## 使用方法
[Releases](https://github.com/xxnuo/MTranServer/releases) から対応するプラットフォームの最新バージョンをダウンロードし、コマンドラインでプログラムを起動するだけで使用できます。
### クイックスタート
[MTranServer](https://github.com/xxnuo/MTranServer) は主にサーバー使用環境向けであるため、現在はコマンドラインサービスと Docker デプロイのみ提供しています。
```bash
npx mtranserver@latest
```
デスクトップアプリケーションとブラウザ拡張機能を提供する予定ですので、ご期待ください
> `npx` は `bunx`、`pnpx` など、好きなパッケージマネージャーに置き換え可能です
> **重要:**
>
> 初めて特定の言語ペアを翻訳する場合、サーバーは対応する翻訳モデルを自動的にダウンロードします(オフラインモードが有効でない場合)。このプロセスには、ネットワーク速度とモデルサイズに応じて時間がかかる場合があります。モデルのダウンロード完了後、その後の翻訳リクエストはミリ秒レベルの応答速度になります。正式に使用する前に一度翻訳をテストし、サーバーにモデルを事前にダウンロードしてロードさせることをお勧めします。
>
> プログラムは頻繁に更新されます。問題が発生した場合は、最新バージョンに更新してみてください。
> 初めて特定の言語ペアを翻訳する場合、サーバーは対応する翻訳モデルを自動的にダウンロードします(オフラインモードが有効でない場合)。このプロセスには、ネットワーク速度とモデルサイズに応じて時間がかかる場合があります。モデルのダウンロード完了後、その後の翻訳リクエストはミリ秒レベルの応答速度になります。正式に使用する前に一度翻訳をテストし、サーバーにモデルを事前にダウンロードしてロードさせることをお勧めします。プログラムは頻繁に更新されます。問題が発生した場合は、最新バージョンに更新してみてください。
### クイックインストール
```bash
npm i -g mtranserver@latest
```
> `npm` は `bun`、`pnpm` など、好きなパッケージマネージャーに置き換え可能です。
その後 `mtranserver` を起動してください。
### 手動ダウンロード
[Releases](https://github.com/xxnuo/MTranServer/releases) から対応するプラットフォームの最新バージョンをダウンロードし、コマンドラインでプログラムを起動するだけで使用できます。
サーバー起動後、ログにプログラム付属の簡易 UI のアドレスとオンラインドキュメントのアドレスが出力されます。以下はプレビューです。
@@ -40,29 +52,6 @@
![ドキュメント](../images/swagger.png)
### コマンドライン引数
```bash
./mtranserver [オプション]
オプション:
-version, -v バージョン情報を表示
-log-level string ログレベル (debug, info, warn, error) (デフォルト "warn")
-config-dir string 設定ディレクトリ (デフォルト "~/.config/mtran/server")
-model-dir string モデルディレクトリ (デフォルト "~/.config/mtran/models")
-host string サーバーリッスンアドレス (デフォルト "0.0.0.0")
-port string サーバーポート (デフォルト "8989")
-ui Web UI を有効にする (デフォルト true)
-offline オフラインモードを有効にする(新しいモデルを自動ダウンロードしない) (デフォルト false)
-worker-idle-timeout int Worker アイドルタイムアウト(秒) (デフォルト 300)
例:
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
### Docker Compose デプロイ
空のディレクトリを作成し、以下の内容で `compose.yml` ファイルを作成します。
@@ -78,7 +67,6 @@ services:
environment:
- MT_HOST=0.0.0.0
- MT_PORT=8989
- MT_ENABLE_UI=true
- MT_OFFLINE=false
# - MT_API_TOKEN=your_secret_token_here
volumes:
@@ -90,7 +78,33 @@ docker pull xxnuo/mtranserver:latest
docker compose up -d
```
#### 翻訳プラグイン互換インターフェース
### デスクトップアプリ
TODO: まだ作業中です。Electron のパッケージが少し大きすぎるため、より良い方法を探しています。
## エコシステム
### IDE プラグイン
#### MTranCode コメント翻訳プラグイン
VS Code、Cursor、Augment などの VS Code 系 IDE をサポートしています。
拡張機能マーケットプレイスで `MTranCode` を検索するとコメント翻訳プラグインをインストールできます。
プラグインはデフォルトで `http://localhost:8989` のサーバーを呼び出してコメントやコードの翻訳を行います。設定で変更できます。
このプラグインは [vscode-comment-translate](https://github.com/intellism/vscode-comment-translate) を fork したものです。
### ブラウザ拡張
#### MTranBrowser
TODO: 開発中です。
> 派生プロジェクトを開発した場合は、PR を送ってください。エコシステムのプロジェクトに追加します。
## 互換インターフェース
サーバーは複数の翻訳プラグインの互換インターフェースを提供しています。
@@ -99,9 +113,10 @@ docker compose up -d
| `/imme` | POST | 没入型翻訳Immersive Translateプラグインインターフェース | [没入型翻訳](https://immersivetranslate.com/) |
| `/kiss` | POST | Kiss Translator プラグインインターフェース | [Kiss Translator](https://github.com/fishjar/kiss-translator) |
| `/deepl` | POST | DeepL API v2 互換インターフェース | DeepL API 対応クライアント |
| `/hcfy` | POST | 划词翻译Selection Translator互換インターフェース | [划词翻译](https://github.com/Selection-Translator/crx-selection-translate) |
| `/hcfy` | POST | 划词翻译Selection Translator互換インターフェース | [划词翻译](https://github.com/Selection-Translator/crx-selection-translate) |
| `/google/language/translate/v2` | POST | Google Translate API v2 互換インターフェース | Google Translate API 対応クライアント |
| `/google/translate_a/single` | GET | Google translate_a/single 互換インターフェース | Google ウェブ翻訳対応クライアント |
| `/hcfy` | POST | 划词翻译Selection Translator互換インターフェース | [划词翻译](https://github.com/Selection-Translator/crx-selection-translate) |
**プラグイン設定説明:**
@@ -125,6 +140,32 @@ docker compose up -d
**一般ユーザーは、表の内容に従ってプラグインの使用インターフェースアドレスを設定すれば使用できます。**
### コマンドライン引数
```bash
./mtranserver [オプション]
オプション:
-version, -v バージョン情報を表示
-log-level string ログレベル (debug, info, warn, error) (デフォルト "warn")
-config-dir string 設定ディレクトリ (デフォルト "~/.config/mtran/server")
-model-dir string モデルディレクトリ (デフォルト "~/.config/mtran/models")
-host string サーバーリッスンアドレス (デフォルト "0.0.0.0")
-port string サーバーポート (デフォルト "8989")
-ui Web UI を有効にする (デフォルト true)
-offline オフラインモードを有効にする(新しいモデルを自動ダウンロードしない) (デフォルト false)
-worker-idle-timeout int Worker アイドルタイムアウト(秒) (デフォルト 300)
--download pairs... 指定した言語ペアのモデルをダウンロード (例: --download en_zh zh_en)
--languages ダウンロード可能な言語ペア一覧を表示
注意:`--download``--languages` はネットワーク接続が必要で、オフラインモードでは動作しません。
例:
./mtranserver --host 127.0.0.1 --port 8080
./mtranserver --ui --offline
./mtranserver -v
```
## 類似プロジェクト
同様の機能を持つプロジェクトをいくつか挙げます。他のニーズがある場合は、これらのプロジェクトを試してみてください。
@@ -134,7 +175,7 @@ docker compose up -d
| [NLLB](https://github.com/facebookresearch/fairseq/tree/nllb) | 非常に高い | 悪い | 普通 | 遅い | Android移植版の [RTranslator](https://github.com/niedev/RTranslator) は多くの最適化がありますが、それでもリソース使用量が高く、高速ではありません |
| [LibreTranslate](https://github.com/LibreTranslate/LibreTranslate) | 非常に高い | 普通 | 普通 | 中程度 | ミドルレンジCPUで毎秒3文、ハイエンドCPUで毎秒15-20文処理。[詳細](https://community.libretranslate.com/t/performance-benchmark-data/486) |
| [OPUS-MT](https://github.com/OpenNMT/CTranslate2#benchmarks) | 高い | 普通 | やや悪い | 速い | [性能テスト](https://github.com/OpenNMT/CTranslate2#benchmarks) |
| その他大規模モデル | 超高い | 動的 | 非常に良い | 非常に遅い | ハードウェア要件が高い。高同時実行翻訳が必要な場合は、vllmフレームワークの使用をお勧めします。メモリとVRAM使用量で翻訳同時実行数を制御できます。 |
| その他大規模モデル | 超高い | 動的 | 非常に良い | 非常に遅い | ハードウェア要件が高い。高同時実行翻訳が必要な場合は、vllmフレームワークの使用をお勧めします。 |
| 本プロジェクト | 低 | 高い | 普通 | 極めて速い | リクエストあたり平均応答時間50ms。 |
> 表のデータはCPU、英中翻訳シナリオでの簡易テストであり、厳密なテストではなく、非量子化バージョンの比較です。参考程度にしてください。