Skip to content

verte21/sst-opus-translations

Repository files navigation

Translation LLM Lambda

Description

Description:

This repository provides a simple yet powerful solution for running the Opus-MT (Machine Translation) model for text translation within an AWS Lambda. Opus-MT is a state-of-the-art machine translation system that supports translation between multiple languages, offering high-quality translations for various text inputs.

Built with

  • SST
  • EasyNMT

Getting started

Prerequisites

AWS account

Install

npm i
npx sst deploy

Usage

POST /api/translate/{languegeCode} 
{
    "text": "Insert your text here"
}

Example: /api/translate/EN

{
    "text": "Pytasz, co w moim życiu z wszystkich rzecz główną, Powiem ci: śmierć i miłość – obydwie zarówno. Jednej oczu się czarnych drugiej – modrych boję. Te dwie są me miłości i dwie śmierci moje."
}

Result:

{
    "result": "You ask what in my life of all the principal thing, I will tell you: death and love both. One's eyes are black and the other's, I'm afraid. These two are my love and my two deaths."
}

Bear in mind that without pre-loaded models it would initially take around 15s to get first response, translations will by way faster.

See also

To-do

  • Docker image
  • SST simple api
  • Better validation
  • Hide API behind api-key
  • Allow opus-models prefetch to reduce cold starts

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published