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
| import pytest | |
| from openai import OpenAI | |
| from utils import * | |
| import threading | |
| from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer | |
| server = ServerPreset.tinyllama2() | |
| TEST_API_KEY = "sk-this-is-the-secret-key" | |
| def create_server(): | |
| global server | |
| server = ServerPreset.tinyllama2() | |
| server.api_key = TEST_API_KEY | |
| def test_access_public_endpoint(endpoint: str): | |
| global server | |
| server.start() | |
| res = server.make_request("GET", endpoint) | |
| assert res.status_code == 200 | |
| assert "error" not in res.body | |
| def test_access_static_assets_without_api_key(): | |
| """Static web UI assets should not require API key authentication (issue #21229)""" | |
| global server | |
| server.start() | |
| for path in ["/", "/sw.js", "/manifest.webmanifest", "/_app/version.json"]: | |
| res = server.make_request("GET", path) | |
| assert res.status_code == 200, f"Expected 200 for {path}, got {res.status_code}" | |
| def test_incorrect_api_key(api_key: str): | |
| global server | |
| server.start() | |
| res = server.make_request("POST", "/completions", data={ | |
| "prompt": "I believe the meaning of life is", | |
| }, headers={ | |
| "Authorization": f"Bearer {api_key}" if api_key else None, | |
| }) | |
| assert res.status_code == 401 | |
| assert "error" in res.body | |
| assert res.body["error"]["type"] == "authentication_error" | |
| def test_correct_api_key(): | |
| global server | |
| server.start() | |
| res = server.make_request("POST", "/completions", data={ | |
| "prompt": "I believe the meaning of life is", | |
| }, headers={ | |
| "Authorization": f"Bearer {TEST_API_KEY}", | |
| }) | |
| assert res.status_code == 200 | |
| assert "error" not in res.body | |
| assert "content" in res.body | |
| def test_correct_api_key_anthropic_header(): | |
| global server | |
| server.start() | |
| res = server.make_request("POST", "/completions", data={ | |
| "prompt": "I believe the meaning of life is", | |
| }, headers={ | |
| "X-Api-Key": TEST_API_KEY, | |
| }) | |
| assert res.status_code == 200 | |
| assert "error" not in res.body | |
| assert "content" in res.body | |
| def test_openai_library_correct_api_key(): | |
| global server | |
| server.start() | |
| client = OpenAI(api_key=TEST_API_KEY, base_url=f"http://{server.server_host}:{server.server_port}") | |
| res = client.chat.completions.create( | |
| model="gpt-3.5-turbo", | |
| messages=[ | |
| {"role": "system", "content": "You are a chatbot."}, | |
| {"role": "user", "content": "What is the meaning of life?"}, | |
| ], | |
| ) | |
| assert len(res.choices) == 1 | |
| def test_cors_options(origin: str, cors_header: str, cors_header_value: str): | |
| global server | |
| server.start() | |
| res = server.make_request("OPTIONS", "/completions", headers={ | |
| "Origin": origin, | |
| "Access-Control-Request-Method": "POST", | |
| "Access-Control-Request-Headers": "Authorization", | |
| }) | |
| assert res.status_code == 200 | |
| assert cors_header in res.headers | |
| assert res.headers[cors_header] == cors_header_value | |
| def test_cors_proxy_only_forwards_explicit_proxy_headers(): | |
| class CaptureHeadersHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| self.server.captured_headers = dict(self.headers) | |
| self.send_response(200) | |
| self.end_headers() | |
| self.wfile.write(b"ok") | |
| def log_message(self, format, *args): | |
| pass | |
| target = ThreadingHTTPServer(("127.0.0.1", 0), CaptureHeadersHandler) | |
| target.captured_headers = {} | |
| target_thread = threading.Thread(target=target.serve_forever, daemon=True) | |
| target_thread.start() | |
| try: | |
| server = ServerPreset.tinyllama2() | |
| server.api_key = TEST_API_KEY | |
| server.ui_mcp_proxy = True | |
| server.start() | |
| res = server.make_request("GET", f"/cors-proxy?url=http://127.0.0.1:{target.server_port}/capture", headers={ | |
| "Authorization": f"Bearer {TEST_API_KEY}", | |
| "Proxy-Authorization": "Basic secret", | |
| "X-Api-Key": TEST_API_KEY, | |
| "Cookie": "session=secret", | |
| "x-llama-server-proxy-header-accept": "application/json", | |
| "x-llama-server-proxy-header-authorization": "Bearer explicit", | |
| }) | |
| assert res.status_code == 200 | |
| captured = {key.lower(): value for key, value in target.captured_headers.items()} | |
| assert captured["accept"] == "application/json" | |
| assert captured["authorization"] == "Bearer explicit" | |
| assert "proxy-authorization" not in captured | |
| assert "x-api-key" not in captured | |
| assert "cookie" not in captured | |
| finally: | |
| target.shutdown() | |
| target.server_close() | |
| def test_local_media_file(media_path, image_url, success,): | |
| server = ServerPreset.tinygemma3() | |
| server.media_path = media_path | |
| server.start() | |
| res = server.make_request("POST", "/chat/completions", data={ | |
| "max_tokens": 1, | |
| "messages": [ | |
| {"role": "user", "content": [ | |
| {"type": "text", "text": "test"}, | |
| {"type": "image_url", "image_url": { | |
| "url": image_url, | |
| }}, | |
| ]}, | |
| ], | |
| }) | |
| if success: | |
| assert res.status_code == 200 | |
| else: | |
| assert res.status_code == 400 | |