A lightweight terminal chat interface for DeepSeek-Coder-6.7B-Instruct using llama.cpp. Supports streaming responses, multi-turn conversations, file attachments, and CPU performance benchmarking.
- Python 3.10+
- llama.cpp (built with
llama-serverandllama-bench) - DeepSeek-Coder-6.7B-Instruct GGUF model
rich(only fordeepseek_chat.py;deepseek_chat_no_style.pyneeds no packages)
Start an interactive chat:
python3 deepseek_chat.pySend a one-shot prompt:
python3 deepseek_chat.py -p "Explain binary search trees"Pipe a file into the model:
cat app.py | python3 deepseek_chat.py -p "Review this code"Run a performance benchmark:
python3 deepseek_chat.py --benchKeep the server running:
python3 deepseek_chat.py --serve-onlyds-chat.sh sets up a virtual environment, installs rich if needed, and starts the chat (For this, please use deepseek_chat.py instead of deepseek_chat_no_style.py). Add an alias to your .zshrc or .bashrc:
alias ds-chat='~/llm/scripts/ds-chat.sh'| Command | Description |
|---|---|
/file PATH |
Attach a file to the next message |
/system [TXT] |
View or change the system prompt |
/temp X |
Change temperature |
/max N |
Set maximum response tokens |
/reset |
Clear conversation history |
/save PATH |
Save conversation as Markdown |
/help |
Display available commands |
/exit |
Exit the application |
Command-line options allow customization of context size, CPU threads, KV cache precision, sampling parameters, and server arguments. Run:
python3 deepseek_chat.py --helpdeepseek_chat.py- styled version (Markdown rendering viarich)deepseek_chat_no_style.py- plain text version (standard library only)ds-chat.sh- venv + launch wrapper
The code is commented with Doxygen blocks.