Text Generation
Transformers
Indonesian
deepseek_v4
deepseek
Mixture of Experts
causal-lm
chat
cpu
indonesian
conversational
custom_code
Instructions to use zelapi/lilo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zelapi/lilo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zelapi/lilo", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zelapi/lilo", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("zelapi/lilo", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zelapi/lilo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zelapi/lilo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zelapi/lilo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zelapi/lilo
- SGLang
How to use zelapi/lilo 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 "zelapi/lilo" \ --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": "zelapi/lilo", "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 "zelapi/lilo" \ --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": "zelapi/lilo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use zelapi/lilo with Docker Model Runner:
docker model run hf.co/zelapi/lilo
Download chat_lilo.py from zelapi/lilo: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/zelapi/lilo/resolve/main/chat_lilo.py
- Command line
-
hf download hf://zelapi/lilo/chat_lilo.py
-
curl -L -o chat_lilo.py https://huggingface.co/zelapi/lilo/resolve/main/chat_lilo.py
1.74 kB
| #!/usr/bin/env python3 | |
| """LILO chat CLI — CPU-optimized, KV-cache generation. | |
| Usage: | |
| python chat_lilo.py "prompt" # single prompt | |
| python chat_lilo.py # interactive | |
| python chat_lilo.py --temp 0.7 --top-p 0.9 --max 200 "prompt" | |
| """ | |
| import argparse, os, sys | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| sys.path.insert(0, HERE) | |
| from lilo_common import load_lilo, generate_lilo | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("prompt", nargs="*") | |
| ap.add_argument("--variant", default="fp16", choices=["fp16", "int8"]) | |
| ap.add_argument("--max", type=int, default=200) | |
| ap.add_argument("--temp", type=float, default=0.7) | |
| ap.add_argument("--top-p", type=float, default=0.9) | |
| ap.add_argument("--rep", type=float, default=1.1) | |
| ap.add_argument("--threads", type=int, default=1) | |
| ap.add_argument("--path", default=HERE) | |
| a = ap.parse_args() | |
| tok, model = load_lilo(a.path, variant=a.variant, threads=a.threads) | |
| def run(prompt): | |
| ids = tok.encode(prompt, add_special_tokens=False) | |
| out = generate_lilo(model, tok, ids, max_new_tokens=a.max, temperature=a.temp, | |
| top_p=a.top_p, repetition_penalty=a.rep, stream=True) | |
| return tok.decode(out, skip_special_tokens=True) | |
| if a.prompt: | |
| run(" ".join(a.prompt)) | |
| print() | |
| return | |
| print("LILO siap. Ketik pesan (Ctrl-C/Ctrl-D untuk keluar).") | |
| while True: | |
| try: | |
| p = input("\n> ").strip() | |
| except (EOFError, KeyboardInterrupt): | |
| print() | |
| break | |
| if not p: | |
| continue | |
| run(p) | |
| print() | |
| if __name__ == "__main__": | |
| main() | |