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
| # Server tests | |
| Python based server tests scenario using [pytest](https://docs.pytest.org/en/stable/). | |
| Tests target GitHub workflows job runners with 4 vCPU. | |
| Note: If the host architecture inference speed is faster than GitHub runners one, parallel scenario may randomly fail. | |
| To mitigate it, you can increase values in `n_predict`, `kv_size`. | |
| ### Install dependencies | |
| `pip install -r requirements.txt` | |
| ### Run tests | |
| 1. Build the server | |
| ```shell | |
| cd ../../.. | |
| cmake -B build | |
| cmake --build build --target llama-server | |
| ``` | |
| 2. Start the test: `./tests.sh` | |
| It's possible to override some scenario steps values with environment variables: | |
| | variable | description | | |
| |--------------------------|------------------------------------------------------------------------------------------------| | |
| | `PORT` | `context.server_port` to set the listening port of the server during scenario, default: `8080` | | |
| | `LLAMA_SERVER_BIN_PATH` | to change the server binary path, default: `../../../build/bin/llama-server` | | |
| | `DEBUG` | to enable steps and server verbose mode `--verbose` | | |
| | `N_GPU_LAYERS` | number of model layers to offload to VRAM `-ngl --n-gpu-layers` | | |
| | `LLAMA_CACHE` | by default server tests re-download models to the `tmp` subfolder. Set this to your cache (e.g. `$HOME/Library/Caches/llama.cpp` on Mac or `$HOME/.cache/llama.cpp` on Unix) to avoid this | | |
| To run slow tests (will download many models, make sure to set `LLAMA_CACHE` if needed): | |
| ```shell | |
| SLOW_TESTS=1 ./tests.sh | |
| ``` | |
| To run with stdout/stderr display in real time (verbose output, but useful for debugging): | |
| ```shell | |
| DEBUG=1 ./tests.sh -s -v -x | |
| ``` | |
| To run all the tests in a file: | |
| ```shell | |
| ./tests.sh unit/test_chat_completion.py -v -x | |
| ``` | |
| To run a single test: | |
| ```shell | |
| ./tests.sh unit/test_chat_completion.py::test_invalid_chat_completion_req | |
| ``` | |
| Hint: You can compile and run test in single command, useful for local development: | |
| ```shell | |
| cmake --build build -j --target llama-server && ./tools/server/tests/tests.sh | |
| ``` | |
| To see all available arguments, please refer to [pytest documentation](https://docs.pytest.org/en/stable/how-to/usage.html) | |
| ### Debugging external llama-server | |
| It can sometimes be useful to run the server in a debugger when invesigating test | |
| failures. To do this, the environment variable `DEBUG_EXTERNAL=1` can be set | |
| which will cause the test to skip starting a llama-server itself. Instead, the | |
| server can be started in a debugger. | |
| Example using `gdb`: | |
| ```console | |
| $ gdb --args ../../../build/bin/llama-server \ | |
| --host 127.0.0.1 --port 8080 \ | |
| --temp 0.8 --seed 42 \ | |
| --hf-repo ggml-org/models --hf-file tinyllamas/stories260K.gguf \ | |
| --batch-size 32 --no-slots --alias tinyllama-2 --ctx-size 512 \ | |
| --parallel 2 --n-predict 64 | |
| ``` | |
| And a break point can be set in before running: | |
| ```console | |
| (gdb) br server.cpp:4604 | |
| (gdb) r | |
| main: server is listening on http://127.0.0.1:8080 - starting the main loop | |
| srv update_slots: all slots are idle | |
| ``` | |
| And then the test in question can be run in another terminal: | |
| ```console | |
| (venv) $ env DEBUG_EXTERNAL=1 ./tests.sh unit/test_chat_completion.py -v -x | |
| ``` | |
| And this should trigger the breakpoint and allow inspection of the server state | |
| in the debugger terminal. | |