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
| namespace spacemit_kernels { | |
| template <int N> struct nrow_block_q2_k { | |
| // [4bit scale + 4bit zp] * N * 16 | |
| uint8_t scales[N * BLOCK_QNK_LEN / 16]; | |
| // [b0, b16, b32, b48] [b1, b17, b33, b49] ... [b15, b31, b47, b63] | |
| // [b64, b80, b96, b112] ...[b79, b95, b111, b127] | |
| // [b128, b144, b160, b176] ...[b143, b159, b175, b191] | |
| // [b192, b208, b224, b240] ...[b207, b223, b239, b255] | |
| uint8_t qs[N * BLOCK_QNK_LEN / 4]; | |
| uint16_t scales16[N]; | |
| uint16_t zeros16[N]; | |
| }; | |
| template <int N> struct nrow_block_q3_k { | |
| // [8bit scale] * N * 16 | |
| int8_t scales[N * 16]; | |
| // [b0, b1, b2, b3, b4, b5, b6, b7] ... [b248, b249, b250, b251, b252, b253, b254, b255] | |
| uint8_t hmask[N * BLOCK_QNK_LEN / 8]; | |
| // [b0, b16, b32, b48] [b1, b17, b33, b49] ... [b15, b31, b47, b63] | |
| // [b64, b80, b96, b112] ...[b79, b95, b111, b127] | |
| // [b128, b144, b160, b176] ...[b143, b159, b175, b191] | |
| // [b192, b208, b224, b240] ...[b207, b223, b239, b255] | |
| uint8_t qs[N * BLOCK_QNK_LEN / 4]; | |
| uint16_t scales16[N]; | |
| }; | |
| template <int N> struct nrow_block_mxfp4 { | |
| uint8_t e[N]; | |
| uint8_t qh[4 * N]; | |
| uint8_t qs[16 * N]; | |
| }; | |
| template <int N> struct __attribute__((packed)) nrow_block_q5_1 { | |
| uint16_t scales16[N]; | |
| uint8_t zp[N]; | |
| // n0 [bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7] .... | |
| uint8_t qh[4 * N]; | |
| // n0 [b0, b1], [b2, b3] .... [b30, b31] | |
| // n1 [b0, b1], [b2, b3] .... [b30, b31] | |
| uint8_t qs[16 * N]; | |
| }; | |
| static_assert(sizeof(nrow_block_q5_1<1>) == sizeof(uint8_t) + 22, "wrong nrow_block_q5_1 block size/padding"); | |
| template <int N> struct __attribute__((packed)) nrow_block_q5_0 { | |
| uint16_t scales16[N]; | |
| // n0 [bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7] .... | |
| uint8_t qh[4 * N]; | |
| // n0 [b0, b1], [b2, b3] .... [b30, b31] | |
| // n1 [b0, b1], [b2, b3] .... [b30, b31] | |
| uint8_t qs[16 * N]; | |
| }; | |
| static_assert(sizeof(nrow_block_q5_0<1>) == 22, "wrong nrow_block_q5_0 block size/padding"); | |
| using gemm_kernel_quantize_def = std::function< | |
| size_t(size_t, const uint8_t *, const uint8_t *, const uint8_t *, float *, size_t, size_t, size_t, size_t)>; | |
| using moe_gemm_kernel_quantize_def = std::function< | |
| size_t(size_t, const uint8_t **, const uint8_t *, const uint8_t *, float **, size_t, size_t, size_t, size_t)>; | |
| namespace ime1 { | |
| size_t gemm_kernel_i8i4(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| void quantize_a_row_i8(size_t blk_len, const float * a_ptr, size_t count_k, uint8_t * quant_a_ptr); | |
| void quantize_a_4row_i8(size_t blk_len, const float * a_ptr, size_t count_k, uint8_t * quant_a_ptr); | |
| } // namespace ime1 | |
| namespace ime2 { | |
| size_t gemm_kernel_i8i2k(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t gemm_kernel_i8i3k(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t gemm_kernel_i8i4(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t gemm_kernel_i8i4_hp(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t moe_m2_gemm_kernel_i8i4(size_t blk_len, | |
| const uint8_t ** quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float ** c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t gemm_kernel_i8i8(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t gemm_kernel_i8mxfp4(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t moe_m2_gemm_kernel_i8mxfp4(size_t blk_len, | |
| const uint8_t ** quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float ** c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t gemm_kernel_i8i5(size_t blk_len, | |
| const uint8_t * quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float * c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| size_t moe_m2_gemm_kernel_i8i5(size_t blk_len, | |
| const uint8_t ** quant_a_ptr, | |
| const uint8_t * quant_b_data, | |
| const uint8_t * quant_b_zp, | |
| float ** c_ptr, | |
| size_t count_m, | |
| size_t count_n, | |
| size_t k_blks, | |
| size_t ldc); | |
| } // namespace ime2 | |
| } // namespace spacemit_kernels | |