I am building Agency functionality for my Local Custom Gemma3 . I am using Termux to develop and implement. To date I have built the Functionality Script named Gemi.sh , which allows for the use of tools and handling permissions, the Model reads and writes it’s contextual memories . Saving them within the Sandboxdir. Also I have built the Agency script which I called Gemi_Agent.sh this script handles sandboxing and script calling as well as Json parsing. I have spent the last 15 Months building a conceptual and descriptive overview of a Neural Network and it’s architectural design which I turned into a python script called. NNAD_script.py. when launching the Gemi_Agent.sh script all three of these work in unison creating the starting foundation for an A.I operating system. I can post my script code if needed. I am looking for someone to assist me or join my coding journey and my team if anyone out there in the big interweb world has interest please feel free to contact me.
Here is the list of the .sh script files I am Busy with…
*1 An executable without the .sh file extension it’s Called “Gemi”
*2 Bootstrap.sh this file contains the basic script for a bootload function
*3 Gemi_Memory.sh this file contains all the directories and file paths
*4 Gemi.sh there’s file contains the functionality features this is basically all the tools and permission to use those tools
*5 Gemi_Agent.sh this file is responsible for the agency aspect which allows the model to perform autonomous actions but the model still requires permission
*6 Gemi_Orca.sh this file is basically and all-in-one file instead of building each section individuality and unifying them with a launch script the above mentioned file contains all the subsections in a singular build
*7 NNAD_script.py/.sh the following two files are basically my neural networks architectural design in Python and Bash format this allows me to turn the system into the architectural design
*8 NNAD_tool_script.sh/.py the above mentioned two files oh specifically build in this manner to allow the previous script files to call the neural network as an executable
And those are the eight files I am currently using if you’d like to see some of the Script or Code line I am willing to post the files with content
I will list packages and troubleshooting guides separately. Now When starting setup on a Mobile device installing Termux is critical. Once the model has finished downloading (for this example im downloading from KAGGLE as a tar.gz file ) You will need to move your GZ model file into your home directory, Using the mv command followed by the path to your home dir. You can create storage directories as you please but , when cloning the llama.cpp dir from GitHub you will have to start in your home directory you cannot place the llama.cpp and respective file paths into an already existing dir. This causes several problems. There after you will need to make a dir using mkdir build followed by the Cmake command to setup the models basic interactions and functions. Please note (/data/data/com.termux/files/home/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-impl.h ) you might have to edit this file using for example nano. And once the setup is complete using either .build/bin or .bin/llama-cli you can launch the model , example launch command (.build/bin -m “YOURMODELFILELOCATIONPATH” ) USING the following -n 750 -c 1000 allows you to control the models contextual understanding and usage.
These are the following explanations that I am progressively typing in the meanwhile as I finish here 's what I’m doing so you can wrap your mind around it…
P.I.C.F.D.A.L: prompted interactive contextualized feedback driven AI learning
Memory context token reduction via detokenization and contextual compression:
Training Guide:
Model-Development introduction:
Requirements and dependencies indexing:
Termux-Dependencies:
Chosen-Model-Dependencies:
QAT’s/LQM’s&More:
Script Building Setup:
~/G3M_DIR/GemiScripts <~~~#THE DIRECTORY I AM USING >
$ ls
GLS.sh Gemi_Agency.sh Gemi_Memory.sh Gemi_Tools.sh
Gemi Gemi_Bootstrap.sh Gemi_Notes.sh NNAD.py #SEGEMENTED SCRIPT FILES
~/G3M_DIR/GemiScripts $
Difficulties I’ve encountered:
Cmake and make:
Deprecations:
Pip install:
Neon error:
Duplicate file suggestion:
TRAINING GUIDE SETUP: mobility and personalization of A.I—-
Training Prepatory Planning-
Proper
planning
prevents
piss
poor
performance…..!
Training Sessions:
Building Sessions:
BETA-PHASE:
Running your A.I Locally:
I will update this Thread as Frequently as I can but in the meantime if you have any questions please feel free to ask.! The Forum threads and Mod’s are quite. Busy!..
P.I.C.F.D.A.L:
Prompted Interactive Contextualized Feedback Driven A.I Learning
Memory context token reduction via detokenization and contextual compression:
When facing a smaller token count or context window often times you might need to consider context compression, now within every interaction environment and any interaction between the user and the AI the back and forth of information in prompt add up to a hefty amount of contextual tokenization. A simple method I apply to utilize contextual compression
Is by applying anchor posts now this term represents your models responses.for a Starting point my suggest that you only use a few to begin with until you’re familiarized with the concept so basically new apply the prompted interactive contextualized feedback driven learning method and by having the model respond in that manner it contextually and comprehensively from its own perceptive state understand it’s response and why the response was made in such a manner. So basically reducing the need for my input to be saved in the context window…
Training Guide:
Model-Development introduction:
Requirements and dependencies indexing:
Termux-Dependencies:
My complete package list:
pkg list-installed
Listing… Done
7zip/stable,now 24.09 arm [installed]
abseil-cpp/stable,now 20250127.1 arm [installed,automatic]
apt/stable,now 2.8.1-1 arm [installed]
autoconf/stable,now 2.72 all [installed]
automake/stable,now 1.17 all [installed]
bash/stable,now 5.2.37-2 arm [installed]
bc/stable,now 1.08.2 arm [installed,auto-removable]
binutils-bin/stable,now 2.44-3 arm [installed,automatic]
binutils-libs/stable,now 2.44-3 arm [installed,automatic]
binutils/stable,now 2.44-3 arm [installed]
bison/stable,now 3.8.2-3 arm [installed,auto-removable]
brotli/stable,now 1.1.0-2 arm [installed,automatic]
bzip2/stable,now 1.0.8-6 arm [installed]
c-ares/stable,now 1.34.5 arm [installed,automatic]
ca-certificates/stable,now 1:2025.02.25 all [installed]
ccache/stable,now 4.11.3 arm [installed]
clang/stable,now 20.1.6 arm [installed]
cmake/stable,now 3.31.6 arm [installed]
cmatrix/stable,now 2.0 arm [installed]
command-not-found/now 2.4.0-79 arm [installed,local]
coreutils/stable,now 9.6-1 arm [installed]
curl/stable,now 8.14.1 arm [installed]
dash/stable,now 0.5.12 arm [installed]
dbus/stable,now 1.16.2-1 arm [installed,automatic]
debianutils/now 5.23.1 arm [installed,local]
dialog/stable,now 1.3-20240307-0 arm [installed]
diffutils/stable,now 3.12 arm [installed]
djvulibre/stable,now 3.5.28-6 arm [installed,automatic]
dos2unix/stable,now 7.5.2 arm [installed]
dpkg/stable,now 1.22.6-1 arm [installed]
ed/stable,now 1.21.1 arm [installed]
espeak/stable,now 1.52.0 arm [installed]
fftw/stable,now 3.3.10-3 arm [installed,automatic]
findutils/stable,now 4.10.0 arm [installed]
flex/stable,now 2.6.4-3 arm [installed,auto-removable]
fmt/stable,now 1:11.1.4 arm [installed,automatic]
fontconfig/stable,now 2.16.2 arm [installed,automatic]
freetype/stable,now 2.13.3 arm [installed,automatic]
fribidi/stable,now 1.0.16 arm [installed,automatic]
gawk/stable,now 5.3.1 arm [installed]
gdbm/stable,now 1.25 arm [installed,automatic]
gdk-pixbuf/stable,now 2.42.12-3 arm [installed,automatic]
ghostscript/stable,now 10.03.1-3 arm [installed,automatic]
giflib/stable,now 5.2.2 arm [installed,automatic]
git/stable,now 2.49.0 arm [installed]
glib/stable,now 2.84.2 arm [installed,automatic]
golang/stable,now 3:1.24.2 arm [installed]
gperf/stable,now 3.3 arm [installed,auto-removable]
gpgv/stable,now 2.5.5 arm [installed]
graphviz/stable,now 12.2.1 arm [installed,automatic]
grep/stable,now 3.12 arm [installed]
gzip/stable,now 1.14 arm [installed]
harfbuzz/stable,now 11.2.1 arm [installed,automatic]
imagemagick/stable,now 7.1.1.47-1 arm [installed]
imath/stable,now 3.1.12 arm [installed,automatic]
inetutils/stable,now 2.6 arm [installed]
jbig2dec/stable,now 0.20 arm [installed,automatic]
jq/stable,now 1.8.0 arm [installed]
jsoncpp/stable,now 1.9.6-1 arm [installed,automatic]
krb5/stable,now 1.21.3 arm [installed,automatic]
ldns/stable,now 1.8.4 arm [installed,automatic]
less/stable,now 668 arm [installed]
libandroid-execinfo/stable,now 0.1-1 arm [installed,automatic]
libandroid-glob/stable,now 0.6-2 arm [installed]
libandroid-posix-semaphore/stable,now 0.1-3 arm [installed,automatic]
libandroid-selinux/stable,now 14.0.0.11 arm [installed]
libandroid-shmem/stable,now 0.5 arm [installed,automatic]
libandroid-spawn/stable,now 0.3 arm [installed,automatic]
libandroid-support/stable,now 29 arm [installed]
libandroid-utimes/stable,now 0.4 arm [installed,automatic]
libaom/stable,now 3.12.1 arm [installed,automatic]
libarchive/stable,now 3.8.1 arm [installed,automatic]
libassuan/stable,now 3.0.2 arm [installed]
libbz2/stable,now 1.0.8-6 arm [installed]
libc++/stable,now 27c arm [installed]
libcairo/stable,now 1.18.4-1 arm [installed,automatic]
libcap-ng/stable,now 2:0.8.5 arm [installed]
libcompiler-rt/stable,now 20.1.6 arm [installed,automatic]
libcrypt/stable,now 0.2-5 arm [installed,automatic]
libcurl/stable,now 8.14.1 arm [installed]
libdav1d/stable,now 1.5.1 arm [installed,automatic]
libdb/stable,now 18.1.40-4 arm [installed,automatic]
libde265/stable,now 1.0.16 arm [installed,automatic]
libedit/stable,now 20240517-3.1-0 arm [installed,automatic]
libevent/stable,now 2.1.12-2 arm [installed]
libexpat/stable,now 2.7.1 arm [installed,automatic]
libffi/stable,now 3.4.7 arm [installed,automatic]
libflac/stable,now 1.5.0 arm [installed,automatic]
libgcrypt/stable,now 1.11.1 arm [installed]
libgd/stable,now 1:2.3.3-4 arm [installed,automatic]
libgmp/stable,now 6.3.0-1 arm [installed]
libgnutls/stable,now 3.8.9 arm [installed]
libgpg-error/stable,now 1.55 arm [installed]
libgraphite/stable,now 1.3.14-2 arm [installed,automatic]
libgts/stable,now 0.7.6-1 arm [installed,automatic]
libheif/stable,now 1.19.8 arm [installed,automatic]
libhiredis/stable,now 1.3.0 arm [installed,automatic]
libiconv/stable,now 1.18 arm [installed]
libicu/stable,now 77.1-1 arm [installed,automatic]
libidn2/stable,now 2.3.8 arm [installed]
libidn/stable,now 1.43 arm [installed,automatic]
libimagequant/stable,now 4.3.4 arm [installed,auto-removable]
libjasper/stable,now 4.2.5 arm [installed,automatic]
libjpeg-turbo/stable,now 3.1.0 arm [installed,automatic]
libjxl/stable,now 0.11.1 arm [installed,automatic]
libllvm/stable,now 20.1.6 arm [installed,automatic]
liblqr/stable,now 0.4.3 arm [installed,automatic]
libltdl/stable,now 2.5.4-1 arm [installed,automatic]
liblz4/stable,now 1.10.0 arm [installed]
liblzma/stable,now 5.8.1 arm [installed]
liblzo/stable,now 2.10-3 arm [installed,automatic]
libmd/stable,now 1.1.0 arm [installed]
libmp3lame/stable,now 3.100-6 arm [installed,automatic]
libmpfr/stable,now 4.2.1 arm [installed]
libnettle/stable,now 3.10.1 arm [installed]
libnghttp2/stable,now 1.65.0 arm [installed]
libnghttp3/stable,now 1.10.1 arm [installed]
libnpth/stable,now 1.6-2 arm [installed]
libogg/stable,now 1.3.5 arm [installed,automatic]
libopenblas/stable,now 0.3.29 arm [installed,auto-removable]
libopus/stable,now 1.5.2 arm [installed,automatic]
libpixman/stable,now 0.46.0 arm [installed,automatic]
libpng/stable,now 1.6.48 arm [installed,automatic]
libraqm/stable,now 0.10.2 arm [installed,automatic]
librav1e/stable,now 0.7.1-3 arm [installed,automatic]
libraw/stable,now 0.21.4 arm [installed,automatic]
libresolv-wrapper/stable,now 1.1.7-4 arm [installed,automatic]
librsvg/stable,now 2.60.0-3 arm [installed,automatic]
libsmartcols/stable,now 2.40.2-3 arm [installed]
libsndfile/stable,now 1.2.2-1 arm [installed,automatic]
libsoxr/stable,now 0.1.3-7 arm [installed,automatic]
libsqlite/stable,now 3.49.2 arm [installed,automatic]
libssh2/stable,now 1.11.1 arm [installed]
libtalloc/stable,now 2.4.2 arm [installed,automatic]
libtiff/stable,now 4.7.0 arm [installed,automatic]
libtirpc/stable,now 1.3.6 arm [installed]
libtool/stable,now 2.5.4-1 arm [installed]
libunbound/stable,now 1.23.0-1 arm [installed]
libunistring/stable,now 1.3 arm [installed]
libuuid/stable,now 2.40.2-3 arm [installed,automatic]
libuv/stable,now 1.51.0 arm [installed,automatic]
libvorbis/stable,now 1.3.7-2 arm [installed,automatic]
libwebp/stable,now 1.5.0-1 arm [installed,automatic]
libwebrtc-audio-processing/stable,now 1.3-2 arm [installed,automatic]
libx11/stable,now 1.8.12 arm [installed,automatic]
libx265/stable,now 4.1 arm [installed,automatic]
libxau/stable,now 1.0.12 arm [installed,automatic]
libxcb/stable,now 1.17.0 arm [installed,automatic]
libxdmcp/stable,now 1.1.5 arm [installed,automatic]
libxext/stable,now 1.3.6 arm [installed,automatic]
libxft/stable,now 2.3.9 arm [installed,automatic]
libxml2/stable,now 2.14.3 arm [installed,automatic]
libxrender/stable,now 0.9.12 arm [installed,automatic]
libzip/stable,now 1.11.4 arm [installed,automatic]
littlecms/stable,now 2.17 arm [installed,automatic]
lld/stable,now 20.1.6 arm [installed,automatic]
llvm/stable,now 20.1.6 arm [installed,automatic]
lsof/stable,now 4.99.4 arm [installed]
m4/stable,now 1.4.19-4 arm [installed,automatic]
make/stable,now 4.4.1 arm [installed]
nano/stable,now 8.4 arm [installed]
ncurses-ui-libs/stable,now 6.5.20240831-2 arm [installed,automatic]
ncurses/stable,now 6.5.20240831-2 arm [installed]
ndk-sysroot/stable,now 27c arm [installed]
net-tools/stable,now 2.10.0 arm [installed]
ninja/stable,now 1.12.1 arm [installed]
nodejs/stable,now 24.1.0 arm [installed]
oniguruma/stable,now 6.9.10 arm [installed,automatic]
openexr/stable,now 3.2.4 arm [installed,automatic]
openjpeg/stable,now 2.5.3 arm [installed,automatic]
openssh-sftp-server/stable,now 10.0p2-7 arm [installed,automatic]
openssh/stable,now 10.0p2-7 arm [installed,automatic]
openssl/stable,now 1:3.4.1 arm [installed]
pango/stable,now 1.56.3-1 arm [installed,automatic]
patch/stable,now 2.8 arm [installed]
patchelf/stable,now 0.18.0 arm [installed,auto-removable]
pcaudiolib/stable,now 1.3 arm [installed,automatic]
pcre2/stable,now 10.45 arm [installed]
perl/stable,now 5.38.2-3 arm [installed,automatic]
pkg-config/stable,now 0.29.2-2 arm [installed,automatic]
procps/stable,now 3.3.17-5 arm [installed]
proot/stable,now 5.1.107-65 arm [installed]
psmisc/stable,now 23.7 arm [installed]
pulseaudio/stable,now 17.0-1 arm [installed,automatic]
python-ensurepip-wheels/stable,now 3.12.10 all [installed,automatic]
python-pip/stable,now 25.1.1-1 all [installed,automatic]
python2/stable,now 2.7.18-14 arm [installed]
python/stable,now 3.12.10 arm [installed]
readline/stable,now 8.2.13 arm [installed]
resolv-conf/stable,now 1.3 arm [installed]
rhash/stable,now 1.4.6 arm [installed,automatic]
root-repo/stable,now 2.4-2 all [installed]
runit/stable,now 2.1.2-3 arm [installed,automatic]
sed/stable,now 4.9-1 arm [installed]
speexdsp/stable,now 1.2.1 arm [installed,automatic]
sudo/stable,now 1.2.0 all [installed]
tar/stable,now 1.35 arm [installed]
termux-am-socket/stable,now 1.5.0 arm [installed]
termux-am/stable,now 0.8.0-1 all [installed]
termux-api/stable,now 0.59.1 arm [installed]
termux-auth/stable,now 1.5.0 arm [installed,automatic]
termux-core/stable,now 0.4.0 arm [installed]
termux-exec/stable,now 1:2.4.0 arm [installed]
termux-keyring/stable,now 3.12-1 all [installed]
termux-licenses/stable,now 2.1 all [installed]
termux-services/stable,now 0.13-1 all [installed]
termux-tools/stable,now 1.46.0+really1.45.0 arm [installed]
ttf-dejavu/stable,now 2.37-8 all [installed,automatic]
unzip/stable,now 6.0-9 arm [installed]
util-linux/stable,now 2.40.2-3 arm [installed]
wget/stable,now 1.25.0 arm [installed]
xxhash/stable,now 0.8.3 arm [installed]
xz-utils/stable,now 5.8.1 arm [installed]
zlib/stable,now 1.3.1 arm [installed]
zstd/stable,now 1.5.7 arm [installed]
~ $
Chosen-Model-Dependencies:
gemma.cpp repositories cloning
cd ~ && git clone GitHub - google/gemma.cpp: lightweight, standalone C++ inference engine for Google's Gemma models. && cd gemma.cpp && mkdir build && cd build && cmake .. && make -j4
QAT’s/LQM’s&More:
LQM is widely used to Reference Quantative A.I Models , but what makes QAT’s so different is the utilization of limited resources. (Gemma - Google DeepMind)
Always make sure you have the right licensing in place and give Credit where credit is due.
But, Above all remember to remind yourself of your Responsibilities and Ethical standard of practice.
Difficulties I’ve encountered:
Cmake and make:
Although at first the Model launched and all was well but, the further we went into Development the more rebuilding Was needed up to where I had to rebuild the files imported from the roo repository just to have the model launch. So Cmake and Make however useful is quite treacherous, therefore I have decided to go with the gemma.cpp repositories, ( Keep in mind this is all happening on a Quad core 2GB Ram Mobile Device)
Deprecations:
Be aware that there are multiple Gemma3 files and repositories that have been Deprecated.
Pip install:
Neon error:
This error only occurs when having to alter some scripts in order to run the model properly.
Duplicate file suggestion:
I do have a tip keep a duplicate file of your most relevant files as when you are editing and removing constantly you might lose valuable time spent
Well folks , that’s all for now … Ill soon post more … As always I’m here to help in any way I can,