Text Generation
PyTorch
GGUF
English
blacksmith_nanogpt
conversational
long-context
from-scratch
custom-architecture
522m
Instructions to use TriusAI/blacksmith-1a with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TriusAI/blacksmith-1a 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 TriusAI/blacksmith-1a:Q4_K_M # Run inference directly in the terminal: llama cli -hf TriusAI/blacksmith-1a:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf TriusAI/blacksmith-1a:Q4_K_M # Run inference directly in the terminal: llama cli -hf TriusAI/blacksmith-1a:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf TriusAI/blacksmith-1a:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf TriusAI/blacksmith-1a:Q4_K_M
Use Docker
docker model run hf.co/TriusAI/blacksmith-1a:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use TriusAI/blacksmith-1a with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TriusAI/blacksmith-1a" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TriusAI/blacksmith-1a", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TriusAI/blacksmith-1a:Q4_K_M
- Ollama
How to use TriusAI/blacksmith-1a with Ollama:
ollama run hf.co/TriusAI/blacksmith-1a:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use TriusAI/blacksmith-1a with Docker Model Runner:
docker model run hf.co/TriusAI/blacksmith-1a:Q4_K_M
- Lemonade
How to use TriusAI/blacksmith-1a with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TriusAI/blacksmith-1a:Q4_K_M
Run and chat with the model
lemonade run user.blacksmith-1a-Q4_K_M
List all available models
lemonade list
- Atomic Chat
File size: 2,042 Bytes
2054ea3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/usr/bin/env python3
"""Build a mixed JSONL by sampling each source down to a token budget.
Token shares are what the packed dataset actually sees, so integer `repeat`
factors on whole files are too coarse (LongAlign alone is 265M tokens). This
samples rows per source until each budget is met, then shuffles.
python3 build_mix.py --out mix_sft.jsonl \
--source identity.jsonl:1000000 --source train_0.jsonl:28000000 \
--source longalign_sft.jsonl:9000000 --source niah_sft.jsonl:55000000
"""
import argparse
import json
import random
from tokenmaker import Tokenizer
def parse_args():
p = argparse.ArgumentParser()
p.add_argument('--out', required=True)
p.add_argument('--source', action='append', required=True,
metavar='PATH:TOKENS', help='repeatable; tokens is a budget')
p.add_argument('--seed', type=int, default=0)
return p.parse_args()
def main():
args = parse_args()
rng = random.Random(args.seed)
rows, stats = [], []
for spec in args.source:
path, _, budget = spec.rpartition(':')
budget = int(budget)
used = 0
n = 0
with open(path) as f:
for line in f:
line = line.strip()
if not line:
continue
d = json.loads(line)
msgs = d.get('data') or []
used += sum(len(Tokenizer.encode(m)) + 6 for m in msgs)
rows.append(d)
n += 1
if used >= budget:
break
stats.append((path, n, used))
rng.shuffle(rows)
with open(args.out, 'w') as f:
for d in rows:
f.write(json.dumps(d, ensure_ascii=False) + '\n')
total = sum(u for _, _, u in stats)
for path, n, used in stats:
print(f' {path:28s} {n:7d} rows {used/1e6:6.1f}M tokens '
f'({100*used/total:4.1f}%)')
print(f'wrote {len(rows)} rows, {total/1e6:.1f}M tokens -> {args.out}')
if __name__ == '__main__':
main()
|