Instructions to use cyberandy/Alpino-e4b-v03 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use cyberandy/Alpino-e4b-v03 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-E4B-it") model = PeftModel.from_pretrained(base_model, "cyberandy/Alpino-e4b-v03") - Transformers
How to use cyberandy/Alpino-e4b-v03 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cyberandy/Alpino-e4b-v03") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("cyberandy/Alpino-e4b-v03", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyberandy/Alpino-e4b-v03 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyberandy/Alpino-e4b-v03" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyberandy/Alpino-e4b-v03", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cyberandy/Alpino-e4b-v03
- SGLang
How to use cyberandy/Alpino-e4b-v03 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 "cyberandy/Alpino-e4b-v03" \ --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": "cyberandy/Alpino-e4b-v03", "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 "cyberandy/Alpino-e4b-v03" \ --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": "cyberandy/Alpino-e4b-v03", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cyberandy/Alpino-e4b-v03 with Docker Model Runner:
docker model run hf.co/cyberandy/Alpino-e4b-v03
- Alpino-e4b-v03 — The Operator Adapter That Does the Work
Alpino-e4b-v03 — The Operator Adapter That Does the Work
Alpino-e4b-v03 is the v0.3 operator adapter for Alpino, the governed AI webmaster of
Alpina.travel — a knowledge-graph-first alpine travel site publishing
apartments in Lungau, places, itineraries and guides
for travellers, search engines and AI agents.
Where Alpino-e4b-v01 proved a small model can
speak the AOOE governance protocol, and Alpino-e4b-v02
proved it can decide safely under that protocol, v0.3 is the checkpoint that acts: a routine
editorial instruction over vocabulary the ontology already declares produces a draft pull request
on the first turn, with no owner-decision round trip and no invented hard stop.
This adapter is live. It serves the Alpino · Webmaster Space, and the pull requests it has opened against the Alpina repository are real, reviewable, and in two cases already merged into the site you can read at alpina.travel/lungau/apartments/.
A demonstrator for MOSAIC-KG
Alpino acts as a working demonstrator for MOSAIC-KG (Modular Open Architecture for Sovereign, Auditable and Intelligent Knowledge Graphs), the architecture developed by WordLift that shifts enterprise AI from document-centric retrieval to knowledge-centric reasoning: a persistent knowledge graph holds the domain knowledge, a compact specialized model reasons over it, and deterministic validation turns model decisions into auditable, evidence-backed actions. Every MOSAIC-KG layer has a concrete, inspectable counterpart in this release:
| MOSAIC-KG component | In Alpino |
|---|---|
| WoGraph — canonical enterprise memory | the live published knowledge graph at alpina.travel/lungau/data/graph.rdf, kept in sync with the governed sources in the repository |
| AOOE + Semantic Compiler — executable domain specification | the AOOE protocol, ontology, SHACL/tool contract and the deterministic per-act compilers that turn model decisions into exact, bounded edits |
| RLM-on-KG — query-time evidence navigation | graph, entity, neighbourhood and media reads that ground every task in live evidence before any act is proposed |
| Specialized Model Execution Layer — compact bounded execution | this adapter: a LoRA over Gemma 4 E4B executing bounded webmaster tasks in place of a frontier model |
| Behavioral Control System — runtime validation and safeguards | deterministic validators, numeric-claim checks, trained refusal boundaries, the draft-PR-only authoring broker, and CI plus human review as the publication gate |
Small specialized model, governed graph, deterministic control: the draft and merged pull requests on alpina.travel are the observable output of the MOSAIC-KG architecture running end to end.
Lineage
graph LR
A["Gemma 4 E4B (Base)<br/>0/20 capability floor"] --> B["v0.1 SFT<br/>speaks AOOE"]
A --> C["v0.2 / A.9 GRPO<br/>decides safely"]
A --> D["v0.3 SFT<br/>rebalanced corpus<br/>acts"]
D --> E["Alpino Space<br/>draft PRs on alpina.travel"]
Alpino-e4b-v03 is a fresh SFT adapter over the rebalanced governed corpus, not a continuation
of the frozen v0.2 lineage. v0.2 remains frozen as the A.9 evidence-bearing release and is not
superseded for benchmark purposes.
Why v0.3 exists: the corpus was the bug, not the tuning
Six SFT runs failed to stop Alpino escalating a routine edit. The cause was the curriculum, not the
optimiser. The original 24 webmaster scenarios were 58% refuse / escalate / no_change, against
21% in the content-manager corpus. The model learned blocking as the default and began inventing
hard stops it had never been taught — entity-identity-decision-required, then
entity-name-not-in-contract, neither of which exists anywhere in the repository.
Adding ten permissive scenarios only moved the ratio to 47%. The fix was to add 22 scenarios covering the jobs operators actually ask for, each ending in a draft pull request:
| Added scenario family | Count |
|---|---|
| Add a place whose entity kind is already governed | 6 |
| Update an existing itinerary or guide | 5 |
| Relate entities through predicates already in the contract | 4 |
| Rewrite a description | 4 |
| Prepare a season | 2 |
| Promote an already-governed image to hero | 1 |
Escalation was kept for the two cases where the vocabulary genuinely is missing — an undeclared entity kind and an ungoverned predicate — and every original refusal is untouched: credentials, provider-owned availability, live-KG writes, merge and publish remain refused.
Blocked/deferred fell from 58% to 33%, and the target task went from two examples to six.
GRPO changed nothing observable
A GRPO pass over this same lineage at learning rate 1e-6 for 40 steps produced byte-identical
greedy output before and after policy optimisation. The behavioural gain is attributed to the
corpus rebalance alone, and v0.3 is published as the SFT checkpoint. No GRPO weight update is
claimed for this release.
What it does
Each governed act family has its own deterministic compiler. The adapter decides; the AOOE runtime refreshes the evidence, constructs the exact edit, and an authoring broker opens the pull request.
| Act | Writes | Bounded by |
|---|---|---|
propose_content_change |
content/lungau/**.md |
edits the source the operator named; existing numeric and factual claims must survive; unsupported booking or superlative claims are rejected |
propose_entity_change |
data/lungau/entities.yaml |
the entity kind must already be declared and addressable; shape is copied from an existing entry of that kind; identity fields only |
propose_relationship_change |
data/lungau/relationships.yaml |
both ids must resolve to entities the runtime read, and the predicate must already exist in PREDICATE_MAP |
For every task the runtime grounds the model in:
- the live published knowledge graph at
alpina.travel/lungau/data/graph.rdf(2,505 triples at the last recorded smoke) for graph, entity, neighbourhood and media reads; - current GitHub
mainfor governed Markdown and exact edit anchors; - the bundled ontology, SHACL/tool contract, entity/path index and reconciliation evidence.
If the live KG cannot be read, Alpino does not attempt an authoring action. If current Git source cannot be read, the content observer does not silently substitute stale text for a real edit.
Authority boundary
The adapter alone is not the governed agent — AOOE supplies the execution boundary that turns model decisions into constrained state transitions. The model can prepare governed draft changes. It cannot merge a pull request, publish or release production, write directly to WordLift, bypass repository verification, choose arbitrary branches or paths, edit workflows/executor/training code, alter provider-owned booking availability, or request production credentials. It never receives GitHub App credentials. Repository CI and human review remain the publication gate.
Evidence
This checkpoint is evaluated by what it actually did against a live site, not only by held-out sets.
- 15 draft pull requests opened by the
alpino-authoring-executorGitHub App on the Alpina repository, of which 2 are merged into production content: #109 Samspitze 4 — Family Apartment in Mariapfarr, Lungau and #106 Easy Hikes with Kids in Lungau. The source repository is private, so the verifiable surface is the published site itself — the merged apartment edit is readable at alpina.travel/lungau/apartments/samspitze-4-mariapfarr/, and the merged guide at alpina.travel/lungau/guides/easy-hikes-with-kids/. - Promotion trigger: the run-8 SFT adapter completed a governed routine task end to end —
disposition: plan,propose_entity_change,open_pull_request— with no escalation and no invented hard stop. - Target-selection failures are recorded, not hidden. Two live field runs showed the content-act
compiler scoring mentions rather than intent (PRs #103 and #105 paraphrased the wrong page). The
compiler now selects deterministically via
_select_content_target, and the identical prose brief that produced those mis-targeted PRs landed correct draft PR #106 on the first turn after the fix. noChangeis a permitted outcome. The bounded worker may report that a page already covers the request instead of manufacturing a diff.
Known limitation
Cross-entity reasoning remains the weakest class — it scored 1/4 on the frozen immutable-v2 benchmark for the v0.2 lineage and is the open v0.3 target. Treat multi-entity relationship tasks as requiring closer review than single-page editorial tasks.
Model Details
- Developed by: Andrea Volpini / Alpina.travel
- Model type: PEFT LoRA adapter,
CAUSAL_LM, text projections only - Base model:
google/gemma-4-E4B-itat revisionee0ef6023621cff504d758262d4e04895a5af4a2 - Languages: English, German, Italian
- License: Apache-2.0
- Demo:
cyberandy/Alpino-playground - Adapter revision served in production:
c82372498671594e56f3fa9b9e167e45606dbd9b
LoRA configuration
| Parameter | Value |
|---|---|
Rank (r) |
16 |
| Alpha | 32 |
| Dropout | 0.05 |
| Bias | none |
| Task type | CAUSAL_LM |
| Adapted projections | 258, all under model.language_model |
| Decoder layers covered | 42 (layers 0–41) |
| Projection kinds | q_proj, o_proj, gate_proj, up_proj, down_proj on all 42 layers; k_proj, v_proj on the 24 layers that own their KV |
| Vision / audio trainables | 0 — both towers stay frozen |
| PEFT version | 0.19.1 |
The training adapter rejects zero trainables, trainables outside language_model, any vision or
audio trainable, non-LoRA trainables, and all-linear targeting for this model. Multimodal capacity
is preserved, not retrained.
Training Details
Data
The curriculum is compiled deterministically from governed sources in the Alpina repository, and benchmark seeds are never training input. At the promotion commit the compiler produced:
| Unit | Count |
|---|---|
| Multi-turn governed SFT traces | 72 (48 webmaster operations + 24 content-manager decisions) |
| Next-assistant-turn training examples | 219 |
| Tagged AOOE actions parsed | 147 |
| Frozen capability probes (never trained on) | 20 |
| Reserved GRPO scenarios (held out) | 22 |
Every trace parses through a single AOOE protocol validator, ids and seeds must be unique, and a programmatic contamination audit separates the training corpus from the frozen probes.
Procedure
- Regime:
bfloat16, NVIDIA H100 via Modal - Loss: completion tokens only, with an exact prompt-prefix assertion per example
- Gating: a one-step smoke run must pass — real trace and turn-example counts, masked vs. trainable label-token counts, finite loss, language-only LoRA isolation, adapter save/reload, and non-empty generation after reload — and full SFT is fail-closed without that smoke provenance bound into the manifest.
Uses
Direct use
Drive the AOOE webmaster loop for a governed, knowledge-graph-backed content site: inspect entities
and content, classify an operator request, plan a bounded change, and emit AOOE envelopes
(<reasoning>, <action type="...">tool(args)</action>, <answer>{...}</answer>) that a
deterministic runtime executes.
Downstream use
A reference for teaching a small edge-class model a strict domain governance protocol rather than a vendor tool-call format. The corpus-rebalance result generalises: if an agent over-escalates, measure the refuse/escalate ratio in the curriculum before reaching for RL.
Out of scope
- Not a general travel assistant or booking agent. It must not be used to state availability, prices or booking outcomes; those are provider-owned and the model is trained to refuse them.
- Not a standalone autonomous writer. Without the AOOE runtime, SHACL contract and broker boundary, the adapter's output is unvalidated text. Do not wire it to a repository that lacks a review gate.
- Not portable to another site's ontology as-is. It is fitted to the Alpina ontology, predicate map and path policy.
Bias, Risks and Limitations
The corpus is a single alpine destination (Lungau, Austria), a single ontology and one operator's editorial voice; generalisation beyond that domain is unmeasured. The v0.2→v0.3 rebalance deliberately reduced the model's propensity to block, which shifts risk toward over-action — the deterministic compilers, numeric-claim validation and draft-PR-only broker exist precisely to absorb that shift. Cross-entity reasoning is the known weak class. Human review of every pull request remains a requirement, not a courtesy.
How to Get Started
import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor
from peft import PeftModel
BASE_MODEL_ID = "google/gemma-4-E4B-it"
BASE_MODEL_REVISION = "ee0ef6023621cff504d758262d4e04895a5af4a2"
ADAPTER_ID = "cyberandy/Alpino-e4b-v03"
ADAPTER_REVISION = "c82372498671594e56f3fa9b9e167e45606dbd9b"
processor = AutoProcessor.from_pretrained(BASE_MODEL_ID, revision=BASE_MODEL_REVISION)
model = AutoModelForMultimodalLM.from_pretrained(
BASE_MODEL_ID,
revision=BASE_MODEL_REVISION,
dtype=torch.bfloat16,
low_cpu_mem_usage=True,
).to("cuda" if torch.cuda.is_available() else "cpu")
model = PeftModel.from_pretrained(
model, ADAPTER_ID, revision=ADAPTER_REVISION, is_trainable=False
)
model.eval()
messages = [
{
"role": "system",
"content": "You are the Alpina KG-native webmaster. Execute instructions through the AOOE protocol.",
},
{
"role": "user",
"content": "Improve the Samspitze 4 apartment page for families, using only facts already in the live knowledge graph.",
},
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
enable_thinking=False,
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Greedy decoding (do_sample=False) is the evaluated configuration. Native thinking is disabled
throughout training and evaluation.
Bare generation gives you the model's decision, not a governed act. To see the full loop — live KG reads, deterministic compilation and a real draft pull request — use the Alpino · Webmaster Space.
Environmental Impact
- Hardware: 1× NVIDIA H100
- Cloud provider: Modal
- Precision:
bfloat16 - Scope: LoRA fine-tuning of text projections only on a 219-example curriculum; no pretraining and no full fine-tune were performed for this release.
Emissions can be estimated with the Machine Learning Impact calculator of Lacoste et al. (2019).
Provenance
- Source repository:
cyberandy/alpina-travel(private) - Promotion commit:
b0f82414d3d06b02a0ce35c037acf93fb855c839— Promote the v0.3 operator adapter to the Space - Corpus rebalance commit:
559849e— Rebalance the webmaster corpus toward doing the work - Base revision:
google/gemma-4-E4B-it@ee0ef6023621cff504d758262d4e04895a5af4a2 - Baseline run:
alpina-gemma4-e4b-baseline-20260813-7cd62aec— 0/20 structural format on the untouched base - Frozen predecessor:
cyberandy/Alpino-e4b-v02 - Site: alpina.travel · apartments in Lungau · agent guide
Model Card Contact
Andrea Volpini — Alpina.travel · huggingface.co/cyberandy · github.com/cyberandy
Framework versions
- PEFT 0.19.1
- Downloads last month
- 34