โผ๏ธ This project is deprecated due to advancement of LLM eco system. To see more advancement based on current project, check our latest repo here: https://github.com/AierLab/MultiverseNote .
The LLM Text-to-Text Service is a wrapper that integrates third-party open-source Large Language Models (LLM) services for modular purposes. This service leverages OLLAMA for local deployment and provides APIs for interacting with models like ChatGPT, ChatGLM, and JAIS for fine-tuning and delivering text-to-text services.
- Multiple LLM Integrations: Supports multiple LLMs, including OLLAMA, ChatGPT, ChatGLM, and JAIS.
- Local and Remote Deployment: Utilizes OLLAMA for local deployment and various APIs for accessing and fine-tuning models remotely.
- Modular Structure: Designed to be easily extendable and configurable for different LLM service providers.
- Configuration Flexibility: YAML-based configuration allows easy customization and management of service parameters.
The repository is organized as follows:
llm-text2text-service/
โโโ src/
โ โโโ control/ # Contains controllers for handling LLM-specific logic
โ โโโ dao/ # Data Access Objects for handling data interactions
โ โโโ model/ # Data models for managing LLM responses
โ โโโ utils/ # Utility functions for common operations
โ โโโ view/ # Views for rendering outputs (e.g., APIs or CLI)
โโโ storage/
โ โโโ config/ # Configuration files
โ โ โโโ main_config.yaml # Main configuration file
โ โโโ log/ # Log files
โ โโโ .gitkeep # Keeps log directory in version control
โโโ tests/
โ โโโ __init__.py # Initializer for the tests package
โ โโโ ... # Test modules for various components
โโโ .gitignore # Specifies files and directories to ignore in version control
โโโ LICENSE # License file
โโโ main.py # Entry point for running the service
โโโ README.md # Project description and instructions
โโโ setup.py # Setup script for packaging and distribution
To install the LLM Text-to-Text Service, follow these steps:
-
Clone the Repository:
git clone https://github.com/your-repo/llm-text2text-service.git cd llm-text2text-service
-
Install Dependencies:
Use
pip
to install the required dependencies:pip install -e .
To start the service, run:
python main.py
This will launch the LLM Text-to-Text Service, enabling you to interact with multiple LLMs through defined APIs or the CLI.
To integrate the LLM Text-to-Text Service into your existing project:
-
Install the Module:
Install the service as a package:
pip install -e /path/to/llm-text2text-service
-
Import and Use Functions in Your Code:
Import the necessary bot classes or functions from the
control
module:from llm_text2text_service.src.control import openaiBot, petalsBot, wenxinBot # Example usage with OpenAI's ChatGPT chatgpt_bot = openaiBot.ChatGPT() response = chatgpt_bot.get_response("Hello, how are you?") print(response)
Replace
ChatGPT
with the specific LLM integration you wish to use, such asPetalsAI
orWenxin
.
The service uses a YAML configuration file located at storage/config/main_config.yaml
. You can modify this file to configure API keys, model parameters, logging levels, and other settings.
Example configuration in main_config.yaml
:
openai:
api_key: "your-openai-api-key"
wenxin:
api_key: "your-wenxin-api-key"
logging:
level: "INFO"
To run the test suite, use:
pytest tests/
This command will execute all test cases in the tests
directory and provide a report of the test results.
We welcome contributions from the community. Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes with descriptive commit messages.
- Push your changes to your forked repository.
- Create a pull request with a detailed description of your changes.
This project is licensed under Apache License 2.0 - see the LICENSE file for more details.
Thank you for your interest in the LLM Text-to-Text Service! If you have any questions or need further assistance, feel free to open an issue or contact us.