Text Generation
PyTorch
GGUF
Japanese
English
japanese
little-language-model
tiny-language-model
edge-ai
embedded-ai
ex-word
llama-cpp
lm-studio
custom-code
conversational
Instructions to use ToTo-40417/EXLLM-ONI5M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ToTo-40417/EXLLM-ONI5M 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 ToTo-40417/EXLLM-ONI5M:F16 # Run inference directly in the terminal: llama cli -hf ToTo-40417/EXLLM-ONI5M:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ToTo-40417/EXLLM-ONI5M:F16 # Run inference directly in the terminal: llama cli -hf ToTo-40417/EXLLM-ONI5M:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ToTo-40417/EXLLM-ONI5M:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf ToTo-40417/EXLLM-ONI5M:F16
Use Docker
docker model run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use ToTo-40417/EXLLM-ONI5M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ToTo-40417/EXLLM-ONI5M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ToTo-40417/EXLLM-ONI5M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- Ollama
How to use ToTo-40417/EXLLM-ONI5M with Ollama:
ollama run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- Unsloth Desktop
- Docker Model Runner
How to use ToTo-40417/EXLLM-ONI5M with Docker Model Runner:
docker model run hf.co/ToTo-40417/EXLLM-ONI5M:F16
- Lemonade
How to use ToTo-40417/EXLLM-ONI5M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ToTo-40417/EXLLM-ONI5M:F16
Run and chat with the model
lemonade run user.EXLLM-ONI5M-F16
List all available models
lemonade list
- Atomic Chat
Download tools/export_int8.py from ToTo-40417/EXLLM-ONI5M: direct link, hf CLI and curl.
- Browser
- Download file 2.47 kB
-
https://huggingface.co/ToTo-40417/EXLLM-ONI5M/resolve/main/tools/export_int8.py
- Command line
-
hf download hf://ToTo-40417/EXLLM-ONI5M/tools/export_int8.py
-
curl -L -o export_int8.py https://huggingface.co/ToTo-40417/EXLLM-ONI5M/resolve/main/tools/export_int8.py
2.47 kB
| import argparse,hashlib,json,struct,sys | |
| from pathlib import Path | |
| import numpy as np, torch | |
| ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT)) | |
| from src.model import EXLLM,EXLLMConfig | |
| MAGIC=b'EXLLM8\0\0' | |
| def quant_row(t): | |
| a=t.detach().float().cpu().numpy();mx=np.max(np.abs(a),axis=1);sc=np.where(mx>0,mx/127.0,1.0).astype(np.float32);q=np.clip(np.rint(a/sc[:,None]),-127,127).astype(np.int8);return q,sc | |
| def main(): | |
| ap=argparse.ArgumentParser();ap.add_argument('--checkpoint',default='weights/EXLLM-ONI5M-v1.0.pt');ap.add_argument('--out',default='weights/EXLLM-ONI5M-v1.0-int8.bin');a=ap.parse_args() | |
| c=torch.load(ROOT/a.checkpoint,map_location='cpu',weights_only=False);m=EXLLM(EXLLMConfig(**c['config']));m.load_state_dict(c['model']);m.eval();recs=[] | |
| for name,t in m.state_dict().items(): | |
| if name=='lm_head.weight':continue | |
| if name.endswith('.weight') and 'norm' in name: | |
| x=t.detach().cpu().numpy().astype(np.float16);recs.append((name,2,list(x.shape),np.array([],dtype=np.float32),x.tobytes())) | |
| elif t.ndim==2: | |
| q,sc=quant_row(t);recs.append((name,1,list(q.shape),sc,q.tobytes())) | |
| else: | |
| x=t.detach().cpu().numpy().astype(np.float16);recs.append((name,2,list(x.shape),np.array([],dtype=np.float32),x.tobytes())) | |
| out=ROOT/a.out;out.parent.mkdir(parents=True,exist_ok=True) | |
| with out.open('wb') as f: | |
| f.write(MAGIC);f.write(struct.pack('<II',1,len(recs))) | |
| for name,qt,dims,sc,data in recs: | |
| nb=name.encode();f.write(struct.pack('<HBB',len(nb),len(dims),qt));f.write(nb) | |
| for d in dims:f.write(struct.pack('<I',d)) | |
| f.write(struct.pack('<II',len(sc),len(data)));f.write(sc.astype('<f4').tobytes());f.write(data) | |
| sha=hashlib.sha256(out.read_bytes()).hexdigest();man={'format':'EXLLM8','format_version':1,'model':'EXLLM-ONI5M','model_version':'1.0.0','config':m.cfg.__dict__,'unique_parameters':m.num_parameters(),'tokenizer_vocab':m.cfg.vocab_size,'quantization':{'matrix_weights':'symmetric int8 per output row','matrix_scale':'float32 per row','rmsnorm_weights':'float16'},'aliases':{'lm_head.weight':'tok.weight'},'tensor_count':len(recs),'file':str(out.relative_to(ROOT)),'bytes':out.stat().st_size,'sha256':sha} | |
| out.with_suffix('.manifest.json').write_text(json.dumps(man,ensure_ascii=False,indent=2),encoding='utf-8');print(json.dumps(man,ensure_ascii=False,indent=2)) | |
| if __name__=='__main__':main() | |