From c9c99a73d67b9d1555a7d97351e472f687ed3fb1 Mon Sep 17 00:00:00 2001 From: yuerqiqi <2500526025@qq.com> Date: Wed, 14 Jan 2026 13:13:45 +0000 Subject: [PATCH 1/3] feat: update mllm-cli and android build tasks --- docs/service/mllm_cli.rst | 153 ++++++++------------------- mllm-cli/cmd/mllm-server/main.go | 2 +- mllm-cli/go.mod | 17 ++- mllm-cli/go.sum | 12 ++- mllm-cli/mllm/c.go | 4 +- tasks/build_android_mllm_client.yaml | 37 ++++--- tasks/build_android_mllm_server.yaml | 7 +- 7 files changed, 84 insertions(+), 148 deletions(-) diff --git a/docs/service/mllm_cli.rst b/docs/service/mllm_cli.rst index fdaf84766..c1f652c21 100644 --- a/docs/service/mllm_cli.rst +++ b/docs/service/mllm_cli.rst @@ -8,7 +8,7 @@ This document describes the MLLM command-line interface (CLI) tool, which operat **Currently, the system officially supports the following models:** -* **LLM**: ``mllmTeam/Qwen3-0.6B-w4a32kai`` +* **LLM**: ``mllmTeam/Qwen3-0.6B-w4a32kai、mllmTeam/Qwen3-4B-w4a8-i8mm-kai`` * **OCR**: ``mllmTeam/DeepSeek-OCR-w4a8-i8mm-kai`` This guide covers three main areas: @@ -136,168 +136,101 @@ Once configured, you can click the **Check** button to ensure the connection is Build Configuration Guide ------------------------- -The Go build tasks (`build_android_mllm_server.yaml` and `build_android_mllm_client.yaml`) use hardcoded paths that are specific to the build server's environment. If you are setting up a new build environment, you **must** modify these paths before proceeding to compilation. +Go build tasks (`build_android_mllm_server.yaml` and `build_android_mllm_client.yaml`) now use **dynamic paths** (via `$(pwd)`) to locate project files. This makes the scripts much more portable. -Understanding the Build Scripts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The core of the cross-compilation logic for Go is within the `ShellCommandTask` of the `.yaml` build files. It sets several environment variables to configure `cgo` for cross-compiling to Android ARM64. - -* ``GOOS=android``, ``GOARCH=arm64``: Tells Go to build for Android ARM64. -* ``CGO_ENABLED=1``: Enables ``cgo`` to allow Go to call C/C++ code. -* ``CC`` and ``CXX``: Specifies the C and C++ compilers from the Android NDK, used to compile any C/C++ parts within the Go program. -* ``CGO_CFLAGS``: Tells the C compiler where to find the MLLM C API header files (e.g., ``Runtime.h``). -* ``CGO_LDFLAGS``: Tells the linker where to find the compiled MLLM shared libraries (``.so`` files) that the final executable needs to link against. - -Modifying Hardcoded Paths -~~~~~~~~~~~~~~~~~~~~~~~~~ - -The two most critical variables you will need to change are `CGO_CFLAGS` and `CGO_LDFLAGS`. - -**Example from `build_android_mllm_server.yaml`**: - -.. code-block:: yaml +However, there are still specific environment configurations you **must** check and modify to match your local build machine. - # ... - export CGO_LDFLAGS="-L/root/zty_workspace/mllm_zty/build-android-arm64-v8a/bin" - export CGO_CFLAGS="-I/root/zty_workspace/mllm_zty" - # ... +Open `tasks/build_android_mllm_server.yaml` and check the following variables: -**How to Modify**: +1. **``ANDROID_NDK_HOME`` (Critical)** + The script assumes the NDK is located at `/opt/ndk/android-ndk-r28b`. + * **Action:** Change this path to the actual location of the Android NDK on your machine. -1. **``CGO_CFLAGS="-I/path/to/your/project/root"``** - The `-I` flag specifies an include directory. This path should point to the root of the MLLM project directory on your build server, where the `mllm/c_api/` headers are located. In the example, this is `/root/zty_workspace/mllm_zty`. Change this to match your project's location. +2. **``GOPROXY`` (Network)** + The script uses `https://goproxy.cn` to accelerate downloads in China. + * **Action:** If you are outside of China, you may remove this line or change it to `https://proxy.golang.org`. -2. **``CGO_LDFLAGS="-L/path/to/your/compiled/libs"``** - The `-L` flag specifies a library directory. This path must point to the directory where the C++ build (Step 1) placed the `.so` files. In the example, this is `/root/zty_workspace/mllm_zty/build-android-arm64-v8a/bin`. If your build output directory is different, you must update this path accordingly. - -By correctly updating these two paths in both `build_android_mllm_server.yaml` and `build_android_mllm_client.yaml`, you can adapt the build process to any server environment. Compilation and Deployment -------------------------- -This section provides the complete workflow for compiling all C++ and Go components, deploying them to an Android target, and running the system. +This section outlines the workflow for compiling the C++ and Go components and deploying them directly to an Android device. Prerequisites ~~~~~~~~~~~~~ -* A build environment, such as a server or Docker container, with the Android NDK and Go compiler installed, hereinafter referred to as the 'build server'. -* An Android target device with `adb` access enabled. -* `rsync` and `scp` for file synchronization between your development machine and the build server. +* Android NDK and Go compiler installed and configured. +* An Android device connected via `adb`. Step 1: Compile C++ Core Libraries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -First, we compile the MLLM C++ core, which produces the essential shared libraries (`.so` files). - -1. **Sync Code to Build Server**: - Synchronize your local project directory with the build server. - - .. code-block:: bash +Compile the MLLM C++ core to generate the required shared libraries (`.so` files). - # Replace , , and with your server details - rsync -avz --checksum -e 'ssh -p ' --exclude 'build' --exclude '.git' ./ @:/your_workspace/your_programname/ +1. **Configure Build Script**: + Ensure `tasks/build_android.yaml` is configured with your NDK path. -2. **Run the Build Task**: - On the build server, execute the build task. This task uses `tasks/build_android.yaml` to configure and run CMake. +2. **Run Compilation**: + Execute the build task from the project root. - Before executing this step, you also need to ensure that the hardcoded directories in build_android.yaml have been modified to match your requirements. The modification method is the same as for the Go compilation file mentioned earlier. - .. code-block:: bash - # These commands are run on your build server. - cd /your_workspace/your_programname/ python task.py tasks/build_android.yaml -3. **Retrieve Compiled Libraries**: - After the build succeeds, copy the compiled shared libraries from the build server back to your local machine. These libraries are the C++ backend that the Go application will call. - - .. code-block:: bash - - # You run these commands on your local machine to copy the files from the build server. - # Navigate to your local build artifacts directory - cd /path/to/your/local_artifacts_dir/ - - # Copy the libraries - scp -P @:/your_workspace/your_programname/build-android-arm64-v8a/bin/libMllmRT.so . - scp -P @:/your_workspace/your_programname/build-android-arm64-v8a/bin/libMllmCPUBackend.so . - scp -P @:/your_workspace/your_programname/build-android-arm64-v8a/bin/libMllmSdkC.so . + **Output**: The compiled libraries (`libMllmRT.so`, `libMllmCPUBackend.so`, `libMllmSdkC.so`) will be located in `build-android-arm64-v8a/bin/`. Step 2: Compile the Go Server ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Next, cross-compile the Go server application for Android. +Cross-compile the Go server application for Android. -1. **Sync Code**: Ensure your latest Go code is on the build server. This is only necessary if you've made changes to the Go server files (e.g., in the ``mllm-cli`` directory). - -2. **Run the Build Task**: - On the build server, execute the server build task. Make sure you have correctly configured the hardcoded paths in this YAML file as described in the "Build Configuration Guide" section. +1. **Run Compilation**: + Execute the server build task. .. code-block:: bash - cd /your_workspace/your_programname/ python task.py tasks/build_android_mllm_server.yaml -3. **Retrieve the Executable**: - Copy the compiled `mllm_web_server` binary from the build server back to your local machine. - - .. code-block:: bash - - # Navigate to your local build artifacts directory - cd /path/to/your/local_artifacts_dir/ - - # Copy the executable - scp -P @:/your_workspace/your_programname/build-android-arm64-v8a/bin/mllm_web_server . + **Output**: The executable `mllm_web_server` will be generated in `build-android-arm64-v8a/bin/`. -Step 3: Compile the Go Client -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you are using Chatbox or a similar client, you can skip this step. +Step 3: Compile the Go Client (Optional) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Similarly, compile the Go client application. +If you need the command-line WebSocket client, compile it using the following task. -1. **Sync Code**: Ensure your latest Go client code is on the build server. - -2. **Run the Build Task**: - On the build server, execute the client build task. This also requires the build YAML to be correctly configured. +1. **Run Compilation**: .. code-block:: bash - cd /your_workspace/your_programname/ python task.py tasks/build_android_mllm_client.yaml -3. **Retrieve the Executable**: - Copy the compiled `mllm_ws_client` binary from the build server to your local machine. - - .. code-block:: bash - - # Navigate to your local build artifacts directory - cd /path/to/your/local_artifacts_dir/ - - # Copy the executable - scp -P @:/your_workspace/your_programname/build-android-arm64-v8a/bin/mllm_ws_client . + **Output**: The executable `mllm_ws_client` will be generated in `build-android-arm64-v8a/bin/`. Step 4: Deploy to Target Device ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Push all compiled artifacts (libraries and executables) to your target Android device. +Push the compiled artifacts directly from the build output directory to your Android device using `adb`. .. code-block:: bash - # Connect to your device if you haven't already - adb connect + # 1. Connect to device (if not already connected via USB) + adb connect - # Push the shared libraries from your local artifacts directory - adb push libMllmRT.so /path/to/your/deployment_dir/ - adb push libMllmCPUBackend.so /path/to/your/deployment_dir/ - adb push libMllmSdkC.so /path/to/your/deployment_dir/ + # 2. Push libraries and executables + # Navigate to the build output directory + cd build-android-arm64-v8a/bin/ - # Push the server and client executables - adb push mllm_web_server /path/to/your/deployment_dir/ + # Define your target directory on Android (e.g., /data/local/tmp/mllm/) + export ANDROID_DIR=/data/local/tmp/mllm/ - # (Optional) Push the Go client if you compiled it in Step 3 - adb push mllm_ws_client /path/to/your/deployment_dir/ + # Push files + adb push libMllmRT.so $ANDROID_DIR + adb push libMllmCPUBackend.so $ANDROID_DIR + adb push libMllmSdkC.so $ANDROID_DIR + adb push mllm_web_server $ANDROID_DIR + # (Optional) Push client if compiled + # adb push mllm_ws_client $ANDROID_DIR Step 5: Running and Testing ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/mllm-cli/cmd/mllm-server/main.go b/mllm-cli/cmd/mllm-server/main.go index b66011454..4d78836be 100644 --- a/mllm-cli/cmd/mllm-server/main.go +++ b/mllm-cli/cmd/mllm-server/main.go @@ -29,7 +29,7 @@ func main() { log.Fatal("FATAL: InitializeContext failed!") } mllm.SetLogLevel(2) - if !mllm.StartService(4) { + if !mllm.StartService(1) { log.Fatal("FATAL: StartService failed!") } defer mllm.StopService() diff --git a/mllm-cli/go.mod b/mllm-cli/go.mod index 8064a07ab..aa7f4742e 100644 --- a/mllm-cli/go.mod +++ b/mllm-cli/go.mod @@ -1,29 +1,29 @@ module mllm-cli -go 1.22.2 +go 1.23.0 -require ( - github.com/charmbracelet/bubbles v0.21.0 - github.com/gorilla/websocket v1.5.3 // -) +toolchain go1.24.11 + +require github.com/charmbracelet/bubbles v0.21.0 require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/charmbracelet/bubbletea v1.3.4 // indirect + github.com/charmbracelet/bubbletea v1.3.4 github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect - github.com/charmbracelet/lipgloss v1.1.0 // indirect + github.com/charmbracelet/lipgloss v1.1.0 github.com/charmbracelet/x/ansi v0.8.0 // indirect github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect github.com/charmbracelet/x/term v0.2.1 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect + github.com/google/uuid v1.6.0 github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect - github.com/muesli/termenv v0.16.0 // indirect + github.com/muesli/termenv v0.16.0 github.com/rivo/uniseg v0.4.7 // indirect github.com/sahilm/fuzzy v0.1.1 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect @@ -31,5 +31,4 @@ require ( golang.org/x/sys v0.35.0 // indirect golang.org/x/term v0.34.0 golang.org/x/text v0.3.8 // indirect - github.com/google/uuid v1.6.0 ) diff --git a/mllm-cli/go.sum b/mllm-cli/go.sum index a9f84ee71..6a95e88fa 100644 --- a/mllm-cli/go.sum +++ b/mllm-cli/go.sum @@ -2,6 +2,8 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= +github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs= github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg= github.com/charmbracelet/bubbletea v1.3.4 h1:kCg7B+jSCFPLYRA52SDZjr51kG/fMUEoPoZrkaDHyoI= @@ -14,10 +16,16 @@ github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2ll github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q= github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8= github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= +github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ= +github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -39,12 +47,12 @@ github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA= github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= +golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E= +golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= diff --git a/mllm-cli/mllm/c.go b/mllm-cli/mllm/c.go index ec7995897..c0431196c 100644 --- a/mllm-cli/mllm/c.go +++ b/mllm-cli/mllm/c.go @@ -4,10 +4,10 @@ package mllm /* -#cgo CFLAGS: -std=c11 +#cgo CFLAGS: -std=c11 #cgo LDFLAGS: -lMllmSdkC -lMllmRT -lMllmCPUBackend -#include +#include "mllm/c_api/Runtime.h" #include static void* MllmCAny_get_v_custom_ptr(MllmCAny handle) { diff --git a/tasks/build_android_mllm_client.yaml b/tasks/build_android_mllm_client.yaml index 9c10e0733..56f5880c7 100644 --- a/tasks/build_android_mllm_client.yaml +++ b/tasks/build_android_mllm_client.yaml @@ -1,22 +1,21 @@ Tasks: - ShellCommandTask: command: | - echo "===== STEP 2: Setting up Go cross-compilation environment... =====" - export GOPROXY=https://goproxy.cn,direct - export GOOS=android - export GOARCH=arm64 - export CGO_ENABLED=1 - export ANDROID_NDK_HOME=/opt/ndk/android-ndk-r28b - export CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang - export CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++ - - echo "===== STEP 3: Setting CGo linker and compiler flags... =====" - export CGO_LDFLAGS="-L/root/zty_workspace/mllm_zty/build-android-arm64-v8a/bin" - export CGO_CFLAGS="-I/root/zty_workspace/mllm_zty" - - echo "===== STEP 4: Compiling Go MLLM WebSocket Client... =====" - cd mllm-cli && \ - echo "Running 'go mod tidy' to ensure all dependencies are present..." && \ - go mod tidy && \ - echo "Starting client build..." && \ - go build -o ../build-android-arm64-v8a/bin/mllm_ws_client -tags=mobile ./cmd/mllm-client/main.go \ No newline at end of file + export GOPROXY=https://goproxy.cn,direct + export GOOS=android + export GOARCH=arm64 + export CGO_ENABLED=1 + + export ANDROID_NDK_HOME=/opt/ndk/android-ndk-r28b + export CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang + export CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++ + + export CGO_LDFLAGS="-L$(pwd)/build-android-arm64-v8a/bin -lMllmSdkC -lMllmRT -lMllmCPUBackend -llog" + + export CGO_CFLAGS="-I$(pwd) -I/tmp/mllm_build" + + cd mllm-cli && \ + echo "Running 'go mod tidy' to ensure all dependencies are present..." && \ + go mod tidy && \ + echo "Starting client build..." && \ + go build -o ../build-android-arm64-v8a/bin/mllm_ws_client -tags=mobile ./cmd/mllm-client/main.go \ No newline at end of file diff --git a/tasks/build_android_mllm_server.yaml b/tasks/build_android_mllm_server.yaml index f8d856c65..a8e2ae84d 100644 --- a/tasks/build_android_mllm_server.yaml +++ b/tasks/build_android_mllm_server.yaml @@ -1,7 +1,6 @@ Tasks: - ShellCommandTask: command: | - echo "===== STEP 2: Setting up Go cross-compilation environment... =====" export GOPROXY=https://goproxy.cn,direct export GOOS=android export GOARCH=arm64 @@ -10,11 +9,9 @@ Tasks: export CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang export CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++ - echo "===== STEP 3: Setting CGo linker and compiler flags... =====" - export CGO_LDFLAGS="-L/root/zty_workspace/mllm_zty/build-android-arm64-v8a/bin" - export CGO_CFLAGS="-I/root/zty_workspace/mllm_zty" + export CGO_LDFLAGS="-L$(pwd)/build-android-arm64-v8a/bin -lMllmSdkC -lMllmRT -lMllmCPUBackend -llog" + export CGO_CFLAGS="-I$(pwd) -I/tmp/mllm_build" - echo "===== STEP 4: Compiling Go MLLM Web Server... =====" cd mllm-cli && \ echo "Running 'go mod tidy' to sync dependencies..." && \ go mod tidy && \ From ce1c5a2970181bb26c4ac625a6a830a46a3ee967 Mon Sep 17 00:00:00 2001 From: yuerqiqi <2500526025@qq.com> Date: Wed, 14 Jan 2026 21:47:30 +0800 Subject: [PATCH 2/3] Fix formatting of model list in mllm_cli.rst --- docs/service/mllm_cli.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/service/mllm_cli.rst b/docs/service/mllm_cli.rst index c1f652c21..907ab1a62 100644 --- a/docs/service/mllm_cli.rst +++ b/docs/service/mllm_cli.rst @@ -8,7 +8,7 @@ This document describes the MLLM command-line interface (CLI) tool, which operat **Currently, the system officially supports the following models:** -* **LLM**: ``mllmTeam/Qwen3-0.6B-w4a32kai、mllmTeam/Qwen3-4B-w4a8-i8mm-kai`` +* **LLM**: ``mllmTeam/Qwen3-0.6B-w4a32kai,mllmTeam/Qwen3-4B-w4a8-i8mm-kai`` * **OCR**: ``mllmTeam/DeepSeek-OCR-w4a8-i8mm-kai`` This guide covers three main areas: @@ -285,4 +285,4 @@ You should now be able to interact with the model from the client terminal. Type adb forward tcp:8081 tcp:8080 3. **Open Chatbox**: - Open the Chatbox application on your host machine and configure it according to the "Alternative Client: Chatbox" section above. You can now chat with the model through the GUI. \ No newline at end of file + Open the Chatbox application on your host machine and configure it according to the "Alternative Client: Chatbox" section above. You can now chat with the model through the GUI. From db6e8ff8eccfe0e0c017a9f17ddc9fe2b6dd29d5 Mon Sep 17 00:00:00 2001 From: yuerqiqi <2500526025@qq.com> Date: Wed, 14 Jan 2026 21:48:09 +0800 Subject: [PATCH 3/3] Fix formatting of cgo CFLAGS in c.go --- mllm-cli/mllm/c.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mllm-cli/mllm/c.go b/mllm-cli/mllm/c.go index c0431196c..cacaab1d5 100644 --- a/mllm-cli/mllm/c.go +++ b/mllm-cli/mllm/c.go @@ -4,7 +4,7 @@ package mllm /* -#cgo CFLAGS: -std=c11 +#cgo CFLAGS: -std=c11 #cgo LDFLAGS: -lMllmSdkC -lMllmRT -lMllmCPUBackend #include "mllm/c_api/Runtime.h" @@ -142,4 +142,4 @@ func (s *Session) PollResponse(requestID string) string { func (s *Session) SessionID() string { return s.sessionID -} \ No newline at end of file +}