Instructions to use rexmhall09/kenchi with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rexmhall09/kenchi with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rexmhall09/kenchi", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("rexmhall09/kenchi", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rexmhall09/kenchi with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rexmhall09/kenchi" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rexmhall09/kenchi", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rexmhall09/kenchi
- SGLang
How to use rexmhall09/kenchi 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 "rexmhall09/kenchi" \ --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": "rexmhall09/kenchi", "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 "rexmhall09/kenchi" \ --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": "rexmhall09/kenchi", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rexmhall09/kenchi with Docker Model Runner:
docker model run hf.co/rexmhall09/kenchi
Kenchi 1
Code on GitHub ยท Weights on Hugging Face
Kenchi (่ฌ็ฅ, "humble knowledge") is a small language model I made, with about 500 million parameters. The goal of Kenchi is that it is the smallest model that can use tools and tell you when it does not know.
It is only ~500M parameters so it has many limitations.
Made by Rex Hall (rexmhall09) with Lor, using Fable 5.2, Astra 6.2, and Fern 0.1. Code and weights are MIT.
Use
The easiest way to run it is with the code at github.com/rexmhall09/kenchi, which has a terminal chat that searches Wikipedia.
With transformers>=4.44.2 (install torch, transformers>=4.44.2, sentencepiece and
safetensors):
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("rexmhall09/kenchi", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("rexmhall09/kenchi", trust_remote_code=True)
reply = model.chat(tok, [{"role": "user", "content": "Who are you?"}])
print(reply["content"])
chat() returns an OpenAI-style assistant message. Pass tools (OpenAI-style
function schemas) to let it call tools. When the reply has tool_calls, run the
tool, add the result as a tool message, and call chat() again.
Limitations
- It can be wrong, and wrong answers still come with a source. Open the link.
- Follow-up questions ("where was he born?") mostly fail. Ask the full question again.
- It is not a good general chatbot.
- English only.
- 2,048 tokens of context.
Data
Built with Qwen: some of the training data was written by Qwen models. The search results used in training are Wikipedia text (CC BY-SA 3.0). DATA.md has the full sources and citations.
- Downloads last month
- 31