Safetensors
GGUF
Turkish
llama
Llama-3
instruct
finetune
chatml
gpt4
synthetic data
distillation
function calling
json mode
axolotl
roleplaying
chat
Instructions to use tda45/TdAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use tda45/TdAI with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tda45/TdAI", filename="llama.cpp/models/ggml-vocab-aquila.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tda45/TdAI with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf tda45/TdAI # Run inference directly in the terminal: llama cli -hf tda45/TdAI
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tda45/TdAI # Run inference directly in the terminal: llama cli -hf tda45/TdAI
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf tda45/TdAI # Run inference directly in the terminal: ./llama-cli -hf tda45/TdAI
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf tda45/TdAI # Run inference directly in the terminal: ./build/bin/llama-cli -hf tda45/TdAI
Use Docker
docker model run hf.co/tda45/TdAI
- LM Studio
- Jan
- Ollama
How to use tda45/TdAI with Ollama:
ollama run hf.co/tda45/TdAI
- Unsloth Studio
How to use tda45/TdAI with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tda45/TdAI to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tda45/TdAI to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tda45/TdAI to start chatting
- Atomic Chat new
- Docker Model Runner
How to use tda45/TdAI with Docker Model Runner:
docker model run hf.co/tda45/TdAI
- Lemonade
How to use tda45/TdAI with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tda45/TdAI
Run and chat with the model
lemonade run user.TdAI-{{QUANT_TAG}}List all available models
lemonade list
| // | |
| // MIT license | |
| // Copyright (C) 2025 Intel Corporation | |
| // SPDX-License-Identifier: MIT | |
| // | |
| // | |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| // See https://llvm.org/LICENSE.txt for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // | |
| static void ggml_sycl_flash_attn_ext_vec(ggml_backend_sycl_context & ctx, ggml_tensor * dst) { | |
| ggml_tensor * Q = dst->src[0]; | |
| ggml_tensor * K = dst->src[1]; | |
| ggml_tensor * V = dst->src[2]; | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_F16, GGML_TYPE_F16) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_0, GGML_TYPE_F16) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_1, GGML_TYPE_F16) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_0, GGML_TYPE_F16) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_1, GGML_TYPE_F16) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q8_0, GGML_TYPE_F16) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_F16, GGML_TYPE_Q4_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_0, GGML_TYPE_Q4_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_1, GGML_TYPE_Q4_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_0, GGML_TYPE_Q4_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_1, GGML_TYPE_Q4_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q8_0, GGML_TYPE_Q4_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_F16, GGML_TYPE_Q4_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_0, GGML_TYPE_Q4_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_1, GGML_TYPE_Q4_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_0, GGML_TYPE_Q4_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_1, GGML_TYPE_Q4_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q8_0, GGML_TYPE_Q4_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_F16, GGML_TYPE_Q5_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_0, GGML_TYPE_Q5_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_1, GGML_TYPE_Q5_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_0, GGML_TYPE_Q5_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_1, GGML_TYPE_Q5_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q8_0, GGML_TYPE_Q5_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_F16, GGML_TYPE_Q5_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_0, GGML_TYPE_Q5_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_1, GGML_TYPE_Q5_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_0, GGML_TYPE_Q5_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_1, GGML_TYPE_Q5_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q8_0, GGML_TYPE_Q5_1) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_F16, GGML_TYPE_Q8_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_0, GGML_TYPE_Q8_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_1, GGML_TYPE_Q8_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_0, GGML_TYPE_Q8_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q5_1, GGML_TYPE_Q8_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q8_0, GGML_TYPE_Q8_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_F16, GGML_TYPE_F16) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q4_0, GGML_TYPE_Q4_0) | |
| FATTN_VEC_CASES_ALL_D(GGML_TYPE_Q8_0, GGML_TYPE_Q8_0) | |
| GGML_ABORT("Not match KV type in vec"); | |
| } | |
| // Best FlashAttention kernel for a specific GPU: | |
| enum best_fattn_kernel { | |
| BEST_FATTN_KERNEL_NONE = 0, | |
| BEST_FATTN_KERNEL_VEC = 100, | |
| BEST_FATTN_KERNEL_TILE = 200, | |
| }; | |
| static best_fattn_kernel ggml_sycl_get_best_fattn_kernel(const int device, const ggml_tensor * dst) { | |
| GGML_UNUSED(device); | |
| GGML_UNUSED(dst); | |
| return BEST_FATTN_KERNEL_NONE; | |
| if(!g_ggml_sycl_enable_flash_attention) return BEST_FATTN_KERNEL_NONE; | |
| const ggml_tensor * KQV = dst; | |
| const ggml_tensor * Q = dst->src[0]; | |
| const ggml_tensor * K = dst->src[1]; | |
| const ggml_tensor * V = dst->src[2]; | |
| const ggml_tensor * mask = dst->src[3]; | |
| const int gqa_ratio = Q->ne[2] / K->ne[2]; | |
| GGML_ASSERT(Q->ne[2] % K->ne[2] == 0); | |
| float max_bias = 0.0f; | |
| memcpy(&max_bias, (const float *) KQV->op_params + 1, sizeof(float)); | |
| bool gqa_opt_applies = gqa_ratio >= 2 && mask && max_bias == 0.0f && K->ne[1] % FATTN_KQ_STRIDE == 0; | |
| for (const ggml_tensor * t : {Q, K, V, mask}) { | |
| if (t == nullptr || ggml_is_quantized(t->type)) { | |
| continue; | |
| } | |
| for (size_t i = 1; i < GGML_MAX_DIMS; ++i) { | |
| if (t->nb[i] % 16 != 0) { | |
| gqa_opt_applies = false; | |
| break; | |
| } | |
| } | |
| } | |
| switch (K->ne[0]) { | |
| case 40: | |
| case 64: | |
| case 72: | |
| case 80: | |
| case 96: | |
| case 128: | |
| case 112: | |
| case 256: | |
| case 512: | |
| if (V->ne[0] != K->ne[0]) { | |
| return BEST_FATTN_KERNEL_NONE; | |
| } | |
| break; | |
| case 576: | |
| if (V->ne[0] != 512) { | |
| return BEST_FATTN_KERNEL_NONE; | |
| } | |
| if (!gqa_opt_applies) { | |
| return BEST_FATTN_KERNEL_NONE; | |
| } | |
| break; | |
| default: | |
| return BEST_FATTN_KERNEL_NONE; | |
| } | |
| if (K->type != V->type) { | |
| return BEST_FATTN_KERNEL_NONE; | |
| } | |
| switch (K->type) { | |
| case GGML_TYPE_F32: | |
| case GGML_TYPE_F16: | |
| break; | |
| case GGML_TYPE_Q4_1: | |
| case GGML_TYPE_Q5_0: | |
| case GGML_TYPE_Q5_1: | |
| return BEST_FATTN_KERNEL_NONE; | |
| case GGML_TYPE_Q4_0: | |
| case GGML_TYPE_Q8_0: | |
| break; | |
| default: | |
| return BEST_FATTN_KERNEL_NONE; | |
| } | |
| if (mask && mask->ne[2] != 1) { | |
| return BEST_FATTN_KERNEL_NONE; | |
| } | |
| // For small batch sizes the vector kernel may be preferable over the kernels optimized for large batch sizes: | |
| const bool can_use_vector_kernel = Q->ne[0] <= 512 && Q->ne[0] % 64 == 0 && K->ne[1] % FATTN_KQ_STRIDE == 0; | |
| // Todo: Use the XMX kernel if possible: | |
| // If there are no tensor cores available, use the generic tile kernel: | |
| if (can_use_vector_kernel) { | |
| if (!ggml_is_quantized(K->type) && !ggml_is_quantized(V->type)) { | |
| if (Q->ne[1] == 1) { | |
| if (!gqa_opt_applies) { | |
| return BEST_FATTN_KERNEL_VEC; | |
| } | |
| } | |
| } else { | |
| if (Q->ne[1] <= 2) { | |
| return BEST_FATTN_KERNEL_VEC; | |
| } | |
| } | |
| } | |
| return BEST_FATTN_KERNEL_TILE; | |
| } | |
| void ggml_sycl_flash_attn_ext(ggml_backend_sycl_context & ctx, ggml_tensor * dst) { | |
| ggml_sycl_set_device(ctx.device); | |
| switch (ggml_sycl_get_best_fattn_kernel(ggml_sycl_get_device(), dst)) { | |
| case BEST_FATTN_KERNEL_NONE: | |
| GGML_ABORT("Not support Flash-Attention"); | |
| case BEST_FATTN_KERNEL_TILE: | |
| ggml_sycl_flash_attn_ext_tile(ctx, dst); | |
| break; | |
| case BEST_FATTN_KERNEL_VEC: | |
| ggml_sycl_flash_attn_ext_vec(ctx, dst); | |
| break; | |
| } | |
| } | |
| bool ggml_sycl_flash_attn_ext_supported(int device, const ggml_tensor * dst) { | |
| return ggml_sycl_get_best_fattn_kernel(device, dst) != BEST_FATTN_KERNEL_NONE; | |
| } | |