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
Download code/build_mix.py from TriusAI/blacksmith-1a: direct link, hf CLI and curl.
- Browser
- Download file 2.04 kB
-
https://huggingface.co/TriusAI/blacksmith-1a/resolve/main/code/build_mix.py
- Command line
-
hf download hf://TriusAI/blacksmith-1a/code/build_mix.py
-
curl -L -o build_mix.py https://huggingface.co/TriusAI/blacksmith-1a/resolve/main/code/build_mix.py
2.04 kB
| #!/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() | |