A simple self-hostable Machine Translation service, powered by spaGO

Translator

A simple self-hostable translation service, powered by spaGO.

Some notable features:

  • it doesn't rely on external translation services
  • no fees, no strings attached
  • it's self-contained: just build and run with minimal dependencies
  • tiny executable, simple configuration
  • REST (OpenAPI) and gRPC API
  • it works with spaGO models
    • let the program automatically download and convert models from Hugging Face Hub (reference: spaGO Hugging Face Importer)
    • and/or just provide your own models

Supported models

This project uses spaGO machine-learning/NLP library behind the hood. At present, BART and Marian models for conditional generation are supported. For more information please refer to spaGO BART Machine Translation README section.

Build and Run

The primary intended usage is to run it as a standalone program. You can get the code and build it like this:

git clone https://github.com/SpecializedGeneralist/translator.git
cd translator
go mod download
go build -o translator cmd/translator/main.go

The translator program requires a configuration file to run. Please refer to the file sample-configuration.yaml included with this project to see an example.

Once you are done with your configuration definition, run:

./translator -c your-config.yaml

The program will first load the configured models from the given path. If a model is not found, the program will automatically attempt to download it from Hugging Face models hub, convert it to a spaGO model, and load it as well.

Eventually, the server will start and will be ready to accept requests. The configured endpoint can be used indifferently for REST (OpenAPI-defined) requests, or as gRPC service.

The folder pkg/api from this project provides the OpenAPI definition file (api.yaml) and also protobuf and gRPC-related definitions and code.

Use as Go package

This project is a Go module, so you can get and use it from your own code:

go get -u github.com/SpecializedGeneralist/translator

For example, a typical scenario is to import and use the included gRPC client:

import "github.com/SpecializedGeneralist/translator/pkg/api"

// ...

client := api.NewApiClient(conn)

// ...
Similar Resources

Cloud torrent: a self-hosted remote torrent client, written in Go (golang)

Cloud torrent: a self-hosted remote torrent client, written in Go (golang)

Cloud torrent is a a self-hosted remote torrent client, written in Go (golang).

Dec 21, 2021

Self-Reproducing Programs

Quines: Self-Reproducing Programs This is a repository containing different implementations of self-reproducing programs. It is not meant to be a show

Jan 31, 2022

A simple IP address lookup service | 基于 ip2region 使用 go 扩展的一个简单的 IP 地址归属地查询服务

A simple IP address lookup service | 基于 ip2region 使用 go 扩展的一个简单的 IP 地址归属地查询服务

go-ip2region 基于 ip2region 使用 go 扩展的一个简单的 IP 地址归属地查询服务 在线IP地址归属地查询 功能 提供 http 接口查询 IP 地址归属地 提供命令行 下载/更新 最新的 ip2region.db ip 库 (数据来源原仓库) 使用 可直接下载 releas

Dec 23, 2022

Us-api: a simple service that returns the US state code based on the state

us-api us-api is a simple service that returns the US state code based on the state. It does not support creating, updating nor deleting data. Local D

Dec 13, 2021

A Simple Anonym FileSharing Service which is able to be render in the Browser and in an Terminal-Client

FileSharingService A Simple Anonym FileSharing Service which is able to be render in the Browser and in an Terminal-Client How to use Take a look in t

Dec 25, 2022

Dynbio - A simple service for dynamic update my bio on github

dynbio A simple service for dynamic update my bio on github Instalation sudo ech

Jan 3, 2022

Lambda service function

openfaas-lambda These are sets of example that i've used when migrating aws lambda to openfaas platform. A part of documenting on how it works, I'm op

Oct 26, 2022

A compute service that lets you run code without provisioning or managing servers

AWS Lambda for Go Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availab

Oct 13, 2021

Durudex Notification Service

⚡️ Durudex Notif Service Durudex Notification Service 💡 Prerequisites Go 1.17 grpc ⚙️ Build & Run Create an .env file in the root directory and add t

Dec 13, 2022
Comments
  • it's can't running in windows?

    it's can't running in windows?

    I am try build it in windows . it success and running. but when I use postman request http interface , I got 400 http code , http body show : {info": "Invalid request!"}
    but when I running in Linux everything is right , I can't understand . Can I get any help.

Go online translation package

Translate Go online translation package Install go get github.com/nuveo/translate Available Translator API's Microsoft or send us the next Translator

Nov 27, 2022
Python library for the DeepL language translation API.

The DeepL API is a language translation API that allows other computer programs to send texts and documents to DeepL's servers and receive high-quality translations.

Jan 6, 2023
Self-service account creation and credential reset for FreeIPA
Self-service account creation and credential reset for FreeIPA

Auri Auri stands for: Automated User Registration IPA Auri implements self service account creation and reset of credentials for FreeIPA Features Requ

Dec 21, 2022
lightweight, self-service AWS IAM management
lightweight, self-service AWS IAM management

Contents Overview Architecture Prerequisites Workflow What groups exist? Who do I ask for access? What groups am I in? How do I add group members? How

Jan 16, 2022
Qfy - Self-hosted implementation of Synthetics - Monitoring checks to validate your service availability

qfy Self-hosted implementation of Synthetics - Monitoring checks to validate you

Feb 23, 2022
A simple krunker client written in Golang that's powered by WebView2
A simple krunker client written in Golang that's powered by WebView2

GO-client GO-client is a simple and fast krunker client powered by WebView2 that's written in golang. The client uses minimmal code and is not a slow

Dec 7, 2021
Go client library for efficient postal code lookup (powered by GeoNames)

go-poco Client library for efficient postal code lookup (powered by GeoNames) Installation go-poco may be installed using the go get command: go get g

Dec 23, 2021
efsu is for accessing AWS EFS from your machine without a VPN

efsu: VPN-less access to AWS EFS efsu is for accessing AWS EFS from your machine without a VPN. It achieves this by deploying a Lambda function and sh

Mar 11, 2022
EggContractor is a self-hosted contract monitoring web app + CLI client for Egg

EggContractor is a self-hosted contract monitoring web app + CLI client for Egg, Inc.. It allows you to easily monitor all your contract progress, as well as peeking into prospective coops you may want to join.

Nov 23, 2022
Self Hosted Terraform Registry backed by S3

tf-registry Self Hosted Terraform Registry backed by S3 Usage tf-registry Provides a simple http server that implements the Terraform Module Registry

Jan 8, 2023