AbstractAI is a versatile inference router designed to facilitate seamless integration and utilization of both local and online Language Learning Models (LLMs). With AbstractAI, you can effortlessly switch between different LLMs based on your requirements for price, performance, and latency.
Currently, the following features are planned and under development:
- RouterLLM: A robust system to route inference requests to the most suitable LLM based on predefined criteria.
- Local LLM Support: Integration with local LLMs using
llama.cpp. - Online LLM Support: Integration with various online LLMs through APIs.
- Dynamic Model Selection: Ability to choose between models based on cost, performance, and latency.
- Chain of Thoughts and Mixture of Agents: Advanced techniques for enhancing inference quality.
- Prompt Management: Efficient handling and management of prompts.
- Docker installed on your system.
- API keys for online LLMs (e.g., OpenAI, GPT-3).
- Clone the repository:
git clone https://github.com/yourusername/AbstractAI.git
cd AbstractAI- Build and run the Docker container:
docker-compose up --build- RouterLLM Configuration:
- Configure
RouterLLMto route requests to the desired LLM based on price, performance, and latency. - Example configuration file (
config.yaml):
- Configure
routerllm:
selection_criteria:
- price
- performance
- latency
models:
local:
llama:
path: "/path/to/llama/model"
online:
openai:
api_key: "YOUR_OPENAI_API_KEY"
model: "gpt-3.5-turbo"
other_online_llm:
api_key: "YOUR_OTHER_LLM_API_KEY"
model: "model_name"- Prompt Management:
- Define prompts and manage them efficiently within the
prompts/directory.
- Define prompts and manage them efficiently within the
- Running Inference:
- Once the Docker container is running, you can make inference requests to the AbstractAI router.
curl -X POST http://localhost:8000/inference \
-H "Content-Type: application/json" \
-d '{"prompt": "Your prompt here"}'- Chain of Thoughts and Mixture of Agents:
- Utilize advanced techniques to enhance the quality of the responses.
import requests
url = "http://localhost:8000/inference"
data = {
"prompt": "Explain the theory of relativity in simple terms."
}
response = requests.post(url, json=data)
print(response.json())- RouterLLM: Implement logic to route requests based on user-defined criteria such as cost, performance, and latency.
- Online LLM Integration: Add support for new online LLMs by extending the API integration layer.
- Implement new selection criteria for RouterLLM.
- Enhance prompt management and storage mechanisms.
- Improve the user interface for configuring and managing models.
We welcome contributions! Please follow the standard GitHub flow for contributing:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
We would like to thank the contributors and the open-source community for their support and contributions to this project.
For more information, feel free to contact the project maintainer at [your-email@example.com].
Enjoy using AbstractAI!