blockentropy / ml-client

Machine Learning Clients for Open Source Infra
8 stars 3 forks source link
Entropy ML Clients

Entropy ML Clients. OpenAI compatible clients for distributed and decentralized compute

Latest News

About

This repository contains custom endpoints for use in distributed and decentralized compute. Most of these endpoints are compatible with OpenAI, including the LLM client, image client, and embedding clients. There are additional custom endpoints that support state-of-the-art research features, allowing the Entropy API to achieve competitive performance results with GPT-4 models.

OpenAI Compatible Endpoints

Note: Our router is compatible with vLLM endpoints as well. See vLLM project. vLLM has support for multiple clients. Differences include support for HuggingFace models, GPTQ quantization, and basic authentication with the Entropy router. They also handle the prompt template of different models within the custom code.

Custom Research Endpoints

Conda Environments

Config

Installation

The endpoints were installed on Ubuntu 22 and 23 Linux-based machines. The port can be overridden from the config.ini file by using the cmd line --port option. Recommended method of installing miniconda is here, miniconda

conda env create -f llm_environment.yml
conda activate bellm

python3 llm_client.py

Flash attention will need to be installed after the fact. On Ubuntu 23, do the following

sudo apt update
sudo apt install nvidia-cudnn nvidia-cuda-toolkit

pip3 install flash-attn --no-build-isolation

Troubleshooting

If you have trouble finding CUDA_HOME, or the cuda toolkit when trying to compile flash attention on Ubuntu 22, you can try the following.

wget -qO - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/cuda.gpg
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
sudo apt update
sudo apt install cuda-toolkit-11-8
pip install flash-attn --no-build-isolation

Ubuntu 23 does not require the adding of any repos for the toolkit.