Text Generation
Transformers
Safetensors
English
gemma4
image-text-to-text
project-controls
earned-value-management
forecasting
lora
distillation
code-action
agent
slipstream
conversational
Instructions to use build-small-hackathon/slipstream-gemma4-e2b-evm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use build-small-hackathon/slipstream-gemma4-e2b-evm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="build-small-hackathon/slipstream-gemma4-e2b-evm") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("build-small-hackathon/slipstream-gemma4-e2b-evm") model = AutoModelForMultimodalLM.from_pretrained("build-small-hackathon/slipstream-gemma4-e2b-evm") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use build-small-hackathon/slipstream-gemma4-e2b-evm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "build-small-hackathon/slipstream-gemma4-e2b-evm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "build-small-hackathon/slipstream-gemma4-e2b-evm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/build-small-hackathon/slipstream-gemma4-e2b-evm
- SGLang
How to use build-small-hackathon/slipstream-gemma4-e2b-evm 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 "build-small-hackathon/slipstream-gemma4-e2b-evm" \ --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": "build-small-hackathon/slipstream-gemma4-e2b-evm", "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 "build-small-hackathon/slipstream-gemma4-e2b-evm" \ --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": "build-small-hackathon/slipstream-gemma4-e2b-evm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use build-small-hackathon/slipstream-gemma4-e2b-evm with Docker Model Runner:
docker model run hf.co/build-small-hackathon/slipstream-gemma4-e2b-evm
Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gemma
|
| 3 |
+
base_model: google/gemma-4-E2B-it
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
datasets:
|
| 9 |
+
- build-small-hackathon/slipstream-evm-sft
|
| 10 |
+
tags:
|
| 11 |
+
- project-controls
|
| 12 |
+
- earned-value-management
|
| 13 |
+
- forecasting
|
| 14 |
+
- lora
|
| 15 |
+
- distillation
|
| 16 |
+
- code-action
|
| 17 |
+
- agent
|
| 18 |
+
- slipstream
|
| 19 |
+
---
|
| 20 |
+
# Slipstream - gemma-4-E2B (EVM forecasting agent)
|
| 21 |
+
|
| 22 |
+
A small **code-action agent** that forecasts a project's final cost (EAC) and finish period from a
|
| 23 |
+
mid-flight Earned Value Management snapshot. It is **`google/gemma-4-E2B-it`** (E2B (~2B effective),
|
| 24 |
+
Gemma-4 (text decoder)) fine-tuned (LoRA, then merged) to run a single-tool reasoning loop: it writes Python
|
| 25 |
+
that calls a curated forecasting toolkit (Earned Schedule, CPI/SPI formulas, a Gompertz growth
|
| 26 |
+
curve, a reference-class ML regressor, and the TimesFM / Chronos time-series foundation models),
|
| 27 |
+
reconciles their disagreeing estimates, and submits one answer.
|
| 28 |
+
|
| 29 |
+
It was **distilled from a DeepSeek V4 teacher**: the teacher's reasoning traces over a diverse
|
| 30 |
+
simulated project corpus were filtered to a 367-trace SFT set
|
| 31 |
+
([`build-small-hackathon/slipstream-evm-sft`](https://huggingface.co/datasets/build-small-hackathon/slipstream-evm-sft)) and the student trained with
|
| 32 |
+
assistant-only loss (reasoning + tool-call tokens only). This makes a sub-5B, **edge / air-gapped**
|
| 33 |
+
forecaster that matches the classical project-controls baseline and approaches its cloud teacher.
|
| 34 |
+
|
| 35 |
+
## Results (held-out real projects, 40% complete, n=107)
|
| 36 |
+
|
| 37 |
+
Scored on 107 real completed projects (Batselier/OR-AS DSLIB), apples-to-apples with every
|
| 38 |
+
baseline. `valid` = produced a usable forecast; `EAC error` = median absolute % error on final cost;
|
| 39 |
+
`finish error` = median absolute error in periods.
|
| 40 |
+
|
| 41 |
+
| Method | valid | EAC error | finish error |
|
| 42 |
+
| --- | --- | --- | --- |
|
| 43 |
+
| **gemma-4-E2B (this model, distilled)** | **0.991** | **2.31%** | **0.63 periods** |
|
| 44 |
+
| gemma-4-E2B (base, before distillation) | 0.664 | 3.21% | 0.75 periods |
|
| 45 |
+
| Earned Schedule (classical baseline) | 1 | 2.37% | 1 periods |
|
| 46 |
+
| DeepSeek V4 teacher (cloud) | 1 | 2.4% | 0.6 periods |
|
| 47 |
+
|
| 48 |
+
Distillation lifts a base model that could barely operate the tool-call format into a reliable
|
| 49 |
+
forecaster that rivals the classical canon and its own teacher.
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 55 |
+
|
| 56 |
+
repo = "build-small-hackathon/slipstream-gemma4-e2b-evm"
|
| 57 |
+
tok = AutoTokenizer.from_pretrained(repo)
|
| 58 |
+
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="bfloat16")
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
The model is trained to act through a single `run_python(code=...)` tool call and to call
|
| 62 |
+
`submit(finish, eac)` from inside that code. See the Slipstream project for the agent loop, the
|
| 63 |
+
forecasting toolkit, and the full benchmark.
|
| 64 |
+
|
| 65 |
+
## Licence and attribution
|
| 66 |
+
|
| 67 |
+
This is a derivative of **[`google/gemma-4-E2B-it`](https://huggingface.co/google/gemma-4-E2B-it)** and is released
|
| 68 |
+
under the **base model's licence** (gemma).
|
| 69 |
+
You must comply with the upstream terms.
|
| 70 |
+
Training data: [`build-small-hackathon/slipstream-evm-sft`](https://huggingface.co/datasets/build-small-hackathon/slipstream-evm-sft).
|
| 71 |
+
|
| 72 |
+
Built for the Hugging Face **Build Small** hackathon.
|