You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to build, deploy and use Kan-Agent in Kan-Linux
#52
Kan-Agent is our fully open-source, self-made(based on llama.cpp + PI), fully local AI and native agent subsystem of Kan-Linux. We hope it brings something revolutionary to the traditional Linux community, and we are glad to see it can work across all Linux desktop distros (such as Debian, Gentoo, SUSE Linux, Ubuntu, Fedora, CachyOS, Arch Linux, Pop!_OS, Omarchy Linux).
Below are the steps to build and deploy Kan-Agent in Kan-Linux (since Kan-Linux v0.3.4) or other x86-64 Linux desktop distros.
1. prerequisites
npm install -g bun # the only extra build tool (or: curl -fsSL https://bun.sh/install | bash)
x86‑64 machine with GPU (works with llama.cpp + ggml-vulkan backend)
x86‑64 machine without GPU (fast CPU and more than 32 GiB RAM)
2. download source code and build
git clone --depth=1 https://github.com/kan-linux/ggml-hexagon
cd ggml-hexagon
./scripts/build-run-ggmlvulkan-x86-linux.sh build (will automatically download Vulkan SDK and then build)
cd ..
git clone --depth=1 https://github.com/kan-linux/kan-agent
cd kan-agent
./build.sh build (builds kan-agent and assembles the self-contained release tree in`out/kan-agent`)
3. deploy
sudo ./build.sh deploy (deploy to `/opt/kan-agent`)
then place exactly one gemma-4-E4B_q4_0-it.gguf model(we will provide our fine-tunned model in the future) in its /opt/kan-agent/llm/ directory, the layout should be:
Options:
--list-models list the models available to this run
--help, -h show this help
--version, -v show version
[zhouwg@kan-linux kan-agent]$
4.2 kan-agent demo
sudo /opt/kan-agent/kan-agent "help me to install go"
[zhouwg@kan-linux kan-agent]$ sudo ./kan-agent "help me to install go"
Password:
[think] The user wants to install "go".
I need to determine the correct installation class (source build or official binary) for "go" using sys_inspect with action=list_catalog.
Once I have the component name and its source_type, I can proceed with the installation pipeline: repo_fetch -> install_audit -> (if source) sandbox_build -> atomic_deploy.
First step: Check the catalog for "go".
[tool] -> sys_inspect {"action":"list_catalog"}
[tool] <- sys_inspect ok (0ms)
[think] The catalog shows that go is available as an official binary with source_type=binary. The default version is 1.27.4.
I will proceed with the installation pipeline for go (binary class):
repo_fetch
install_audit
atomic_deploy
Step 1: repo_fetch for go.
[tool] -> repo_fetch {"component":"go","source_type":"binary"}
[tool] <- repo_fetch ok (67ms)
[think] Step 1 (repo_fetch) was successful. The workspace is /var/lib/kan-agent/workspace/go and the artifact is /var/lib/kan-agent/workspace/go/go1.27.4.linux-amd64.tar.gz.
Step 2: install_audit using the fetched workspace and source_type=binary.
[tool] -> install_audit {"source_type":"binary","workspace":"/var/lib/kan-agent/workspace/go"}
[tool] <- install_audit ok (1ms)
[think] Step 2 (install_audit) was successful. The audit passed.
I will call atomic_deploy. I don't have a specific verify_cmd, so I will omit it.
[tool] -> atomic_deploy {"artifact":"/var/lib/kan-agent/workspace/go/go1.27.4.linux-amd64.tar.gz","component":"go","v...
[tool] <- atomic_deploy ok (1798ms)
[think] All steps completed successfully.
repo_fetch succeeded.
install_audit succeeded.
atomic_deploy succeeded, resulting in generation 9.
I will now provide the final summary.
The installation of go (version 1.27.4) completed successfully. The component was fetched from the official source, passed the security audit, and was atomically deployed to generation 9.
4.3 kan-agent demo (install Google Chrome)
sudo ./kan-agent "help me install chrome"
[think] The user wants to install "chrome".
I need to determine if "chrome" is available in the official component catalog and what its source_type is.
I must use sys_inspect with action=list_catalog first, as per the rules, to check the catalog.
[tool] -> sys_inspect {"action":"list_catalog"}
[tool] <- sys_inspect ok (0ms)
[think] The component "chrome" is available in the catalog.
Its source_type is binary.
The default version is current.
The installation pipeline for source_type=binary is: repo_fetch -> install_audit -> atomic_deploy.
Step 1: repo_fetch.
I will use the component name "chrome" and the default version "current".
[tool] -> repo_fetch {"component":"chrome","source_type":"binary"}
[tool] <- repo_fetch ok (132ms)
[think] Step 1 (repo_fetch) was successful.
The workspace is /var/lib/kan-agent/workspace/chrome.
The artifact is /var/lib/kan-agent/workspace/chrome/google-chrome-stable_current_amd64.deb.
The version is current.
Step 2: install_audit.
I must run install_audit before deployment.
[tool] -> install_audit {"source_type":"binary","workspace":"/var/lib/kan-agent/workspace/chrome"}
[tool] <- install_audit ok (1ms)
[think] Step 2 (install_audit) was successful. The verdict is pass.
Step 3: atomic_deploy.
I will deploy the component using the artifact, component name, and version. Since no health check command was specified, I will omit verify_cmd.
[tool] -> atomic_deploy {"artifact":"/var/lib/kan-agent/workspace/chrome/google-chrome-stable_current_amd64.deb","com...
[tool] <- atomic_deploy ok (10026ms)
[think] Step 3 (atomic_deploy) was successful.
The component "chrome" was deployed successfully.
The final version deployed was 158.0.8127.88-1.
I can now provide the final summary.
The installation of chrome completed successfully. The component was fetched from the official source, passed the security audit, and was atomically deployed as version 158.0.8127.88-1.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Kan-Agent is our fully open-source, self-made(based on llama.cpp + PI), fully local AI and native agent subsystem of Kan-Linux. We hope it brings something revolutionary to the traditional Linux community, and we are glad to see it can work across all Linux desktop distros (such as Debian, Gentoo, SUSE Linux, Ubuntu, Fedora, CachyOS, Arch Linux, Pop!_OS, Omarchy Linux).
Below are the steps to build and deploy Kan-Agent in Kan-Linux (since Kan-Linux v0.3.4) or other x86-64 Linux desktop distros.
1. prerequisites
npm install -g bun # the only extra build tool (or: curl -fsSL https://bun.sh/install | bash)2. download source code and build
3. deploy
then place exactly one
gemma-4-E4B_q4_0-it.ggufmodel(we will provide our fine-tunned model in the future) in its/opt/kan-agent/llm/directory, the layout should be:4. kan-agent usage & demo
4.1 kan-agent usage
Usage: kan-agent "" one-shot: install/upgrade/rollback system components
kan-agent -p "" synonym of the above
Examples:
sudo kan-agent "帮我安装go"
sudo kan-agent "帮我升级go"
sudo kan-agent "install go"
Options:
--list-models list the models available to this run
--help, -h show this help
--version, -v show version
[zhouwg@kan-linux kan-agent]$
4.2 kan-agent demo
sudo /opt/kan-agent/kan-agent "help me to install go"[zhouwg@kan-linux kan-agent]$ sudo ./kan-agent "help me to install go"
Password:
[think] The user wants to install "go".
I need to determine the correct installation class (source build or official binary) for "go" using
sys_inspectwithaction=list_catalog.Once I have the component name and its
source_type, I can proceed with the installation pipeline:repo_fetch->install_audit-> (if source)sandbox_build->atomic_deploy.First step: Check the catalog for "go".
[tool] -> sys_inspect {"action":"list_catalog"}
[tool] <- sys_inspect ok (0ms)
[think] The catalog shows that
gois available as anofficial binarywithsource_type=binary. The default version is1.27.4.I will proceed with the installation pipeline for
go(binary class):repo_fetchinstall_auditatomic_deployStep 1:
repo_fetchforgo.[tool] -> repo_fetch {"component":"go","source_type":"binary"}
[tool] <- repo_fetch ok (67ms)
[think] Step 1 (
repo_fetch) was successful. The workspace is/var/lib/kan-agent/workspace/goand the artifact is/var/lib/kan-agent/workspace/go/go1.27.4.linux-amd64.tar.gz.Step 2:
install_auditusing the fetched workspace andsource_type=binary.[tool] -> install_audit {"source_type":"binary","workspace":"/var/lib/kan-agent/workspace/go"}
[tool] <- install_audit ok (1ms)
[think] Step 2 (
install_audit) was successful. The audit passed.Step 3:
atomic_deploy.I have:
component:goversion:1.27.4artifact:/var/lib/kan-agent/workspace/go/go1.27.4.linux-amd64.tar.gzI will call
atomic_deploy. I don't have a specificverify_cmd, so I will omit it.[tool] -> atomic_deploy {"artifact":"/var/lib/kan-agent/workspace/go/go1.27.4.linux-amd64.tar.gz","component":"go","v...
[tool] <- atomic_deploy ok (1798ms)
[think] All steps completed successfully.
repo_fetchsucceeded.install_auditsucceeded.atomic_deploysucceeded, resulting in generation 9.I will now provide the final summary.
The installation of
go(version 1.27.4) completed successfully. The component was fetched from the official source, passed the security audit, and was atomically deployed to generation 9.4.3 kan-agent demo (install Google Chrome)
[think] The user wants to install "chrome".
I need to determine if "chrome" is available in the official component catalog and what its
source_typeis.I must use
sys_inspectwithaction=list_catalogfirst, as per the rules, to check the catalog.[tool] -> sys_inspect {"action":"list_catalog"}
[tool] <- sys_inspect ok (0ms)
[think] The component "chrome" is available in the catalog.
Its
source_typeisbinary.The default version is
current.The installation pipeline for
source_type=binaryis:repo_fetch->install_audit->atomic_deploy.Step 1:
repo_fetch.I will use the component name "chrome" and the default version "current".
[tool] -> repo_fetch {"component":"chrome","source_type":"binary"}
[tool] <- repo_fetch ok (132ms)
[think] Step 1 (
repo_fetch) was successful.The workspace is
/var/lib/kan-agent/workspace/chrome.The artifact is
/var/lib/kan-agent/workspace/chrome/google-chrome-stable_current_amd64.deb.The version is
current.Step 2:
install_audit.I must run
install_auditbefore deployment.[tool] -> install_audit {"source_type":"binary","workspace":"/var/lib/kan-agent/workspace/chrome"}
[tool] <- install_audit ok (1ms)
[think] Step 2 (
install_audit) was successful. The verdict ispass.Step 3:
atomic_deploy.I will deploy the component using the artifact, component name, and version. Since no health check command was specified, I will omit
verify_cmd.[tool] -> atomic_deploy {"artifact":"/var/lib/kan-agent/workspace/chrome/google-chrome-stable_current_amd64.deb","com...
[tool] <- atomic_deploy ok (10026ms)
[think] Step 3 (
atomic_deploy) was successful.The component "chrome" was deployed successfully.
The final version deployed was
158.0.8127.88-1.I can now provide the final summary.
The installation of chrome completed successfully. The component was fetched from the official source, passed the security audit, and was atomically deployed as version 158.0.8127.88-1.
All reactions