Instructions to use Aobangaming/luna-1.5-flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Aobangaming/luna-1.5-flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Aobangaming/luna-1.5-flash", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Aobangaming/luna-1.5-flash", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Aobangaming/luna-1.5-flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Aobangaming/luna-1.5-flash" # 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-1.5-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Aobangaming/luna-1.5-flash
- SGLang
How to use Aobangaming/luna-1.5-flash 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-1.5-flash" \ --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-1.5-flash", "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-1.5-flash" \ --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-1.5-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Aobangaming/luna-1.5-flash with Docker Model Runner:
docker model run hf.co/Aobangaming/luna-1.5-flash
Model Card for Model ID
Model Details
We introduce LUNA, a small, autoregressive transformer. This model aims to provide conversational-like chat without overloading the computer. This model is designed to run on small hardware, such as phones or office computers.
- Model creator: AobanZ
Model Description
Luna utilizes FlashAttention and AdamW for performance and capability. Lightning is designed to provide quick, coherent outputs, improved with a larger size and weight.
- Developed by: AobanZ
- Model type: Transformer
- Language(s) (NLP): English
- License: MIT
Model Sources
Uses
Luna is intended to be used for research, analysis and fine-tuning, general conversation, stories and other. It is not intended to be used for professional advice, real writing or any kind of heavy work as generated outputs may be incorrect.
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 research and experimentation. Outputs may be incomplete, inaccurate, repetitive, or unrelated to the input, and should be evaluated before being used for other purposes.
Downstream Use
Luna may be fined-tuned for a AI Character, AI Agents, and chat models. However, please note that generated outputs may be corrupted and/or incorrect.
Out-of-Scope Use
Heavy Work may overload the model, which will cause corrupted outputs and/or misinformation if implemented into a larger-app/ecosystem.
Bias, Risks, and Limitations
Lightning is designed to process english and conversational text ONLY and cannot be fined-tuned for any other uses(eg. Robotics)
Recommendations
We recommend users of Lightning 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-1.5-flash"
path = hf_hub_download(model_id, "modeling_lightning.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 1.5 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=100,
device=device,
top_k=40,
top_p=0.6,
penalty=1.2,
temperature=0.8,
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 large dataset. It was not trained on fine-tuning datasets since memory issues.
Training Results
| Epoch | Loss | Perplexity |
|---|---|---|
| 1 | 6.13648 | 462.42 |
| 2 | 4.84533 | 127.15 |
| 3 | 4.17732 | 65.19 |
| 4 | 3.67652 | 39.51 |
| 5 | 3.27694 | 26.49 |
Training Hyperparameters
| Hyperparameter | Value | Comment |
|---|---|---|
| Precision | FP32 | |
| Optimizer | AdamW | |
| Learning rate | 5e-4 | |
| Batch size | 32 |
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: RTX 3050 6GB
- Hours used: 3
- Cloud Provider: AobanLabs
- Compute Region: Asia
- Carbon Emitted: ~0.17 kg CO₂e
Technical Specifications
Model Architecture and Objective
Luna uses a 6-layer causal Transformer with 256-dimensional hidden states and 4 attention heads. Each attention head has a dimension of 64.
The architecture uses pre-layer normalization, causal scaled dot-product attention, a 4× expansion GELU feed-forward network, sinusoidal positional encoding, and untied input/output embeddings.
| Hyperparameter | Value | Comment |
|---|---|---|
| Layers | 6 | |
| D_MODEL | 256 | Optimized for 64dim/head |
| Attention Heads | 4 | |
| Vocabulary | ~75003 | w/ 200 Sequence length |
Benchmarks
Aoban Luna 1.5 got a 15% benchmark in a custom-made benchmark generated by AI.
Compute Infrastructure
Hardware
The model was trained on a RTX 3050 6GB paired with a UHD Graphics 630.
Software
Windows 11, Intel i5-10400
- Downloads last month
- -
Model tree for Aobangaming/luna-1.5-flash
Base model
Aobangaming/lightning-30m-ft