Instructions to use maxdemarzi/black-swan-v6len-q4 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 maxdemarzi/black-swan-v6len-q4 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 maxdemarzi/black-swan-v6len-q4:Q4_K_M # Run inference directly in the terminal: llama cli -hf maxdemarzi/black-swan-v6len-q4:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf maxdemarzi/black-swan-v6len-q4:Q4_K_M # Run inference directly in the terminal: llama cli -hf maxdemarzi/black-swan-v6len-q4:Q4_K_M
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 maxdemarzi/black-swan-v6len-q4:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf maxdemarzi/black-swan-v6len-q4:Q4_K_M
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 maxdemarzi/black-swan-v6len-q4:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf maxdemarzi/black-swan-v6len-q4:Q4_K_M
Use Docker
docker model run hf.co/maxdemarzi/black-swan-v6len-q4:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use maxdemarzi/black-swan-v6len-q4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "maxdemarzi/black-swan-v6len-q4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "maxdemarzi/black-swan-v6len-q4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/maxdemarzi/black-swan-v6len-q4:Q4_K_M
- Ollama
How to use maxdemarzi/black-swan-v6len-q4 with Ollama:
ollama run hf.co/maxdemarzi/black-swan-v6len-q4:Q4_K_M
- Unsloth Studio
How to use maxdemarzi/black-swan-v6len-q4 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 maxdemarzi/black-swan-v6len-q4 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 maxdemarzi/black-swan-v6len-q4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for maxdemarzi/black-swan-v6len-q4 to start chatting
- Docker Model Runner
How to use maxdemarzi/black-swan-v6len-q4 with Docker Model Runner:
docker model run hf.co/maxdemarzi/black-swan-v6len-q4:Q4_K_M
- Lemonade
How to use maxdemarzi/black-swan-v6len-q4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull maxdemarzi/black-swan-v6len-q4:Q4_K_M
Run and chat with the model
lemonade run user.black-swan-v6len-q4-Q4_K_M
List all available models
lemonade list
- Atomic Chat
black-swan-v6len-q4
Qwen2.5-Coder-1.5B-Instruct with the black_swan sft_v6len LoRA merged in, converted to
GGUF and quantized to Q4_K_M (986 MB, against 3.1 GB for f16).
It writes PyRel โ a declarative Python query DSL โ from a natural-language question and a schema of Concepts and their properties.
Accuracy
Executed, not string-matched: every program is run against the real database and its result compared with the gold SQL's. Measured on the quantized weights, not extrapolated from f16, because quantization costs real accuracy here.
| q4_K_M | f16 | |
|---|---|---|
| BIRD, 428 held-out questions | 30.4% | 33.2% |
The 428 are BIRD dev questions on four held-out schemas (california_schools,
debit_card_specializing, thrombosis_prediction, superhero) that appear nowhere in
training, so this measures generalisation to an unseen schema rather than recall.
Quantization costs 2.8 points, 12 questions of 428 (exact paired McNemar p = 0.0501).
Compared with the earlier black-swan-sft15-q4 on the identical 428 questions: 30.4% against 9.6%.
It requires BIRD's evidence hint
This is a usage requirement, not a footnote. The model was trained with BIRD's evidence
field appended to the question, and that single change is most of what it knows:
without the hint 14.5%
with the hint 30.6% (exact paired McNemar, p = 4.2e-13)
Format the question as:
<question>
Hint: <evidence>
Given a bare question the same weights score less than half as well. The earlier sft15 models carry no such requirement, so anything switching between them must know this.
Usage
ollama create black-swan-v6len:1.5b-q4 -f Modelfile
ollama run black-swan-v6len:1.5b-q4
The Modelfile in this repo carries three things that are not optional:
- the trained system prompt โ given a different one the same weights answer in SQL rather than PyRel;
- the ChatML template the fine-tune was trained with โ a prompt format is part of a model's weights, and sending another asks for something it never saw;
num_ctx 16384โ a BIRD schema in the trained shape runs to thousands of tokens, and the 2048 default truncates the prompt before the question, so the model answers a schema dump it was never asked about.
ollama show --template is the one-line check: if it prints a bare {{ .Prompt }}, no
system prompt is reaching the model however it was invoked.
Prompt shape:
Schema:
Schools: cdscode, city, county, school, statustype
Frpm: cdscode, charter_school_y_n, enrollment_k_12, free_meal_count_k_12
.cdscode -> Schools: cdscode, city, county, school
Question: How many schools are in Fresno county?
Hint: Fresno county refers to County = 'Fresno'
result = where(Schools.county == "Fresno").select(
count(Schools).alias("count")).to_dict()
What this model is NOT better at, and what beats it
Spider and TPC-DS are unmeasured for this model. black-swan-sft15-q4 reports 77.4% on
Spider and 45.5% on TPC-DS; there are no comparable figures here, and the evidence hint that
lifts BIRD does not exist in Spider. Do not read 30.4% vs 9.6% as a general improvement โ it
is a BIRD result.
A deterministic SQLโPyRel transpiler beats it, and by a wide margin. On the same 428 questions, generating SQL with a text-to-SQL model and transpiling it scores 53.5% against this model's 33.2% at f16 (exact paired McNemar, p = 1.4e-14). If your goal is answers rather than a model that writes PyRel directly, that pipeline is the better one.
Its remaining errors are semantic. Of its held-out failures, 160 execute and return the wrong rows against 126 that do not execute; 88% of the near misses return a single wrong scalar. Six interventions on the prompt, the vocabulary and the candidate selector each measured at or near zero against that.
Training
- base
Qwen/Qwen2.5-Coder-1.5B-Instruct, QLoRA rank 32, alpha 64, 2 epochs --max-len 1536โ an earlier default of 768 silently truncated ~26% of every fine-tune- 11,917 execution-verified records: Spider-derived worlds plus BIRD training databases
- every training program was run against a real database and admitted only if its result matched the gold SQL's
Licence
Apache-2.0, following the base model. The training corpus is derived from BIRD and Spider; the databases themselves are not redistributed here.
- Downloads last month
- 9
4-bit
Model tree for maxdemarzi/black-swan-v6len-q4
Base model
Qwen/Qwen2.5-1.5B