Skip to content

Repository files navigation

Hermes Banner

Typing SVG

Python HTML CSS JavaScript Groq


📌 Overview

Hermes is an advanced Flask-based AI translation and rephrasing web application powered by Groq's high-speed LLM models (using llama-3.1-8b-instant by default).

It dynamically adapts translations based on style, tone, dialect, and creativity—allowing you to render text in poetic forms, specific regional dialects, or preserve specific aspects of the original voice.

The application has been optimized to run both locally and as serverless functions on hosting providers like Vercel.


✨ Features

  • Groq Cloud Integration — Ultra-fast inference leveraging the Groq API (replaces the old local Ollama setup).
  • Style & Tone Control — Fine-tune output to match genres/styles like formal, casual, poetic, business, etc.
  • Originality Preservation — Preserve specific dimensions of the input (meaning, tone, style, voice, form) during rephrasing.
  • Dialect & Creative Intent — Direct the AI to translate using specific dialects (e.g. British English, Mexican Spanish) or apply custom creative rules.
  • Serverless Ready — Pre-configured for seamless deployments on Vercel.
  • Safe Client Initialization — Groq client is initialized lazily, preventing application crashes at startup when the API key is missing.

🌐 API Reference

POST /api/translate

Performs translation/rephrasing based on your parameters.

Headers

Content-Type: application/json

Request Body Options

Parameter Type Required Default Description
text string Yes - The source text to translate or rephrase.
target_lang string Yes English The target language for the output.
writing_style string No - Writing style/genre (e.g. casual, formal, business, poetic).
originality string (JSON array) No [] Attributes of the original text to preserve (e.g., ["meaning", "tone", "style", "voice", "form"]).
dialect string No - Specific regional dialect (e.g. Scottish, Brazilian).
creative_intent string No - Additional custom creative constraints or instructions.
model string No llama-3.1-8b-instant The Groq model to use.

Example Request

{
  "text": "Hello, how are you doing today?",
  "target_lang": "Spanish",
  "writing_style": "poetic",
  "originality": "[\"meaning\"]",
  "dialect": "Andalusion",
  "model": "llama-3.1-8b-instant"
}

Example Response

{
  "output": "Hola, ¿cómo te va en este día de luz?"
}

About

Hermes is an AI powered translation tool that changes text into different languages, styles and toggles originality.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages