Two chat interfaces are provided for interacting with converted models:
Simple chat interface for basic interactions and testing:
python ./tests/chat.py \
--embed llama_embeddings \
--lmhead llama_lm_head_lut6 \
--ffn llama_FFN_PF_lut6_chunk_01of02 \
--tokenizer ./models \
--context-length 1024- Single message interactions
- Basic generation statistics
- Minimal memory usage
- Suitable for quick testing
Advanced chat interface with conversation management:
python ./tests/chat_full.py \
--embed llama_embeddings \
--lmhead llama_lm_head_lut6 \
--ffn llama_FFN_PF_lut6_chunk_01of02 \
--tokenizer ./models \
--context-length 1024- Full conversation history
- Automatic history truncation
- Dynamic context window shifting
- Detailed generation statistics:
- Tokens per second (t/s)
- Time to first token (TTFT)
- Total tokens generated
- Thinking Mode: Toggle thinking mode with
/tcommand to enable deep reasoning processes for DeepHermes - No Warmup Option: Use
--nwflag to skip the warmup phase for faster startup - Debug Mode: Use
--debug-levelto control debug output:- Level 0: Normal operation (default)
- Level 1: Print full prompts before generation
- Level 2: Reserved for more verbose debugging We use warm up models to prevent CoreML/Python GIL race conditions. You can skip the warmup phase for bigger models.
If you used convert_model.sh to convert your model, you can run either interface using the generated meta.yaml:
# Basic chat
python ./tests/chat.py --meta ./converted_models/meta.yaml
# Full conversation mode
python ./tests/chat_full.py --meta ./converted_models/meta.yaml| Parameter | Description | Default |
|---|---|---|
--d, --dir |
Directory containing model files | current directory |
--embed |
Path to embeddings model | required |
--ffn |
Path to FFN model | required |
--lmhead |
Path to LM head model | required |
--tokenizer |
Path to tokenizer | model directory |
--context-length |
Context length for model | 512 |
--meta |
Path to meta.yaml for automatic configuration | none |
--prompt |
Run once with this prompt and exit | none |
--nw |
Skip warmup phase | false |
--debug-level |
Debug output level (0=none, 1=print prompts, 2=more verbose) | 0 |
Model paths can be specified in several ways:
- Relative to --dir
python ./tests/chat.py \
--d ./models \
--embed llama_embeddings \
--lmhead llama_lm_head_lut6- Absolute paths
python ./tests/chat.py \
--embed /path/to/models/llama_embeddings \
--lmhead /path/to/models/llama_lm_head_lut6- Using meta.yaml
python ./tests/chat.py --meta ./models/meta.yaml