LisaMegaWatts commited on
Commit
03128a8
Β·
verified Β·
1 Parent(s): 7e8c519

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +54 -4
README.md CHANGED
@@ -1,10 +1,60 @@
1
  ---
2
  title: MonarchSLM
3
- emoji: πŸ‘€
4
- colorFrom: gray
5
- colorTo: red
6
  sdk: docker
 
7
  pinned: false
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: MonarchSLM
3
+ emoji: "\U0001F451"
4
+ colorFrom: yellow
5
+ colorTo: purple
6
  sdk: docker
7
+ app_port: 7860
8
  pinned: false
9
+ license: mit
10
+ tags:
11
+ - julia
12
+ - lux
13
+ - slm
14
+ - philosophy
15
+ - openai-compatible
16
+ - bpe
17
+ - monarch-mixer
18
+ - rmsnorm
19
+ - swiglu
20
  ---
21
 
22
+ # MonarchSLM
23
+
24
+ A Monarch Mixer decoder-only model (sub-quadratic sequence mixing, RMSNorm, SwiGLU) trained on classical philosophy texts, implemented in Julia with Lux.jl. Serves an OpenAI-compatible API with streaming support.
25
+
26
+ ## Endpoints
27
+
28
+ - `GET /` β€” Health check and model info
29
+ - `GET /v1/models` β€” List available models
30
+ - `POST /v1/chat/completions` β€” Generate text (supports streaming, top-k, top-p)
31
+
32
+ ## Usage
33
+
34
+ ```bash
35
+ # Non-streaming
36
+ curl -X POST https://your-space.hf.space/v1/chat/completions \
37
+ -H "Content-Type: application/json" \
38
+ -d '{"messages": [{"role": "user", "content": "the nature of"}], "max_tokens": 200}'
39
+
40
+ # Streaming
41
+ curl -X POST https://your-space.hf.space/v1/chat/completions \
42
+ -H "Content-Type: application/json" \
43
+ -d '{"messages": [{"role": "user", "content": "the nature of"}], "stream": true, "temperature": 0.7, "top_k": 40}'
44
+ ```
45
+
46
+ ## Architecture
47
+
48
+ - **Model**: ~5M params, 256d embed, 8 layers, 8 Monarch heads
49
+ - **Sequence mixing**: Multi-head Monarch Matrix (sub-quadratic) + Causal Depthwise Conv + Learned Gate
50
+ - **Tokenizer**: BPE (2000 tokens)
51
+ - **Framework**: Lux.jl (explicit parameter/state management)
52
+ - **Normalization**: RMSNorm (pre-norm)
53
+ - **Feed-forward**: SwiGLU activation
54
+ - **Weight tying**: Shared embedding/output projection
55
+ - **Inference**: CPU-only, no Lux dependency at runtime (pure NNlib)
56
+
57
+ ## Environment Variables
58
+
59
+ - `HF_REPO` β€” HuggingFace model repo (default: `LisaMegaWatts/MonarchSLM`)
60
+ - `PORT` β€” Server port (default: `7860`)