Instructions to use Aobangaming/luna-2.1-230m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Aobangaming/luna-2.1-230m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Aobangaming/luna-2.1-230m", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Aobangaming/luna-2.1-230m", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Aobangaming/luna-2.1-230m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Aobangaming/luna-2.1-230m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aobangaming/luna-2.1-230m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Aobangaming/luna-2.1-230m
- SGLang
How to use Aobangaming/luna-2.1-230m 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 "Aobangaming/luna-2.1-230m" \ --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": "Aobangaming/luna-2.1-230m", "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 "Aobangaming/luna-2.1-230m" \ --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": "Aobangaming/luna-2.1-230m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Aobangaming/luna-2.1-230m with Docker Model Runner:
docker model run hf.co/Aobangaming/luna-2.1-230m
Luna 2 Model Card
Model Information
- Model creator: AobanZ
Description
Luna is our family of next generation models, being able to run on almost any device. Luna has a 256 token context window, and is well suited for short and quick tasks.
- Developed by: AobanZ
- Model type: Transformer
- Language(s) (NLP): English
- License: MIT
Model Sources
- Repository: https://huggingface.co/Aobangaming/luna-2-70m
Uses
Luna is intended to be used for research, analysis and fine-tuning, general conversation, stories and other.
Direct Use
Luna can be used directly for text generation, experimentation, and conversational interactions. Users can provide text prompts and generate responses using the model's built-in language modeling capabilities. Direct use is primarily intended for casual conversation, research and experimentation. Outputs may be incomplete, inaccurate, repetitive, or unrelated to the input, and should be evaluated before being used for other purposes.
Bias, Risks, and Limitations
Luna is designed to process english and conversational text ONLY and cannot be fined-tuned for any other uses(eg. Robotics) This model of Luna is biased to giving unfinished answers, and weak grammatical stability.
Recommendations
We recommend users of Luna to finetune the model on new text, and add necessary guardrails and precautions to prevent misuse.
How to Get Started with the Model
Use the code below to get started with the model.
import torch
from transformers import AutoModelForCausalLM
from tokenizers import Tokenizer
from huggingface_hub import hf_hub_download
import importlib.util
model_id = "Aobangaming/luna-2.1-230m"
path = hf_hub_download(model_id, "modeling_luna.py")
hf_hub_download(model_id, "configuration_luna.py")
spec = importlib.util.spec_from_file_location("lightning", path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
model = AutoModelForCausalLM.from_pretrained(
model_id, trust_remote_code=True
)
tokenizer = Tokenizer.from_file(
hf_hub_download(model_id, "luna_tokenizer.json")
)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = model.to(device)
history = []
print("Aoban Luna 2 Flash")
print("!clear = clear history | !exit = quit")
while True:
prompt = input("You: ").strip()
if prompt.lower() == "!exit":
break
if prompt.lower() == "!clear":
history.clear()
print("History cleared.")
continue
response = module.generate_text(
model,
tokenizer,
prompt,
max_len=1024,
device=device,
top_k=30,
top_p=0.6,
penalty=1.2,
temperature=1,
chat_history=history
)
print(f"Assistant: {response}")
history.extend([
{"role": "user", "content": prompt},
{"role": "assistant", "content": response}
])
Training Details
Training Data
Luna was trained a subset of the OASST dataset.
Training Procedure
Luna was trained on an RTX 3050 GPU, using FlashAttention/SDPA and MHA. The model was trained on a OpenAssistant. Loss ended at around 1.9.
Training Hyperparameters
| Hyperparameter | Value | Comment |
|---|---|---|
| Precision | BF16 | |
| Optimizer | AdamW | |
| Learning rate | 3e-4 | |
| Batch size | 17 |
Hardware & Infrastructure
- Hardware Type: RTX 3050 6GB
- Hours used: 5
- Cloud Provider: AobanLabs
- Compute Region: Asia
Technical Specifications
Model Architecture and Objective
Luna uses a 12-layer causal Transformer with 768-dimensional hidden states and 12 attention heads, with RMSNorm and RoPE.
| Hyperparameter | Value | Comment |
|---|---|---|
| Layers | 12 | |
| D_MODEL | 768 | |
| Attention Heads | 12 | |
| Vocabulary | ~100k | w/ 250 Sequence length |
- Downloads last month
- 165