Instructions to use AIIT-Threshold/Tessera-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use AIIT-Threshold/Tessera-1B with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="AIIT-Threshold/Tessera-1B", filename="gguf/tessera-1b-Q6_K.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 AIIT-Threshold/Tessera-1B 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 AIIT-Threshold/Tessera-1B:Q6_K # Run inference directly in the terminal: llama cli -hf AIIT-Threshold/Tessera-1B:Q6_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AIIT-Threshold/Tessera-1B:Q6_K # Run inference directly in the terminal: llama cli -hf AIIT-Threshold/Tessera-1B:Q6_K
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 AIIT-Threshold/Tessera-1B:Q6_K # Run inference directly in the terminal: ./llama-cli -hf AIIT-Threshold/Tessera-1B:Q6_K
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 AIIT-Threshold/Tessera-1B:Q6_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf AIIT-Threshold/Tessera-1B:Q6_K
Use Docker
docker model run hf.co/AIIT-Threshold/Tessera-1B:Q6_K
- LM Studio
- Jan
- Ollama
How to use AIIT-Threshold/Tessera-1B with Ollama:
ollama run hf.co/AIIT-Threshold/Tessera-1B:Q6_K
- Unsloth Studio
How to use AIIT-Threshold/Tessera-1B 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 AIIT-Threshold/Tessera-1B 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 AIIT-Threshold/Tessera-1B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AIIT-Threshold/Tessera-1B to start chatting
- Atomic Chat new
- Docker Model Runner
How to use AIIT-Threshold/Tessera-1B with Docker Model Runner:
docker model run hf.co/AIIT-Threshold/Tessera-1B:Q6_K
- Lemonade
How to use AIIT-Threshold/Tessera-1B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AIIT-Threshold/Tessera-1B:Q6_K
Run and chat with the model
lemonade run user.Tessera-1B-Q6_K
List all available models
lemonade list
Tessera 1B: from-scratch 1.01B base + v12i/v7 SFT adapters, tokenizer, loader, USAGE (Apache-2.0)
abfb518 verified | """Plain LoRA for the custom ProtoGPT (NOT HF/PEFT — this is a bare nn.Module). | |
| Wraps the four Linear layers per block: attn.qkv, attn.proj, mlp.0, mlp.2. | |
| Base weights frozen; only A,B train. Adapter saves/loads as just the A,B tensors. | |
| """ | |
| import math | |
| import torch | |
| import torch.nn as nn | |
| TARGETS = ("attn.qkv", "attn.proj", "mlp.0", "mlp.2") | |
| class LoRALinear(nn.Module): | |
| def __init__(self, base: nn.Linear, rank=16, alpha=32, dropout=0.05): | |
| super().__init__() | |
| self.base = base | |
| for p in self.base.parameters(): | |
| p.requires_grad_(False) # base frozen | |
| self.scaling = alpha / rank | |
| self.drop = nn.Dropout(dropout) | |
| self.A = nn.Parameter(torch.empty(rank, base.in_features)) | |
| self.B = nn.Parameter(torch.zeros(base.out_features, rank)) # B=0 -> delta=0 at init | |
| nn.init.kaiming_uniform_(self.A, a=math.sqrt(5)) | |
| def forward(self, x): | |
| return self.base(x) + (self.drop(x) @ self.A.t() @ self.B.t()) * self.scaling | |
| def inject_lora(model, rank=16, alpha=32, dropout=0.05, targets=TARGETS): | |
| """Freeze everything, replace target Linears with LoRALinear. Returns #replaced.""" | |
| for p in model.parameters(): | |
| p.requires_grad_(False) | |
| names = [n for n, m in model.named_modules() | |
| if isinstance(m, nn.Linear) and any(n.endswith(t) for t in targets)] | |
| for n in names: | |
| parent = model.get_submodule(n.rsplit(".", 1)[0]) | |
| child = n.rsplit(".", 1)[1] | |
| setattr(parent, child, LoRALinear(getattr(parent, child), rank, alpha, dropout)) | |
| return len(names) | |
| def lora_trainable(model): | |
| return [p for p in model.parameters() if p.requires_grad] | |
| def lora_state_dict(model): | |
| return {n: p.detach().cpu() for n, p in model.named_parameters() if p.requires_grad} | |
| def load_lora_state(model, sd): | |
| params = dict(model.named_parameters()) | |
| for n, v in sd.items(): | |
| params[n].data.copy_(v.to(params[n].device, params[n].dtype)) | |