Instructions to use bluemorpholimited/morphoalgo-usstock-14b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bluemorpholimited/morphoalgo-usstock-14b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bluemorpholimited/morphoalgo-usstock-14b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bluemorpholimited/morphoalgo-usstock-14b") model = AutoModelForCausalLM.from_pretrained("bluemorpholimited/morphoalgo-usstock-14b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bluemorpholimited/morphoalgo-usstock-14b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bluemorpholimited/morphoalgo-usstock-14b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bluemorpholimited/morphoalgo-usstock-14b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bluemorpholimited/morphoalgo-usstock-14b
- SGLang
How to use bluemorpholimited/morphoalgo-usstock-14b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "bluemorpholimited/morphoalgo-usstock-14b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bluemorpholimited/morphoalgo-usstock-14b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "bluemorpholimited/morphoalgo-usstock-14b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bluemorpholimited/morphoalgo-usstock-14b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use bluemorpholimited/morphoalgo-usstock-14b with Docker Model Runner:
docker model run hf.co/bluemorpholimited/morphoalgo-usstock-14b
- 🦋 MorphoAlgo‑14B
- ✨ What is MorphoAlgo‑14B?
- 📊 Results at a glance
- 🧠 The full training pipeline
- 1️⃣ Stage 2 — Supervised Fine‑Tuning
- 2️⃣ Stage 3 — Direct Preference Optimisation
- 📚 Data at the heart of MorphoAlgo
- ✅ Stage 5 — Verification
- 🎓 Stage 7 — Distillation
- 🚀 Quick start
- 📦 Model family
- ⚠️ Limitations & responsible use
- 📜 Licence
- ✨ What is MorphoAlgo‑14B?
🦋 MorphoAlgo‑14B
The US‑Equities Quantitative Analyst
BlueMorpho Limited · Quantitative Intelligence Division
14B · US equities · fundamentals + market data · commercially licensed
✨ What is MorphoAlgo‑14B?
MorphoAlgo‑14B is a domain‑specialised large language model engineered by BlueMorpho Limited for quantitative analysis of the US stock market. It reasons over fundamentals, price history, and market structure, and answers with concrete numbers, periods, and explicit reasoning — not vague commentary.
MorphoAlgo‑14B is the result of a full, in‑house alignment pipeline developed end‑to‑end by BlueMorpho: a large‑scale quantitative pretraining corpus, a supervised instruction stage, a preference‑optimisation stage, verification, and consumer‑deployable quantised exports.
📊 Results at a glance
| Stage | Key metric | Result |
|---|---|---|
| SFT | steps · epochs · supervised tokens | 6,126 · 2 · 29,551,965 |
| SFT | final eval loss · token accuracy | 0.334 · 88.2 % |
| DPO | steps · preference pairs | 1,583 · 25,844 |
| DPO | eval loss · reward accuracy · reward margin | 4.58 e‑05 · 100 % · 13.33 |
| Merge | artefact | 14B dense (bf16) |
| Verification | grounding tests passed | 3 / 3 |
| GGUF | f16 · Q5_K_M · Q4_K_M | 29.54 · 10.51 · 9.00 GB |
| Distill | student | 3B (in progress) |
🧠 The full training pipeline
1️⃣ Stage 2 — Supervised Fine‑Tuning
The model is fine‑tuned to behave as a disciplined quantitative analyst: it reads a market question, selects the relevant metrics, and answers with grounded figures.
| Metric | Value |
|---|---|
| Optimization steps | 6,126 |
| Epochs | 2 |
| Supervised tokens | 29,551,965 |
| Final eval loss | 0.334 |
| Final token accuracy | 88.2 % |
| Eval entropy | 0.330 |
| Best checkpoint | step 6,126 |
The training loss falls smoothly from ~2.8 to ~0.33 and the eval loss tracks it without divergence — a clean, well‑conditioned supervised fit.
2️⃣ Stage 3 — Direct Preference Optimisation
A calibrated DPO stage sharpens answer quality, teaching the model to prefer truthful, precisely‑scoped analysis over plausible‑but‑wrong commentary.
| Metric | Start (step 200) | End (step 1,583) |
|---|---|---|
| Reward margin | 10.61 | 13.33 |
| Eval loss | 5.51 e‑04 | 4.58 e‑05 |
| Reward accuracy | 100 % | 100 % |
| Token accuracy | 73.9 % | 74.0 % |
| Entropy | 0.460 | 0.434 |
| Chosen reward | −4.10 | −5.63 |
| Rejected reward | −14.71 | −18.96 |
Full evaluation trajectory
All eight evaluation checkpoints, straight from the training log:
The preference margin climbs monotonically while policy entropy decreases only slightly (0.460 → 0.434) — the signature of a healthy, non‑collapsing DPO run. The model learns to separate good from bad answers without degenerating into a brittle, low‑entropy policy.
📚 Data at the heart of MorphoAlgo
MorphoAlgo‑14B is trained on two purpose‑built datasets covering the US equities universe.
| Dataset | Size | Tokens |
|---|---|---|
| SFT instruction corpus | 98,000 train / 2,000 valid examples | 29.55 M |
| DPO preference pairs (v2) | 25,327 train / 517 valid pairs | 6.02 M |
The preference set is built around a deliberate error taxonomy — the five failure modes a quantitative analyst must avoid:
| Failure mode | Pairs |
|---|---|
| Swapped / mis‑applied metric | 7,751 |
| Over‑confident claim | 5,239 |
| Subtle causal error | 5,194 |
| Plausible but wrong numbers | 4,870 |
| Wrong directional call | 2,790 |
Underlying corpora: 10,426 US tickers of full daily OHLCV, 27,226,054 SEC EDGAR filing rows (1993 → 2026), and 8,020 XBRL company‑fact sets.
✅ Stage 5 — Verification
Every deployable artefact is verified before release.
- Greedy grounding tests: 3/3 analyst prompts (AAPL, NVDA, MSFT) produced numeric,
period‑grounded answers under
do_sample=False. - GGUF integrity: all three exports carry a valid
GGUFv3 header and re‑load and generate correctly on GPU. - Provenance: none of the published model cards name an upstream base model.
🎓 Stage 7 — Distillation
The distillation stage produces a lighter 3B student that retains the teacher's analytical behaviour for latency‑ and cost‑sensitive deployment.
🚀 Quick start
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "bluemorpholimited/morphoalgo-usstock-14b"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype="bfloat16")
sys = ("You are MorphoAlgo, an expert quantitative analyst specialising in the US stock market. "
"Answer precisely with concrete numbers, periods, and clear reasoning.")
q = "Analyse AAPL between 2019-01-02 and 2020-01-02 and summarise the move."
msgs = [{"role": "system", "content": sys}, {"role": "user", "content": q}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=256, do_sample=False)
print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))
Quantised / consumer deployment
For GGUF builds (llama.cpp, Ollama, LM Studio, llama‑cpp‑python), see bluemorpholimited/morphoalgo-usstock-14b-gguf.
📦 Model family
| Repository | What it is |
|---|---|
morphoalgo-usstock-14b |
merged, deployable model (this repo) |
morphoalgo-usstock-14b-sft |
SFT stage adapter |
morphoalgo-usstock-14b-dpo |
DPO stage adapter |
morphoalgo-usstock-14b-gguf |
GGUF f16 / Q5_K_M / Q4_K_M |
morphoalgo-usstock-dataset |
SFT + DPO training datasets |
⚠️ Limitations & responsible use
- Not investment advice. MorphoAlgo‑14B produces historical, analytical commentary. It does not predict markets and must not be used as the sole basis for trading decisions.
- Verify before acting. Always validate any figure against a primary market‑data source.
- US‑listed equities focus. Coverage of OTC, illiquid, or newly listed instruments is limited.
📜 Licence
Released under the BlueMorpho Commercial Licence. For licensing, evaluation, and enterprise deployment support, contact the BlueMorpho Limited Quantitative Intelligence Division.
BlueMorpho Limited · Quantitative Intelligence Division
Precision. Grounding. Market intelligence.
- Downloads last month
- 5







