Text Generation
Transformers
Safetensors
English
nexus
small-language-model
instruct
smoltalk
conversational
custom_code
Instructions to use ifx-pse-sys-ml/flame-27m-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ifx-pse-sys-ml/flame-27m-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ifx-pse-sys-ml/flame-27m-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ifx-pse-sys-ml/flame-27m-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ifx-pse-sys-ml/flame-27m-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ifx-pse-sys-ml/flame-27m-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ifx-pse-sys-ml/flame-27m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ifx-pse-sys-ml/flame-27m-instruct
- SGLang
How to use ifx-pse-sys-ml/flame-27m-instruct 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 "ifx-pse-sys-ml/flame-27m-instruct" \ --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": "ifx-pse-sys-ml/flame-27m-instruct", "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 "ifx-pse-sys-ml/flame-27m-instruct" \ --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": "ifx-pse-sys-ml/flame-27m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ifx-pse-sys-ml/flame-27m-instruct with Docker Model Runner:
docker model run hf.co/ifx-pse-sys-ml/flame-27m-instruct
Card: document generation parameters (repetition_penalty, no_repeat_ngram_size, temperature, top_p, max_new_tokens) + overrides
Browse files
README.md
CHANGED
|
@@ -43,6 +43,38 @@ The decoder also accepts `inputs_embeds` (exactly one of `input_ids` / `inputs_e
|
|
| 43 |
vision projector can splice visual tokens in — usable as a small VLM text backbone. A raw
|
| 44 |
PyTorch checkpoint (`pytorch_model.pth`) is included alongside the safetensors weights.
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
## Benchmarks
|
| 47 |
|
| 48 |
Accuracy (%) via [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness)
|
|
|
|
| 43 |
vision projector can splice visual tokens in — usable as a small VLM text backbone. A raw
|
| 44 |
PyTorch checkpoint (`pytorch_model.pth`) is included alongside the safetensors weights.
|
| 45 |
|
| 46 |
+
## Generation parameters
|
| 47 |
+
|
| 48 |
+
The repo ships sensible defaults in `generation_config.json`, so a bare
|
| 49 |
+
`model.generate(ids)` already applies them — you don't need to pass anything. At **27M
|
| 50 |
+
parameters** the model can loop across sentences, so the defaults enable repetition control:
|
| 51 |
+
|
| 52 |
+
| Parameter | Default | What it does / when to change |
|
| 53 |
+
|---|---|---|
|
| 54 |
+
| `repetition_penalty` | `1.3` | Penalises tokens already generated. **The main lever against this model's multi-sentence looping.** Try `1.1`–`1.4`; `1.0` disables it (you'll see more repetition); >`1.5` starts to sound unnatural. |
|
| 55 |
+
| `no_repeat_ngram_size` | `3` | Hard-blocks any 3-gram from repeating. Belt-and-braces with `repetition_penalty`. Set `0` to disable, `2` for stricter (can hurt fluency on short replies). |
|
| 56 |
+
| `temperature` | `0.7` | Sampling randomness. Lower (`0.3`–`0.5`) = more focused/repetitive; higher (`0.9`–`1.1`) = more varied but more likely to go off-topic at this size. |
|
| 57 |
+
| `top_p` | `0.9` | Nucleus sampling cutoff. Lower (`0.8`) tightens word choice; `1.0` allows the full distribution. |
|
| 58 |
+
| `max_new_tokens` | `200` | Length cap. This model is strongest in **short** replies; long generations drift — keep it small (`64`–`200`) for best quality. |
|
| 59 |
+
| `do_sample` | `True` | `False` = deterministic greedy decoding (reproducible; combine with `repetition_penalty` to avoid greedy loops). |
|
| 60 |
+
|
| 61 |
+
Override any of them per call to experiment:
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
out = model.generate(
|
| 65 |
+
ids,
|
| 66 |
+
max_new_tokens=120,
|
| 67 |
+
do_sample=True,
|
| 68 |
+
temperature=0.6, # more focused
|
| 69 |
+
top_p=0.9,
|
| 70 |
+
repetition_penalty=1.2, # tune 1.0 (off) – 1.4
|
| 71 |
+
no_repeat_ngram_size=3, # 0 to disable
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
# Deterministic (greedy) — still repetition-guarded:
|
| 75 |
+
out = model.generate(ids, max_new_tokens=120, do_sample=False, repetition_penalty=1.3)
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
## Benchmarks
|
| 79 |
|
| 80 |
Accuracy (%) via [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness)
|