File size: 2,421 Bytes
bc26096
 
44638a2
 
 
 
 
 
 
 
 
 
 
bc26096
44638a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
license: apache-2.0
library_name: pytorch
pipeline_tag: image-text-to-text
tags:
- multimodal
- vision-language-model
- tool-calling
- function-calling
- structured-outputs
- json-mode
- from-scratch
- cloud-ops
---

# MicroOps-VLM (9.46M Parameters, Trained 100% From Scratch)

**MicroOps-VLM** is a compact, educational, domain-specific multimodal Vision-Language Model (~9.46M parameters) built and trained **100% from scratch** on a single NVIDIA T4 GPU (Google Colab Free Tier).

It inspects synthetic `64x64` RGB server telemetry dashboards (and text instructions), follows system-prompt policies, outputs strict JSON, and performs tool calling inside a **768-token context window**.

## Model Architecture & Metrics
- **Parameters:** 9.46M (tied token embedding & LM head)
- **Context Window:** 768 tokens (Rotary Position Embeddings / RoPE)
- **LLM Backbone:** 6-layer Causal Transformer (`d_model=320`, `n_heads=8`, `d_ff=864`), RMSNorm, SwiGLU, PyTorch SDPA
- **Vision Encoder:** 5-layer GroupNorm CNN stem mapping `64x64` RGB telemetry dashboards into 16 visual patch embeddings + MLP projector
- **Tokenizer:** Custom UTF-8 byte-level + 18 structured control tokens (`vocab_size=288`)
- **Held-Out Eval (50 unseen samples):**
  - Validation Loss: 0.0009
  - Valid JSON Rate: **100.0% (50/50)**
  - Exact Turn-1 Accuracy: **100.0% (50/50)**

## Limitations & Intended Use
This model is an educational architecture demo trained on synthetic `64x64` telemetry dashboards and Cloud Ops tool prompts. It is **not** intended for open-world chat, natural photographs, or production infrastructure control.

## Quickstart Usage
```python
from huggingface_hub import hf_hub_download
import importlib.util

mod_path = hf_hub_download(repo_id="Newone0/MicroOps-VLM", filename="modeling_microops.py")
spec = importlib.util.spec_from_file_location("modeling_microops", mod_path)
modeling = importlib.util.module_from_spec(spec)
spec.loader.exec_module(modeling)

model, tok, cfg = modeling.from_pretrained_hf("Newone0/MicroOps-VLM", device="cpu")

prompt = tok.build_prompt(
    system_prompt="You are MicroOps, an autonomous SRE agent. Tools: restart_service, scale_cluster, create_ticket, query_metrics. Respond with JSON tool calls.",
    user_prompt="Scale cluster in us-west to 5 replicas.",
    has_image=False,
)
out_ids = model.generate_turn(prompt, image=None, temperature=0.0)
print(tok.decode(out_ids))
```