在Android设备上利用Termux安装llama.cpp并启动webui 📅 发布时间:2026/7/9 13:02:08 👁️ 浏览次数: llama.cpp没有发布官方aarch64的二进制需要自己编译好在Termux已经有编译好的包可用。按照文章在安卓手机上用vulkan加速推理LLM的方法1.在Termux中安装llama-cpp软件~ $ apt install llama-cpp Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package llama-cpp ~ $ apt update Get:1 https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable InRelease [14.0 kB] Get:2 https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable/main aarch64 Packages [542 kB] Fetched 556 kB in 1s (425 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 83 packages can be upgraded. Run apt list --upgradable to see them. ~ $ apt install llama-cpp Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libandroid-spawn Suggested packages: llama-cpp-backend-vulkan llama-cpp-backend-opencl The following NEW packages will be installed: libandroid-spawn llama-cpp 0 upgraded, 2 newly installed, 0 to remove and 83 not upgraded. Need to get 9927 kB of archives. After this operation, 99.2 MB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable/main aarch64 libandroid-spawn aarch64 0.3 [15.2 kB] Get:2 https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable/main aarch64 llama-cpp aarch64 0.0.0-b8184-0 [9911 kB] Fetched 9927 kB in 2s (4059 kB/s) Selecting previously unselected package libandroid-spawn. (Reading database ... 6651 files and directories currently installed.) Preparing to unpack .../libandroid-spawn_0.3_aarch64.deb ... Unpacking libandroid-spawn (0.3) ... Selecting previously unselected package llama-cpp. Preparing to unpack .../llama-cpp_0.0.0-b8184-0_aarch64.deb ... Unpacking llama-cpp (0.0.0-b8184-0) ... Setting up libandroid-spawn (0.3) ... Setting up llama-cpp (0.0.0-b8184-0) ...如果找不到这个包就先执行apt update更新目录。为简单起见先不安装llama-cpp-backend-vulkan用cpu来执行llama-cpp。2.下载Qwen3.5-0.8B-UD-Q4_K_XL.gguf模型~ $ mkdir model ~ $ cd model ~/model $ wget -c https://hf-mirror.com/unsloth/Qwen3.5-0.8B-GGUF/resolve/main/Qwen3.5-0.8B-UD-Q4_K_XL.gguf The program wget is not installed. Install it by executing: pkg install wget ~/model $ curl -LO https://hf-mirror.com/unsloth/Qwen3.5-0.8B-GGUF/resolve/main/Qwen3.5-0.8B-UD-Q4_K_XL.gguf % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1391 0 1391 0 0 1771 0 --:--:-- --:--:-- --:--:-- 1771 100 532M 100 532M 0 0 4147k 0 0:02:11 0:02:11 --:--:-- 5141k这个模型是Q4量化的比原版减少了一半空间而能力差不多。3.用lama-cli交互工具加载模型并对话~/model $ lama-cli -m Qwen3.5-0.8B-UD-Q4_K_XL.gguf --ctx-size 16384 -cnv No command lama-cli found, did you mean: Command alass-cli in package alass Command ani-cli in package ani-cli ~/model $ llama-cli -m Qwen3.5-0.8B-UD-Q4_K_XL.gguf --ctx-size 16384 -cnv load_backend: loaded CPU backend from /data/data/com.termux/files/usr/bin/../lib/libggml-cpu.so Loading model... ▄▄ ▄▄ ██ ██ ██ ██ ▀▀█▄ ███▄███▄ ▀▀█▄ ▄████ ████▄ ████▄ ██ ██ ▄█▀██ ██ ██ ██ ▄█▀██ ██ ██ ██ ██ ██ ██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀ ██ ██ ▀▀ ▀▀ build : b0-unknown model : Qwen3.5-0.8B-UD-Q4_K_XL.gguf modalities : text available commands: /exit or CtrlC stop or exit /regen regenerate the last response /clear clear the chat history /read add a text file用因式分解法解方程x^2-x-200我们要解的是方程x 2 − x − 20 0 x^2 - x - 20 0x2−x−2001. 分析方程结构这是一个一元二次方程可以看作是配方法或平方差公式的逆运算。观察方程x 2 − 2 x 9 − x 0 x^2 - 2x 9 - x 0x2−2x9−x0这看起来不像标准形式但我们可以尝试配方x 2 − 20 x 0 x^2 - 20 x 0x2−20x0这也不对因为系数没有统一。让我们尝试直接利用平方差公式a 2 − b 2 ( a − b ) ( a b ) a^2 - b^2 (a-b)(ab)a2−b2(a−b)(ab)。我们需要将方程写成( x − … ) ( x … ) 0 (x - \dots)(x \dots) 0(x−…)(x…)0的形式。通常这类方程一次项和常数项互为相反数的形式可以通过配方转化为( x − 1 2 ) 2 − ( 1 2 ) 2 − 20 0 (x - \frac{1}{2})^2 - (\frac{1}{2})^2 - 20 0(x−21)2−(21)2−200这会导致x xx变成四次方程显然不是我们想要的。让我们回到直接因式分解。观察常数项是− 20 -20−20一次项系数是1 11。我们需要找到两个数乘积为− 20 -20−20和为1 11。这两个数显然是4和− 5 -5−5。所以我们可以将方程左边变形为( x − 4 ) ( x 5 ) x 2 − 4 x 5 x − 20 x 2 x − 20 (x - 4)(x 5) x^2 - 4x 5x - 20 x^2 x - 20(x−4)(x5)x2−4x5x−20x2x−202. 验证并求解让我们重新检查一下刚才的变形是否正确( x − 4 ) ( x 5 ) x 2 5 x − 4 x − 20 x 2 x − 20 (x - 4)(x 5) x^2 5x - 4x - 20 x^2 x - 20(x−4)(x5)x25x−4x−20x2x−20这与原方程完全一致。因此原方程可以分解为x 2 x − 20 0 x^2 x - 20 0x2x−200根据零乘性Zero Product Property如果两个因式的乘积为 0那么其中一个因式必须为 0。所以x − 4 0 或 x 5 0 x - 4 0 \quad \text{或} \quad x 5 0x−40或x50解得x 1 4 x_1 4x14x 2 − 5 x_2 -5x2−53. 结论方程的解为x 4 或 x − 5 x 4 \text{ 或 } x -5x4或x−5[ Prompt: 45.1 t/s | Generation: 6.6 t/s ]/exitExiting... llama_memory_breakdown_print: | memory breakdown [MiB] | total free self model context compute unaccounted | llama_memory_breakdown_print: | - Host | 1222 522 211 489 |因为模型很小智能比较弱胡说一通后勉强算对了。4.利用llama-server内置的web-ui功能~/model $ ls -l total 546220 -rw------- 1 u0_a270 u0_a270 558772480 Mar 8 09:40 Qwen3.5-0.8B-UD-Q4_K_XL.gguf ~/model $ llama-server -m ./Qwen3.5-0.8B-UD-Q4_K_XL.gguf --jinja -c 0 --host 127.0.0.1 --port 8033 load_backend: loaded CPU backend from /data/data/com.termux/files/usr/bin/../lib/libggml-cpu.so main: n_parallel is set to auto, using n_parallel 4 and kv_unified true build: 0 (unknown) with Clang 21.0.0 for Android aarch64 system info: n_threads 8, n_threads_batch 8, total_threads 8 system_info: n_threads 8 (n_threads_batch 8) / 8 | CPU : NEON 1 | ARM_FMA 1 | LLAMAFILE 1 | REPACK 1 | Running without SSL init: using 7 threads for HTTP server start: binding port with default address family main: loading model srv load_model: loading model ./Qwen3.5-0.8B-UD-Q4_K_XL.gguf common_init_result: fitting params to device memory, for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on llama_params_fit_impl: no devices with dedicated memory found llama_params_fit: successfully fit params to free device memory llama_params_fit: fitting params to free memory took 0.85 seconds llama_model_loader: loaded meta data with 46 key-value pairs and 320 tensors from ./Qwen3.5-0.8B-UD-Q4_K_XL.gguf (version GGUF V3 (latest)) ... load_tensors: loading model tensors, this can take a while... (mmap true, direct_io false) load_tensors: CPU_Mapped model buffer size 522.43 MiB ............................................................... llama_context: CPU output buffer size 3.79 MiB llama_kv_cache: CPU KV buffer size 3072.00 MiB llama_kv_cache: size 3072.00 MiB (262144 cells, 6 layers, 4/1 seqs), K (f16): 1536.00 MiB, V (f16): 1536.00 MiB llama_memory_recurrent: CPU RS buffer size 77.06 MiB llama_memory_recurrent: size 77.06 MiB ( 4 cells, 24 layers, 4 seqs), R (f32): 5.06 MiB, S (f32): 72.00 MiB sched_reserve: reserving ... sched_reserve: Flash Attention was auto, set to enabled sched_reserve: CPU compute buffer size 786.02 MiB sched_reserve: graph nodes 3123 (with bs512), 1737 (with bs1) sched_reserve: graph splits 1 sched_reserve: reserve took 37.35 ms, sched copies 1 common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable) srv load_model: initializing slots, n_slots 4 common_speculative_is_compat: the target context does not support partial sequence removal srv load_model: speculative decoding not supported by this context slot load_model: id 0 | task -1 | new slot, n_ctx 262144 slot load_model: id 1 | task -1 | new slot, n_ctx 262144 slot load_model: id 2 | task -1 | new slot, n_ctx 262144 slot load_model: id 3 | task -1 | new slot, n_ctx 262144 srv load_model: prompt cache is enabled, size limit: 8192 MiB srv load_model: use --cache-ram 0 to disable the prompt cache srv load_model: for more info see https://github.com/ggml-org/llama.cpp/pull/16391 init: chat template, example_format: |im_start|system You are a helpful assistant|im_end| |im_start|user Hello|im_end| |im_start|assistant Hi there|im_end| |im_start|user How are you?|im_end| |im_start|assistant think /think srv init: init: chat template, thinking 0 main: model loaded main: server is listening on http://127.0.0.1:8033 main: starting the main loop... srv update_slots: all slots are idle系统检测到CPU有8个线程用了7个输出一堆参数后等待用浏览器访问http://127.0.0.1:8033。在浏览器中输入问题输出速度比命令行慢一些大约3t/s。服务端输出如下内容srv log_server_r: done request: GET / 127.0.0.1 200 srv params_from_: Chat format: peg-constructed slot get_availabl: id 3 | task -1 | selected slot by LRU, t_last -1 slot launch_slot_: id 3 | task -1 | sampler chain: logits - ?penalties - ?dry - ?top-n-sigma - top-k - ?typical - top-p - min-p - ?xtc - temp-ext - dist slot launch_slot_: id 3 | task 0 | processing task, is_child 0 slot update_slots: id 3 | task 0 | new prompt, n_ctx_slot 262144, n_keep 0, task.n_tokens 23 slot update_slots: id 3 | task 0 | n_tokens 0, memory_seq_rm [0, end) srv log_server_r: done request: POST /v1/chat/completions 127.0.0.1 200 slot init_sampler: id 3 | task 0 | init sampler, took 0.01 ms, tokens: text 23, total 23 slot update_slots: id 3 | task 0 | prompt processing done, n_tokens 23, batch.n_tokens 23 slot print_timing: id 3 | task 0 | prompt eval time 1447.31 ms / 23 tokens ( 62.93 ms per token, 15.89 tokens per second) eval time 171453.86 ms / 569 tokens ( 301.32 ms per token, 3.32 tokens per second) total time 172901.17 ms / 592 tokens slot release: id 3 | task 0 | stop processing: n_tokens 591, truncated 0 srv update_slots: all slots are idle ^Csrv operator(): operator(): cleaning up before exit... llama_memory_breakdown_print: | memory breakdown [MiB] | total free self model context compute unaccounted | llama_memory_breakdown_print: | - Host | 4457 522 3149 786 |
虚拟机密码的修改 1.打开虚拟机后点击重新启动客户机2.进入此界面后,通过上下箭头选择第二个选项,按E进入下一界面。3.通过箭头将光标移动到quiet后,输入rd.break,然后根据下方提示按CtrlX或F10进入下一界面。4.依次输入mount -o remount,rw /sysrootchroot /s… 2026/5/17 9:23:18
计算机毕业设计之springboot青岛港集装箱进出口管理系统的设计与实现 青岛港集装箱进出口管理系统采用B/S架构,数据库是MySQL。网站的搭建与开发采用了先进的java进行编写,使用了springboot框架。该系统从两个对象:由管理员和用户来对系统进行设计构建。主要功能包括:个人信息修改,对用户… 2026/5/17 9:23:16
收藏!小白程序员必看:GraphRAG核心技术解析,轻松掌握大模型进阶玩法! GraphRAG是检索增强生成(RAG)技术的升级版,通过将非结构化文本转化为结构化知识图谱,结合图谱的实体、关系和拓扑结构实现「语义结构化推理检索」,从而提升大模型生成答案的精准度、全面性和逻辑性。本文详细解析了Gra… 2026/5/17 9:23:16
Ctool:现代开发工作流中的本地化工具链架构实践 Ctool:现代开发工作流中的本地化工具链架构实践 【免费下载链接】Ctool 程序开发常用工具 chrome / edge / firefox / utools / windows / linux / mac 项目地址: https://gitcode.com/gh_mirrors/ct/Ctool 在分布式系统与微服务架构日益复杂的今天ÿ… 2026/7/9 12:59:28
终极iOS激活锁绕过指南:5步免费解锁你的iPhone 6s-X设备 终极iOS激活锁绕过指南:5步免费解锁你的iPhone 6s-X设备 【免费下载链接】applera1n icloud bypass for ios 15-16 项目地址: https://gitcode.com/gh_mirrors/ap/applera1n 你是否有一台被激活锁困住的iPhone设备?看着曾经昂贵的智能手机变成&qu… 2026/7/9 12:55:28
读书笔记配图怎么做?用 AI 一键生成“高赞氛围图”和“逻辑结构图”实战攻略 作为读书博主或知识分享者,你一定遇到过这样的窘境:辛辛苦苦写好了千字笔记,却在配图上卡了壳。用网图怕侵权,自己拍又费时费力。在这个“视觉即流量”的时代,精美的配图是提升笔记点击率和收藏量的关键。目前… 2026/7/9 12:53:27
YOLOv8鱼病害识别检测系统(项目源码+YOLO数据集+模型权重+UI界面+python+深度学习+环境配置+目标检测) 摘要 本文设计并实现了一套基于YOLOv8目标检测算法的鱼病害智能识别检测系统。在模型层面,系统采用YOLOv8s作为基础架构,该模型继承了YOLO系列单阶段检测算法的端到端学习优势,在检测精度与推理速度之间取得了良好的平衡。针对水产养殖场景中… 2026/7/9 12:53:27
A3908与PIC18F4685直流电机精密运动控制方案 1. 项目概述:A3908与PIC18F4685的运动控制方案在精密运动控制领域,直流电机的稳定性和响应速度一直是工程师面临的挑战。A3908低压恒压直流电机驱动器与PIC18F4685微控制器的组合,为解决这一问题提供了高性价比的硬件平台。A3908作为Allegro … 2026/7/9 12:51:26
AD5593R与PIC18F87J10的硬件协同设计与优化实践 1. AD5593R与PIC18F87J10的硬件协同设计AD5593R这颗芯片最吸引我的地方在于它的多功能性——8个引脚都可以独立配置为12位DAC输出或12位ADC输入。在实际项目中,这种灵活性意味着我们可以用单颗芯片同时实现模拟信号的采集和生成。它的DAC输出范围可以通过配置选择0-… 2026/7/9 12:47:26
机器视觉与PLC集成:轮毂缺陷检测与字符识别误差控制在0.2mm内 机器视觉与PLC集成:轮毂缺陷检测与字符识别误差控制在0.2mm内的技术实现轮毂作为汽车关键零部件,其表面质量直接影响行车安全与美观。传统人工检测效率低且易漏检,而采用机器视觉与PLC集成方案可实现微米级精度检测。本文将深入解析高精度视觉… 2026/7/9 0:01:04
GBase 8a vs MySQL 8.0:ALTER TABLE语法与限制的5点关键差异对比 GBase 8a与MySQL 8.0:ALTER TABLE语法差异深度解析与实战指南1. 两种数据库的ALTER TABLE能力全景对比在数据库架构设计和运维过程中,表结构变更(DDL操作)是不可避免的需求。GBase 8a作为国产分析型数据库代表,与开源M… 2026/7/9 0:03:06
【大数据毕业设计】基于多源旅游数据的景区热度分析与推荐系统的设计与实现 基于 Django 的旅游偏好挖掘与景区推荐系统(源码+文档+远程调试,全bao定制等) 博主介绍:✌️码农一枚 ,专注于大学生项目实战开发、讲解和毕业🚢文撰写修改等。全栈领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java、小程序技术领域和毕业项目实战 ✌️技术范围:&am… 2026/7/9 0:05:09
6个月转型AI工程师:实战路径与核心技能 1. 项目概述:6个月转型AI工程师的可行性路径在2023年大模型技术爆发的背景下,AI工程师岗位需求同比增长217%(LinkedIn数据)。不同于传统算法工程师需要3-5年培养周期,现代AI工程师更侧重工程化落地能力。我在硅谷科技公… 2026/7/7 11:26:57
TPAFE0808与PIC18F87K22的多通道信号采集方案 1. 项目背景与核心需求在工业自动化、医疗设备和科研仪器等领域,多通道信号采集与系统监测是基础且关键的技术需求。传统方案往往面临通道数量不足、信号调理复杂、系统集成度低等问题。TPAFE0808作为一款8通道模拟前端芯片,与PIC18F87K22微控制器的组合… 2026/7/8 20:15:17
STC3115与PIC18LF26K80构建高精度电池管理系统 1. STC3115与PIC18LF26K80在电池管理系统中的核心价值在现代电子设备中,电池管理系统(BMS)的重要性不亚于设备的核心处理器。STC3115作为一款高精度电池电量监测IC,与PIC18LF26K80微控制器的组合,构成了一个既能精确监控又能智能管理的完整解… 2026/7/8 14:25:08