Instructions to use FWKV/Myosotis-1-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FWKV/Myosotis-1-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FWKV/Myosotis-1-base", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FWKV/Myosotis-1-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FWKV/Myosotis-1-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FWKV/Myosotis-1-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FWKV/Myosotis-1-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FWKV/Myosotis-1-base
- SGLang
How to use FWKV/Myosotis-1-base 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 "FWKV/Myosotis-1-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FWKV/Myosotis-1-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "FWKV/Myosotis-1-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FWKV/Myosotis-1-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FWKV/Myosotis-1-base with Docker Model Runner:
docker model run hf.co/FWKV/Myosotis-1-base
Myosotis-1-base (100M)
Myosotis-1-base is the first flagship release from us, introducing a 100-million parameter recurrent language model built on the FWKV architecture.
Myosotis-1 is engineered to never truly forgetβusing a mathematically clamped exponential decay that guarantees an infinite effective context window while maintaining blazing-fast inference on consumer hardware.
Architecture at a Glance
Myosotis-1 occupies a unique position in the sequence modeling spectrum: it acts as a pristine mathematical bridge between Linear State Space Models (S4/S5) and the WKV (RWKV) gating paradigm.
| Component | Specification |
|---|---|
| Type | Diagonal LTI (Linear Time-Invariant) SSM + RWKV-style Gating |
| Total Parameters | ~100 Million |
Hidden Dimension (d_model) |
768 |
Embedding Bottleneck (d_emb) |
192 |
Layers (n_layers) |
13 |
| FFN Expansion Factor | 4Γ (GELU activation) |
| Context Length | 1024 tokens (packed training) |
| Vocabulary | 50,257 (GPT-2 tokenizer |
| Weight Tying | Fully tied, factorized input/output head |
Core Technical Innovations
1. The FWKV Recurrent Core
Instead of pairwise attention, Myosotis uses a fixed-size state vector updated via a gated linear recurrence:
- is a learned, constant-per-channel decay.
- By clamping the minimum decay to 0.1, the model guarantees that past information decays exponentially but never reaches zero.
2. Training via Parallel Scan
Because is data-independent (LTI), the recurrence can be trained using a pure-PyTorch Hillis-Steele associative scan. This bypasses the sequential bottleneck of RNNs without requiring custom CUDA kernels, making the architecture trivially portable across NVIDIA, AMD, Apple Silicon, and standard CPUs.
3. Factorized Tied Embeddings
We employ a low-rank factorization for the embedding layer:
- Stored weight shape: (vs. standard ), with a learned linear projection mapping inputs up to the full hidden dimension before the first block, and back down to for the final logits (so the internal representation remains ).
- This saves parameters (~15 million in our setup) while maintaining full representational capacity.
- The output head uses the transposed projection, enabling chunked cross-entropy loss to avoid materializing huge logit tensors during training.
4. Loss Masking for Conversational AI
Fine-tuned exclusively on multi-turn chat data, the loss is masked so that only assistant tokens contribute to the gradient. This forces the model to master response generation while treating user prompts purely as contextual memory.
Training Regimen
Myosotis-1 was trained in two distinct stages, leveraging the Chinchilla scaling law (20Γ parameter count in tokens) for optimal performance.
Stage 1: Pretraining (General Language)
- Data Mixture (SmolLM-Corpus style):
- 60%
fineweb-edu-dedup(educational web text) - 25%
cosmopedia-v2(synthetic textbooks) - 15%
python-edu(code understanding)
- 60%
- Total Tokens: ~2 Billion (Chinchilla-optimal)
- Optimizer: AdamW (fused),
- Precision: BF16 Mixed Precision with Gradient Checkpointing
Val perplexity at save time: 62.76
Performance & Speed
Myosotis-1 is optimized for hardware portability over pure theoretical FLOPs. It achieves this by avoiding data-dependent (selective) gating, allowing pure vectorized operations.
- Inference Style: True RNN. No growing KV cache. Constant memory usage .
- CPU Speed : ~[...] tokens/second (pure PyTorch, no custom kernels).
- GPU Speed : ~130 tokens/second with BF16.
While we sacrifice the "selectivity" of models like Mamba, we gain the ability to run effectively on devices where CUDA is unavailable (edge devices, free-tier cloud notebooks, and standard servers).
Evaluation
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | ||
|---|---|---|---|---|---|---|---|---|
| arc_challenge | 1 | none | 0 | acc | β | 0.1664 | Β± | 0.0109 |
| none | 0 | acc_norm | β | 0.2159 | Β± | 0.0120 | ||
| arc_easy | 1 | none | 0 | acc | β | 0.3864 | Β± | 0.0100 |
| none | 0 | acc_norm | β | 0.3434 | Β± | 0.0097 | ||
| hellaswag | 1 | none | 0 | acc | β | 0.2621 | Β± | 0.0044 |
| none | 0 | acc_norm | β | 0.2579 | Β± | 0.0044 | ||
| piqa | 1 | none | 0 | acc | β | 0.5756 | Β± | 0.0115 |
| none | 0 | acc_norm | β | 0.5533 | Β± | 0.0116 |
Not the best results, we blame the dataset.
Usage Example
Myosotis-1 is fully compatible with the HuggingFace transformers library.
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("FWKV/Myosotis-1-base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("FWKV/Myosotis-1-base", trust_remote_code=True)
inputs = tok("The quick brown fox", return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=150, use_cache=True)
print(tok.decode(out[0]))
Strengths & Limitations
| Strengths | Limitations |
|---|---|
| Blazing Fast CPU Inference: [..] tokens/sec on cheap cloud instances. | Non-Selective Decay: Less mathematically expressive than Mamba or RWKV-v5. |
| Infinite Context Memory: Clamped decay ensures no hard cutoff. | Factual Hallucination: As a 100M model, fact-retrieval is limited. |
| No Custom Kernels: Runs anywhere PyTorch runs (AMD, Intel, ARM). | No Token-Shift: Lacks the strong local inductive bias of full RWKV. |
| Memory Efficient: Constant-size state, scales perfectly with sequence length. | Knowledge Capacity: Smaller than billion-parameter counterparts. |
| Stable Training: Clamped sigmoid prevents vanishing/exploding gradients. | ROSA Not Included: This is the base recurrent model, separate from the FWKV-ROSA research paper. |
Technical References
- Inspirations: RWKV (Peng et al.), S4/S5 (Gu et al.), and the Transformer FFN sandwich.
Licensing & Acknowledgements
License: Apache 2.0
This model is dedicated to the open-source community. Built by Daniel B. (FlameF0X) using vast.ai, PyTorch, and the Hugging Face ecosystem.
- Downloads last month
- 371