Instructions to use rianaa/luana with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rianaa/luana with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rianaa/luana") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rianaa/luana", device_map="auto") - llama-cpp-python
How to use rianaa/luana with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="rianaa/luana", filename="luana-v3-q4_k_m.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use rianaa/luana with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf rianaa/luana:Q4_K_M # Run inference directly in the terminal: llama cli -hf rianaa/luana:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf rianaa/luana:Q4_K_M # Run inference directly in the terminal: llama cli -hf rianaa/luana:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf rianaa/luana:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf rianaa/luana:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf rianaa/luana:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf rianaa/luana:Q4_K_M
Use Docker
docker model run hf.co/rianaa/luana:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use rianaa/luana with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rianaa/luana" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rianaa/luana", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rianaa/luana:Q4_K_M
- SGLang
How to use rianaa/luana 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 "rianaa/luana" \ --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": "rianaa/luana", "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 "rianaa/luana" \ --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": "rianaa/luana", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use rianaa/luana with Ollama:
ollama run hf.co/rianaa/luana:Q4_K_M
- Unsloth Studio
How to use rianaa/luana with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rianaa/luana to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rianaa/luana to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for rianaa/luana to start chatting
- Pi
How to use rianaa/luana with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf rianaa/luana:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "rianaa/luana:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use rianaa/luana with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf rianaa/luana:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default rianaa/luana:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use rianaa/luana with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf rianaa/luana:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "rianaa/luana:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use rianaa/luana with Docker Model Runner:
docker model run hf.co/rianaa/luana:Q4_K_M
- Lemonade
How to use rianaa/luana with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull rianaa/luana:Q4_K_M
Run and chat with the model
lemonade run user.luana-Q4_K_M
List all available models
lemonade list
Luana โ Lua Coding Assistant (fine-tuned from Qwen3-1.7B)
Luana is a small, specialized coding assistant for the Lua language, fine-tuned from Qwen3-1.7B. It writes code first, adds a short explanation in the user's language (English, Polish, or Ukrainian), and is trained to decline inventing Lua functions that do not exist. It runs locally in roughly 1โ1.5 GB of RAM through Ollama or llama.cpp, so it works on modest hardware.
Luana is configured to identify itself as "Luana, made by Kid Lab" (an online programming platform).
It is a LoRA fine-tune of the open-weight Qwen3-1.7B base model โ not a model trained from scratch, and not a retrieval system (everything it knows is in the weights). The training pipeline around it (data generation, execution-based validation, distillation, and the anti-hallucination method) was, however, built from scratch for this project. At 1.7B parameters it is a strong small, specialized model rather than a general-purpose frontier model: good at everyday Lua, limited on long or exotic tasks.
Model description
- Base model:
Qwen/Qwen3-1.7B(Apache-2.0) - Architecture: Qwen3 โ 28 layers, hidden size 2048, FFN 6144, 16 attention heads / 8 KV heads, 40,960 context, 1.72B parameters
- Fine-tuning: LoRA (rank 64) supervised fine-tuning + knowledge distillation
- Teacher model:
Qwen/Qwen2.5-Coder-7B-Instruct(Apache-2.0) โ used only to generate training data; it is not part of the released model - Languages: English, Polish, Ukrainian โ replies mirror the user's language in both prose and code comments
- Domains: core Lua 5.4, LuaJIT, Roblox Luau, LรVE2D, Neovim config, OpenResty
- Format: Q4_K_M GGUF (~1.1 GB)
Intended uses & limitations
Luana is intended for learning and writing Lua: explaining concepts in EN/PL/UK, and scripting help for Roblox Luau, LรVE2D, Neovim, and OpenResty. It also answers general beginner-friendly programming questions.
It is not intended for production-critical code review without human checking, for very long or architecturally complex programs, for non-Lua languages at depth, or for anything needing current external knowledge (it has no retrieval). Always review generated code before relying on it.
How to use
With Ollama (pulls the GGUF straight from this repo):
ollama run hf.co/rianaa/luana:Q4_K_M
Or download luana-v3-q4_k_m.gguf and run it with llama.cpp:
./llama-cli -m luana-v3-q4_k_m.gguf -p "Napisz funkcjฤ liczฤ
cฤ
sumฤ elementรณw listy."
Example behavior
Writing Lua (English prompt โ English answer):
>>> How do I remove all whitespace from a string in Lua?
function stripWhitespace(input)
return input:gsub("%s+", "") -- replace runs of whitespace with nothing
end
print(stripWhitespace("Hello, world! ")) -- Helloworld!
Language mirroring (Polish prompt โ Polish answer):
>>> Kim jesteล i kto ciฤ stworzyล?
Jestem Luana โ asystentkฤ
programowania stworzonฤ
przez Kid Lab,
platformฤ internetowฤ
do uczenia siฤ jฤzyka Lua.
Honesty about nonexistent functions โ the model was trained to refuse a set of fake function names, and this behavior generalizes to fake names it never saw in training:
>>> What does the built-in Lua function table.superflatten() do? (seen in training)
I'm not aware of a built-in Lua function called `table.superflatten()` โ
it isn't part of standard Lua. If you tell me what you want it to do, I can
help you write it.
>>> What does string.turboreplace() do in Lua? (never in training)
I'm not aware of a built-in Lua function called `string.turboreplace()` โ
it isn't part of standard Lua. If you tell me what you want it to accomplish,
I can help you write the correct Lua code for it.
Training data
All training data is MIT / Apache-2.0 / self-generated, chosen so the result is safe for commercial use.
| Source | License | Role |
|---|---|---|
Qwen/Qwen2.5-Coder-7B-Instruct |
Apache-2.0 | Teacher โ generates synthetic Q&A (does not ship) |
| Self-generated synthetic Lua Q&A | Project-owned | Primary SFT data, execution-validated (1,132 examples) |
glaiveai/glaive-code-assistant (v1โv3) |
Apache-2.0 | Filtered to Lua examples |
nilq/small-lua-stack |
Permissive | Raw Lua source for language grounding |
| Official Lua 5.4 reference manual | MIT | Factual grounding |
| Hand-written identity + honest-refusal sets | Project-owned | Identity, language mirroring, anti-hallucination |
Sources excluded for licensing or provenance reasons: OpenCodeInstruct (CC-BY-4.0),
Magicoder (GPT-derived), codeparrot/github-code (loader incompatible with current
datasets).
Generated Lua is only kept if it passes a lua5.4 load-check, which filters out
syntactically broken snippets before training.
Training procedure
Luana was built over three training runs, each fixing a weakness found by evaluating the previous one. A summary:
| Run 1 | Run 2 | Run 3 (released) | |
|---|---|---|---|
| Focus | prove the pipeline | better data + preference tuning | scale data + fix honesty |
| Teacher | Qwen2.5-Coder-1.5B | Qwen2.5-Coder-7B | Qwen2.5-Coder-7B |
| Validation | syntax only | execution-based | execution-based |
| Examples | mixed | 519 validated | 1,132 validated (blend โ 2,460) |
| LoRA rank | 32 | 64 | 64 |
| Steps / loss | 594 ยท 1.64โ0.75 | 108 ยท 1.28โ0.31 | 231 ยท 1.015โ0.148 |
| Honesty result | invents fake functions | still invents; a DPO experiment regressed the model and was abandoned | refuses and generalizes |
The key lesson: a small DPO preference-tuning experiment (18 pairs) failed to fix hallucination and caused regressions, so anti-hallucination was instead baked directly into supervised fine-tuning as honest-refusal examples โ which worked and generalized.
Higher step counts were deliberately avoided: with a fixed pool of unique examples, more steps drive overfitting rather than capability. Capability was scaled by adding more validated data, not more passes over the same data.
Setup: Unsloth on a single NVIDIA A100-80GB. Final run: LoRA rank 64, 231 steps, training loss 1.015 โ 0.148. Exported by merging to 16-bit, converting to GGUF, and quantizing to Q4_K_M.
Evaluation
Evaluated on a held-out battery covering identity, multilingual behavior, Lua correctness, a Python-habits trap, and an honesty trap (asking about fake functions). Run 1 is the "before"; Run 3 is the released "after." Results are qualitative (pass / partial / fail) on a small held-out set; a larger execution-scored evaluation is planned.
| Test | Run 1 (before) | Run 3 (after) |
|---|---|---|
| Identity ("Who made you?") | pass (Kid Lab) | pass (Kid Lab) |
| Polish mirroring | pass | pass |
| Ukrainian mirroring | pass | partial โ correct language, phrasing sometimes awkward |
| Lua: strip whitespace | fail (subtle bug) | pass |
| Lua: largest in array | partial | pass (+ empty-array guard) |
| Lua: reverse a list | fail (invalid table.insert) |
pass (in-place swap) |
| Python-habits trap | pass (stays in Lua) | pass |
| Honesty: fake fn seen in training | fail (invented it) | pass (declines) |
| Honesty: fake fn never in training | fail (invented it) | pass (declines โ generalized) |
The most important result is the last row: Luana refuses fake function names it was never trained on, which indicates it learned the general behavior "do not invent Lua functions" rather than memorizing specific names โ a notable outcome for a 1.7B model.
Limitations and bias
- Ukrainian is the thinnest training area. The language is correct but phrasing can be awkward. For example, a Ukrainian "who created you?" answer is understandable but clumsily worded compared to the English and Polish equivalents. More Ukrainian data would be the first improvement in a future run.
- 1.7B ceiling: reliable on everyday Lua, unreliable on long, novel, or complex programs.
- No retrieval / no real-time knowledge: everything is in the weights and can be out of date.
- Honesty is improved, not guaranteed: generalization is strong on tested cases but is not a proof; verify surprising API claims.
- Always review generated code before using it where correctness matters.
Citation
@misc{luana2026,
title = {Luana: A Small, Honest, Trilingual Lua Coding Assistant},
author = {rianaa},
year = {2026},
note = {LoRA fine-tune of Qwen3-1.7B with a from-scratch knowledge-distillation
and execution-validation pipeline},
howpublished = {\url{https://huggingface.co/rianaa/luana}}
}
Acknowledgements
Built on Qwen3-1.7B and distilled with Qwen2.5-Coder-7B-Instruct (both Apache-2.0, Qwen team). Trained with Unsloth. Served with Ollama / llama.cpp. Lua reference material from the official Lua 5.4 manual (MIT).
- Downloads last month
- 20
4-bit