The AI Trainer's Dry Dock.
(unsorted)
Disclaimer In very early development stage. So feedback and contributions are highly appreciated!
git clone https://github.com/l4b4r4b4b4/AIDocks
cd AIDocks
docker-compose up -d && \
docker-compose ps && \
docker-compose logs -f
Go to the interactive API documentation to explore all available endpoints & features!
Llava 1.6 service incl. Gradio Frontend, Controller & Model Worker
The following endpoints are exposed:
/train/compose/optimize/quantize/publish/train Training & Fine-TuningThe training routes expose different endpoints to fine-tune embeddings or reranking models used for retrieval and LLMs.
/train/llm LLM fine-tuning (DPO & SFT)Try API endpoint Finetune Mistral, Llama 2-5x faster with 50% less memory with unsloth
Example datasets when using ChatML for
Supported Models
Features
/train/emb EmbeddingsLoRA-PEFT for Embeddings using peft and accelerate library.
Supported Models
Example datasets
/train/rerank ReRankeringsLoRA-PEFT for re-ranking models.
Supported Models
Example datasets
/compose - BYO-MoE/compose is an endpoint for combining Mistral or Llama models of the same size into Mixture-of-Experts models. The endpoint will combine the self-attention and layer normalization parameters from a "base" model with the MLP parameters from a set of "expert" models.
/compose endpoint can be used with minimal or no GPU.
/compose endpoint uses its own JSON configuration syntax, which looks like so:
request body
{
"base_model": "cognitivecomputations/dolphin-2.6-mistral-7b-dpo",
"gate_mode": "hidden",
"dtype": "bfloat16",
"experts":[
{
"source_model": "teknium/OpenHermes-2.5-Mistral-7B",
"positive_prompts": [
"instruction"
"solutions"
"chat"
"questions"
"comprehension"
]
},
{
"source_model": "openaccess-ai-collective/DPOpenHermes-7B",
"positive_prompts": [
"mathematics"
"optimization"
"code"
"step-by-step"
"science"
],
"negative_prompts": [
"chat"
"questions"
]
}
]
}
Options:
gate_mode: hidden, cheap_embed, or random
dtype: float32, float16, or bfloat16
There are three methods for populating the MoE gates implemented.
Uses the hidden state representations of the positive/negative prompts for MoE gate parameters. Best quality and most effective option; the default. Requires evaluating each prompt using the base model so you might not be able to use this on constrained hardware (depending on the model).
Coming Soon: use --load-in-8bit or --load-in-4bit to reduce VRAM usage.
Uses only the raw token embedding of the prompts, using the same gate parameters for every layer. Distinctly less effective than "hidden". Can be run on much, much lower end hardware.
Randomly initializes the MoE gates. Good for if you are going to fine tune the model afterwards, or maybe if you want something a little unhinged? I won't judge.
/optimize - LaserRMTTry API endpoint
request body
{
"base_model_name" : "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
"laser_model_name": "TinyLaser",
"top_k_layers": 15
}
LaserRMT optimizes LLMs combining Layer-Selective Rank Reduction (LASER) and the Marchenko-Pastur law from Random Matrix Theory. This method targets model complexity reduction while maintaining or enhancing performance, making it more efficient than the traditional brute-force search method.
This approach opens new avenues for optimizing neural networks, underscoring the synergy between advanced mathematical theories and practical AI applications. LaserRMT sets a precedent for future developments in the field of LLM optimization.
/quantize/{method}Generate AWQ-quantizations optimized for GPU-inference.
/publish to HuggingFace 🤗Try API endpoint Publish generated local models to 🤗 HuggingFace Hub.
Some explaining resources for concepts, technologies and tools used in this repository.
43 commits
Python
96.6%
Dockerfile
1.5%
Roff
1.3%
The AI Trainer's Dry Dock.
(unsorted)
Disclaimer In very early development stage. So feedback and contributions are highly appreciated!
git clone https://github.com/l4b4r4b4b4/AIDocks
cd AIDocks
docker-compose up -d && \
docker-compose ps && \
docker-compose logs -f
Go to the interactive API documentation to explore all available endpoints & features!
Llava 1.6 service incl. Gradio Frontend, Controller & Model Worker
The following endpoints are exposed:
/train/compose/optimize/quantize/publish/train Training & Fine-TuningThe training routes expose different endpoints to fine-tune embeddings or reranking models used for retrieval and LLMs.
/train/llm LLM fine-tuning (DPO & SFT)Try API endpoint Finetune Mistral, Llama 2-5x faster with 50% less memory with unsloth
Example datasets when using ChatML for
Supported Models
Features
/train/emb EmbeddingsLoRA-PEFT for Embeddings using peft and accelerate library.
Supported Models
Example datasets
/train/rerank ReRankeringsLoRA-PEFT for re-ranking models.
Supported Models
Example datasets
/compose - BYO-MoE/compose is an endpoint for combining Mistral or Llama models of the same size into Mixture-of-Experts models. The endpoint will combine the self-attention and layer normalization parameters from a "base" model with the MLP parameters from a set of "expert" models.
/compose endpoint can be used with minimal or no GPU.
/compose endpoint uses its own JSON configuration syntax, which looks like so:
request body
{
"base_model": "cognitivecomputations/dolphin-2.6-mistral-7b-dpo",
"gate_mode": "hidden",
"dtype": "bfloat16",
"experts":[
{
"source_model": "teknium/OpenHermes-2.5-Mistral-7B",
"positive_prompts": [
"instruction"
"solutions"
"chat"
"questions"
"comprehension"
]
},
{
"source_model": "openaccess-ai-collective/DPOpenHermes-7B",
"positive_prompts": [
"mathematics"
"optimization"
"code"
"step-by-step"
"science"
],
"negative_prompts": [
"chat"
"questions"
]
}
]
}
Options:
gate_mode: hidden, cheap_embed, or random
dtype: float32, float16, or bfloat16
There are three methods for populating the MoE gates implemented.
Uses the hidden state representations of the positive/negative prompts for MoE gate parameters. Best quality and most effective option; the default. Requires evaluating each prompt using the base model so you might not be able to use this on constrained hardware (depending on the model).
Coming Soon: use --load-in-8bit or --load-in-4bit to reduce VRAM usage.
Uses only the raw token embedding of the prompts, using the same gate parameters for every layer. Distinctly less effective than "hidden". Can be run on much, much lower end hardware.
Randomly initializes the MoE gates. Good for if you are going to fine tune the model afterwards, or maybe if you want something a little unhinged? I won't judge.
/optimize - LaserRMTTry API endpoint
request body
{
"base_model_name" : "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
"laser_model_name": "TinyLaser",
"top_k_layers": 15
}
LaserRMT optimizes LLMs combining Layer-Selective Rank Reduction (LASER) and the Marchenko-Pastur law from Random Matrix Theory. This method targets model complexity reduction while maintaining or enhancing performance, making it more efficient than the traditional brute-force search method.
This approach opens new avenues for optimizing neural networks, underscoring the synergy between advanced mathematical theories and practical AI applications. LaserRMT sets a precedent for future developments in the field of LLM optimization.
/quantize/{method}Generate AWQ-quantizations optimized for GPU-inference.
/publish to HuggingFace 🤗Try API endpoint Publish generated local models to 🤗 HuggingFace Hub.
Some explaining resources for concepts, technologies and tools used in this repository.
43 commits
Python
96.6%
Dockerfile
1.5%
Roff
1.3%