user01234-sl/Llama-UI-Python
关于
A Python terminal interface for llama.cpp
开发工具可以做什么
- Rich dashboard with a compact model/server status header and readable conversation panels.
- Reliable incremental response streaming without Rich Live/Status overwriting output on some Termux terminals.
- Editable prompt input powered by prompt-toolkit: left/right cursor movement, Home/End, and up/down prompt history.
- Persistent prompt history stored in ~/.config/llama-ui/input_history.txt.
实测星标增长
- 24小时
- 0
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Llama-UI 0.7.1
A Python package providing a friendly Rich-powered terminal frontend for llama.cpp, designed with Termux on Android in mind.
Install in Termux
PyPI
python -m pip install --upgrade llama-ui-termux
Build from source
Make sure Python and pip are available:
pkg install python
Extract this project ZIP, enter the project directory, and install it:
python -m pip install .
Run the application:
llama-ui
You can also launch it as a Python module:
python -m llama_ui
Llama-UI does not include or compile llama.cpp. You need a working llama-server installation.
Requirements
- Python 3.9 or newer
rich(installed automatically by pip)prompt-toolkit(installed automatically by pip; provides editable input and arrow-key history)- A working
llama.cppbuild that providesllama-server
First launch
The setup wizard asks which llama.cpp build you use:
- Termux repository package — uses
llama-serverfrom yourPATH. - Compiled from source — asks for the directory containing
llama-serverand the directories containing its shared libraries.
It also asks for your GGUF model folder. Select a model in Models before configuring its individual server and generation settings.
Features
- Rich dashboard with a compact model/server status header and readable conversation panels.
- Reliable incremental response streaming without Rich Live/Status overwriting output on some Termux terminals.
- Editable prompt input powered by
prompt-toolkit: left/right cursor movement, Home/End, and up/down prompt history. - Persistent prompt history stored in
~/.config/llama-ui/input_history.txt. - Generation time, character count, and approximate words/second shown after each response.
- Separate Thinking and Assistant panels when the backend streams reasoning fields (
reasoning_content,reasoning, orthinking) or explicit<think>...</think>sections. - Import/copy a local
.gguffile. - Download a public Hugging Face GGUF using its repository ID and exact filename.
- Per-model system prompts and generation settings: temperature,
top_p,top_k, and repeat penalty. - Per-model llama-server startup flags, host, port, and request timeout.
- Model-aware server switching: when Llama-UI itself launched the previous model's server, starting a different model stops that child process before launching the new one.
- Single-file chat attachments:
.txtand.mdcontents, plus.jpgand.pngimages for compatible vision models. Images require a multimodal model with vision support enabled inllama-server. Use/attachbefore sending a message and/detachto remove a pending attachment. - Chat commands:
/help— show chat commands./edit— edit the last user message and submit it again./regen— regenerate the answer to the last user message./new— start a fresh conversation./save— save the current conversation./attach— attach one.txt,.md,.jpg, or.pngfile to the next message./detach— remove the pending attachment./exit— return to the main menu.
- Ctrl+C interrupts a response; partial output is retained in the conversation.
- Conversation history: view, load, and delete saved chats. Thinking sections are retained when present.
- Server controls: start, stop, and inspect logs.
Model profiles and device settings
Settings that affect how a particular model runs are saved in an individual profile keyed by that model's resolved GGUF file path:
- Startup flags
- Server host and port
- Request timeout
- Temperature, top-p, top-k, and repeat penalty
- System prompt
Switching to another GGUF loads that model's own values. A model without a saved profile starts with the defaults shown in Settings.
The following remain device-wide because they describe the local installation or shared storage:
- llama.cpp installation type
llama-serverbinary path- Source-build shared-library directories
- GGUF model folder
Existing configuration is migrated when possible. The previous model-specific generation settings and system prompts are carried forward, and the old global server flags/address/timeout are assigned to the model that was selected during upgrade. If no model was selected during migration, the old values are applied to the first model selected afterward.
Startup flags
Enter llama-server flags only, for example:
-c 4096 -t 4 -ngl 0
Llama-UI adds the selected model (-m), host, and port. Do not include those options in the startup flags field.
Thinking display notes
The Thinking panel only appears when the selected model/server actually sends reasoning data in its streaming response or emits explicit <think> tags. Many models do not expose separate reasoning content; in that case Llama-UI displays the regular streamed answer without a separate thinking panel.
Source-build library paths
For source builds, enter the directory containing the llama-server binary and the directories containing its shared libraries. The app sets LD_LIBRARY_PATH for the server process. Exact paths vary by build configuration.
Configuration files
- Device configuration and model profiles:
~/.config/llama-ui/config.json - Chat history:
~/.config/llama-ui/chats/ - Server log:
~/.config/llama-ui/server.log - Default model folder:
~/models
The configuration directory respects XDG_CONFIG_HOME.
Important notes
- GGUF downloads can be several GB. Check storage and mobile data before downloading.
- Public Hugging Face files are supported; private/gated repositories are not supported by the built-in downloader.
- Generation speed is approximate words/second, not tokenizer-accurate tokens/second.
- GPU offload depends on your llama.cpp build and Android device.
- Llama-UI starts/stops server processes it launches itself. It does not automatically stop an external server that was already running.
探索相关项目
加载中…