Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ jobs:
dockerfile: "./backend/Dockerfile.python"
context: "./"
ubuntu-version: '2404'
- build-type: ''
cuda-major-version: ""
cuda-minor-version: ""
platforms: 'linux/amd64'
tag-latest: 'auto'
tag-suffix: '-cpu-unsloth'
runs-on: 'ubuntu-latest'
base-image: "ubuntu:24.04"
skip-drivers: 'true'
backend: "unsloth"
dockerfile: "./backend/Dockerfile.python"
context: "./"
ubuntu-version: '2404'
- build-type: ''
cuda-major-version: ""
cuda-minor-version: ""
Expand Down Expand Up @@ -444,6 +457,19 @@ jobs:
dockerfile: "./backend/Dockerfile.python"
context: "./"
ubuntu-version: '2404'
- build-type: 'cublas'
cuda-major-version: "12"
cuda-minor-version: "8"
platforms: 'linux/amd64'
tag-latest: 'auto'
tag-suffix: '-gpu-nvidia-cuda-12-unsloth'
runs-on: 'ubuntu-latest'
base-image: "ubuntu:24.04"
skip-drivers: 'false'
backend: "unsloth"
dockerfile: "./backend/Dockerfile.python"
context: "./"
ubuntu-version: '2404'
- build-type: 'cublas'
cuda-major-version: "12"
cuda-minor-version: "8"
Expand Down Expand Up @@ -965,6 +991,19 @@ jobs:
dockerfile: "./backend/Dockerfile.python"
context: "./"
ubuntu-version: '2404'
- build-type: 'cublas'
cuda-major-version: "13"
cuda-minor-version: "0"
platforms: 'linux/amd64'
tag-latest: 'auto'
tag-suffix: '-gpu-nvidia-cuda-13-unsloth'
runs-on: 'ubuntu-latest'
base-image: "ubuntu:24.04"
skip-drivers: 'false'
backend: "unsloth"
dockerfile: "./backend/Dockerfile.python"
context: "./"
ubuntu-version: '2404'
- build-type: 'cublas'
cuda-major-version: "13"
cuda-minor-version: "0"
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Disable parallel execution for backend builds
.NOTPARALLEL: backends/diffusers backends/llama-cpp backends/outetts backends/piper backends/stablediffusion-ggml backends/whisper backends/faster-whisper backends/silero-vad backends/local-store backends/huggingface backends/rfdetr backends/kitten-tts backends/kokoro backends/chatterbox backends/llama-cpp-darwin backends/neutts build-darwin-python-backend build-darwin-go-backend backends/mlx backends/diffuser-darwin backends/mlx-vlm backends/mlx-audio backends/mlx-distributed backends/stablediffusion-ggml-darwin backends/vllm backends/vllm-omni backends/moonshine backends/pocket-tts backends/qwen-tts backends/faster-qwen3-tts backends/qwen-asr backends/nemo backends/voxcpm backends/whisperx backends/ace-step backends/acestep-cpp backends/fish-speech backends/voxtral backends/opus
.NOTPARALLEL: backends/diffusers backends/llama-cpp backends/outetts backends/piper backends/stablediffusion-ggml backends/whisper backends/faster-whisper backends/silero-vad backends/local-store backends/huggingface backends/rfdetr backends/kitten-tts backends/kokoro backends/chatterbox backends/llama-cpp-darwin backends/neutts build-darwin-python-backend build-darwin-go-backend backends/mlx backends/diffuser-darwin backends/mlx-vlm backends/mlx-audio backends/mlx-distributed backends/stablediffusion-ggml-darwin backends/vllm backends/vllm-omni backends/moonshine backends/pocket-tts backends/qwen-tts backends/faster-qwen3-tts backends/qwen-asr backends/nemo backends/voxcpm backends/whisperx backends/ace-step backends/acestep-cpp backends/fish-speech backends/voxtral backends/opus backends/unsloth

GOCMD=go
GOTEST=$(GOCMD) test
Expand Down Expand Up @@ -421,6 +421,7 @@ prepare-test-extra: protogen-python
$(MAKE) -C backend/python/voxcpm
$(MAKE) -C backend/python/whisperx
$(MAKE) -C backend/python/ace-step
$(MAKE) -C backend/python/unsloth

test-extra: prepare-test-extra
$(MAKE) -C backend/python/transformers test
Expand All @@ -440,6 +441,7 @@ test-extra: prepare-test-extra
$(MAKE) -C backend/python/voxcpm test
$(MAKE) -C backend/python/whisperx test
$(MAKE) -C backend/python/ace-step test
$(MAKE) -C backend/python/unsloth test

DOCKER_IMAGE?=local-ai
IMAGE_TYPE?=core
Expand Down Expand Up @@ -571,6 +573,7 @@ BACKEND_NEMO = nemo|python|.|false|true
BACKEND_VOXCPM = voxcpm|python|.|false|true
BACKEND_WHISPERX = whisperx|python|.|false|true
BACKEND_ACE_STEP = ace-step|python|.|false|true
BACKEND_UNSLOTH = unsloth|python|.|false|true
BACKEND_MLX_DISTRIBUTED = mlx-distributed|python|./|false|true

# Helper function to build docker image for a backend
Expand Down Expand Up @@ -627,14 +630,15 @@ $(eval $(call generate-docker-build-target,$(BACKEND_NEMO)))
$(eval $(call generate-docker-build-target,$(BACKEND_VOXCPM)))
$(eval $(call generate-docker-build-target,$(BACKEND_WHISPERX)))
$(eval $(call generate-docker-build-target,$(BACKEND_ACE_STEP)))
$(eval $(call generate-docker-build-target,$(BACKEND_UNSLOTH)))
$(eval $(call generate-docker-build-target,$(BACKEND_ACESTEP_CPP)))
$(eval $(call generate-docker-build-target,$(BACKEND_MLX_DISTRIBUTED)))

# Pattern rule for docker-save targets
docker-save-%: backend-images
docker save local-ai-backend:$* -o backend-images/$*.tar

docker-build-backends: docker-build-llama-cpp docker-build-rerankers docker-build-vllm docker-build-vllm-omni docker-build-transformers docker-build-outetts docker-build-diffusers docker-build-kokoro docker-build-faster-whisper docker-build-coqui docker-build-chatterbox docker-build-vibevoice docker-build-moonshine docker-build-pocket-tts docker-build-qwen-tts docker-build-fish-speech docker-build-faster-qwen3-tts docker-build-qwen-asr docker-build-nemo docker-build-voxcpm docker-build-whisperx docker-build-ace-step docker-build-acestep-cpp docker-build-voxtral docker-build-mlx-distributed
docker-build-backends: docker-build-llama-cpp docker-build-rerankers docker-build-vllm docker-build-vllm-omni docker-build-transformers docker-build-outetts docker-build-diffusers docker-build-kokoro docker-build-faster-whisper docker-build-coqui docker-build-chatterbox docker-build-vibevoice docker-build-moonshine docker-build-pocket-tts docker-build-qwen-tts docker-build-fish-speech docker-build-faster-qwen3-tts docker-build-qwen-asr docker-build-nemo docker-build-voxcpm docker-build-whisperx docker-build-ace-step docker-build-acestep-cpp docker-build-voxtral docker-build-mlx-distributed docker-build-unsloth

########################################################
### Mock Backend for E2E Tests
Expand Down
48 changes: 48 additions & 0 deletions backend/backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ service Backend {
rpc AudioDecode(AudioDecodeRequest) returns (AudioDecodeResult) {}

rpc ModelMetadata(ModelOptions) returns (ModelMetadataResponse) {}

rpc TrainStream(TrainRequest) returns (stream TrainResponse) {}
}

// Define the empty request
Expand Down Expand Up @@ -528,3 +530,49 @@ message ModelMetadataResponse {
string rendered_template = 2; // The rendered chat template with enable_thinking=true (empty if not applicable)
ToolFormatMarkers tool_format = 3; // Auto-detected tool format markers from differential template analysis
}

message TrainRequest {
string model = 1; // Base model name or HuggingFace model ID
string dataset = 2; // Path or HuggingFace dataset ID
string output_dir = 3; // Output directory for the fine-tuned model

// Hyperparameters
int32 epochs = 4; // Number of training epochs
int32 batch_size = 5; // Training batch size
float learning_rate = 6; // Learning rate
int32 max_seq_length = 7; // Maximum sequence length

// LoRA parameters
int32 lora_rank = 8; // LoRA rank (r)
int32 lora_alpha = 9; // LoRA alpha scaling factor
float lora_dropout = 10; // LoRA dropout rate
repeated string target_modules = 11; // LoRA target modules (e.g., "q_proj", "v_proj")

// Quantization
string quantization = 12; // Quantization method (e.g., "4bit", "8bit", "none")

// Additional options
map<string, string> options = 13; // Generic key-value options for backend-specific settings
}

message TrainResponse {
enum TrainStatus {
UNKNOWN = 0;
STARTING = 1;
RUNNING = 2;
COMPLETED = 3;
FAILED = 4;
}

TrainStatus status = 1; // Current training status
float progress = 2; // Overall progress percentage (0-100)
int32 current_epoch = 3; // Current epoch number
int32 total_epochs = 4; // Total number of epochs
int32 current_step = 5; // Current training step
int32 total_steps = 6; // Total number of training steps
float loss = 7; // Current training loss
float learning_rate_current = 8; // Current learning rate (may change with schedulers)
string message = 9; // Human-readable status message
string error = 10; // Error message if status is FAILED
string output_path = 11; // Path to the output model (set on completion)
}
57 changes: 57 additions & 0 deletions backend/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
capabilities:
nvidia: "cuda12-rfdetr"
intel: "intel-rfdetr"
#amd: "rocm-rfdetr"

Check warning on line 121 in backend/index.yaml

View workflow job for this annotation

GitHub Actions / Yamllint

121:6 [comments] missing starting space in comment
nvidia-l4t: "nvidia-l4t-arm64-rfdetr"
metal: "metal-rfdetr"
default: "cpu-rfdetr"
Expand Down Expand Up @@ -530,6 +530,25 @@
nvidia-cuda-12: "cuda12-chatterbox"
nvidia-l4t-cuda-12: "nvidia-l4t-arm64-chatterbox"
nvidia-l4t-cuda-13: "cuda13-nvidia-l4t-arm64-chatterbox"
- &unsloth
urls:
- https://github.com/unslothai/unsloth
description: |
Fine-tuning backend powered by Unsloth. Supports QLoRA, LoRA, and full fine-tuning
of LLMs with 2x faster training and 70% less memory. Includes GGUF export support.
tags:
- fine-tuning
- training
- lora
- qlora
license: apache-2.0
name: "unsloth"
alias: "unsloth"
capabilities:
nvidia: "cuda12-unsloth"
default: "cpu-unsloth"
nvidia-cuda-13: "cuda13-unsloth"
nvidia-cuda-12: "cuda12-unsloth"
- &vibevoice
urls:
- https://github.com/microsoft/VibeVoice
Expand Down Expand Up @@ -1521,7 +1540,7 @@
capabilities:
nvidia: "cuda12-rfdetr-development"
intel: "intel-rfdetr-development"
#amd: "rocm-rfdetr-development"

Check warning on line 1543 in backend/index.yaml

View workflow job for this annotation

GitHub Actions / Yamllint

1543:6 [comments] missing starting space in comment
nvidia-l4t: "nvidia-l4t-arm64-rfdetr-development"
metal: "metal-rfdetr-development"
default: "cpu-rfdetr-development"
Expand Down Expand Up @@ -3029,3 +3048,41 @@
uri: "quay.io/go-skynet/local-ai-backends:master-metal-darwin-arm64-voxtral"
mirrors:
- localai/localai-backends:master-metal-darwin-arm64-voxtral
## unsloth
- !!merge <<: *unsloth
name: "unsloth-development"
capabilities:
nvidia: "cuda12-unsloth-development"
default: "cpu-unsloth-development"
nvidia-cuda-13: "cuda13-unsloth-development"
nvidia-cuda-12: "cuda12-unsloth-development"
- !!merge <<: *unsloth
name: "cpu-unsloth"
uri: "quay.io/go-skynet/local-ai-backends:latest-cpu-unsloth"
mirrors:
- localai/localai-backends:latest-cpu-unsloth
- !!merge <<: *unsloth
name: "cpu-unsloth-development"
uri: "quay.io/go-skynet/local-ai-backends:master-cpu-unsloth"
mirrors:
- localai/localai-backends:master-cpu-unsloth
- !!merge <<: *unsloth
name: "cuda12-unsloth"
uri: "quay.io/go-skynet/local-ai-backends:latest-gpu-nvidia-cuda-12-unsloth"
mirrors:
- localai/localai-backends:latest-gpu-nvidia-cuda-12-unsloth
- !!merge <<: *unsloth
name: "cuda12-unsloth-development"
uri: "quay.io/go-skynet/local-ai-backends:master-gpu-nvidia-cuda-12-unsloth"
mirrors:
- localai/localai-backends:master-gpu-nvidia-cuda-12-unsloth
- !!merge <<: *unsloth
name: "cuda13-unsloth"
uri: "quay.io/go-skynet/local-ai-backends:latest-gpu-nvidia-cuda-13-unsloth"
mirrors:
- localai/localai-backends:latest-gpu-nvidia-cuda-13-unsloth
- !!merge <<: *unsloth
name: "cuda13-unsloth-development"
uri: "quay.io/go-skynet/local-ai-backends:master-gpu-nvidia-cuda-13-unsloth"
mirrors:
- localai/localai-backends:master-gpu-nvidia-cuda-13-unsloth
23 changes: 23 additions & 0 deletions backend/python/unsloth/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: unsloth
unsloth:
bash install.sh

.PHONY: run
run: unsloth
@echo "Running unsloth..."
bash run.sh
@echo "unsloth run."

.PHONY: test
test: unsloth
@echo "Testing unsloth..."
bash test.sh
@echo "unsloth tested."

.PHONY: protogen-clean
protogen-clean:
$(RM) backend_pb2_grpc.py backend_pb2.py

.PHONY: clean
clean: protogen-clean
rm -rf venv __pycache__
Loading
Loading