LLM File Translator is a tool designed to translate .md and .pdf files using powerful language models (LLMs) through a user-friendly graphical interface. Built with Tkinter for an intuitive GUI and powered by LLM Studio as the core LLM engine, this project enables easy switching between language models for translation flexibility. Tested with LLaMA 3 and LLaMA 2, LLM File Translator aims to deliver reliable and accurate file translations.
- 📄 Translate .md and .pdf Files: Supports translation of both Markdown and PDF formats while preserving structure.
- 🌍 Multilingual Support: Translate content into multiple languages: English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, Korean, and Russian.
- 🖥️ Interactive GUI: Built with Tkinter, featuring a progress bar to track translation status.
- 🧠 LLM Studio Integration: Easily switch between LLM models to use the best one for your needs.
- 🔧 Customizable: Tested with LLaMA models, but any compatible model can be configured for translation tasks.
- Python 3.8+
- Dependencies: Specified in
requirements.txt(installation instructions below) - LLM Studio: The LLM Studio server must be running with a model loaded and active for API requests to function.
-
Clone the repository:
git clone https://github.com/your-username/LLM-File-Translator.git cd LLM-File-Translator -
Install dependencies:
pip install -r requirements.txt
This project uses LLM Studio as the translation backend. Make sure to have LLM Studio running with a loaded model and the server activated to handle translation requests.
To set up:
- Load a Model in LLM Studio according to your translation requirements.
- Activate the API Server within LLM Studio to make it accessible for translation requests.
- In
src/main.py, ensurebase_urlpoints to the correct LLM Studio endpoint.
For LLM model switching, refer to the LLM Studio documentation to add or change models as needed.
-
Run the main script to start the GUI:
python src/main.py
-
In the GUI:
- Select the
.mdor.pdffile you want to translate. - Choose the target language.
- Click "Start Translation" to begin. The translated file will be saved to the
translations/folder.
- Select the
Run automated tests to ensure all components function correctly:
python -m unittest discover tests//project-root
├── src/
│ ├── main.py # Main source code (GUI)
│ ├── translate.py # Translation functions
│ └── utils.py # Helper functions
├── docs/ # Documentation
├── tests/ # Automated tests
├── translations/ # Translated files output
├── README.md # Project overview
└── requirements.txt # Python dependencies
Contributions are welcome! To contribute:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature/your-feature
-
Commit your changes:
git commit -m "Add a new feature" -
Push to your branch:
git push origin feature/your-feature
-
Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.