| Requirement | Specification |
|---|---|
| Platform | Termux on Android, or any Linux system |
| RAM | 6 GB+ available |
| Storage | ~10 GB (7B model + 0.5B model + Codey) |
| Python | 3.12+ |
| Packages | rich, numpy, watchdog |
./install.shThis handles everything below automatically. If you prefer full control, follow the manual steps.
pkg install cmake ninja clang python
pip install rich numpy watchdoggit clone https://github.com/ggerganov/llama.cpp ~/llama.cpp
cd ~/llama.cpp
cmake -B build -DLLAMA_CURL=OFF # disables optional libcurl dependency (unavailable on Termux; not needed for local inference)
cmake --build build --config Release -j4The build takes 10–20 minutes on a modern Android device.
Primary model — Qwen2.5-Coder-7B (~4.7 GB)
mkdir -p ~/models/qwen2.5-coder-7b
cd ~/models/qwen2.5-coder-7b
wget https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/main/qwen2.5-coder-7b-instruct-q4_k_m.ggufPlanner/summarizer model — Qwen2.5-0.5B (~400 MB)
mkdir -p ~/models/qwen2.5-0.5b
cd ~/models/qwen2.5-0.5b
wget https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q8_0.ggufEmbedding model — nomic-embed-text-v1.5 (~80 MB)
mkdir -p ~/models/nomic-embed
cd ~/models/nomic-embed
wget https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.Q4_K_M.ggufgit clone https://github.com/Ishabdullah/Codey.git ~/codey-v2
cd ~/codey-v2
chmod +x codey2 codeyd2echo 'export PATH="$HOME/codey-v2:$PATH"' >> ~/.bashrc
source ~/.bashrcOther shells: For
zsh, replace~/.bashrcwith~/.zshrc. For fish, addset -x PATH $HOME/codey-v2 $PATHto~/.config/fish/config.fish. For a universal fallback, add the export to~/.profile.
codey2 --version
codeyd2 statusSetting up a local knowledge base significantly improves response quality. See knowledge-base.md for the full guide.
You can personalize the model using your own interaction history. See fine-tuning.md for the full workflow.
The pipeline/ directory contains a full data ingestion and transformation pipeline that builds fine-tuning datasets in ShareGPT format from open-source HuggingFace datasets and synthetic corpora.
The pipeline has additional dependencies beyond the base Codey-v2 install. The install order matters on Termux — some packages with C extensions must be installed via pkg (pre-built ARM binaries); pip cannot compile them on aarch64.
pkg install python-pyarrow python-pandasDo not use
pip install pyarroworpip install pandason Termux. Pip will attempt to compile from source and fail with Rust/meson/Cython errors on aarch64. Thepkgversions (pyarrow 23.0.1, pandas 3.0.1 as of this writing) are pre-built and work immediately.
pip install datasets huggingface-hub "fsspec==2026.2.0" \
httpcore httpx typer tqdm hnswlib \
aiohttp multiprocess dill xxhash pyyaml \
filelock requestsKey notes:
-
fsspec==2026.2.0must be pinned. Thedatasets4.8.4 library is incompatible withfsspec>=2026.3.0. Installing without the pin causes anImportErrorat runtime. If you already have a newer fsspec, downgrade:pip install "fsspec==2026.2.0". -
hnswlibbuild requires clang. If you haven't installed clang already (for llama.cpp), runpkg install clang cmakefirst. If hnswlib fails to build for any reason, the pipeline automatically falls back to numpy brute-force cosine search — you do not need hnswlib for the pipeline to work. -
hf-xetbuild failures are harmless. You may seeERROR: Failed to build 'hf-xet'duringpip install datasets. This is an optional Rust extension used only for HuggingFace uploads; it is not used by the pipeline. Ignore it. -
Embedding backend. The pipeline defaults to the nomic-embed-text llama-server already running on port 8082.
sentence-transformersis an optional 384-dim fallback that requires PyTorch, which is unavailable on Termux/Android. Only install it if you are running the pipeline on a desktop Linux machine.
python pipeline/run.py --synthetic-onlyThis generates two synthetic JSONL corpora (~5K Termux CLI examples and ~3K multi-step patterns) without downloading anything from HuggingFace. Expected output:
Synthetic Termux corpus: 5,780 records → pipeline_output/synthetic/synthetic_termux.jsonl
Synthetic multi-step corpus: 50 records → pipeline_output/synthetic/synthetic_multistep.jsonl
Output records: 5,830 (100.0% retention)
| Component | Size |
|---|---|
| Base Codey-v2 (models + toolchain) | ~6 GB |
| Pipeline dependencies (pip packages) | ~800 MB |
| HuggingFace dataset cache (phase 1, streaming) | minimal — only processed records kept |
| Pipeline output (training_data.jsonl + index) | ~50–500 MB depending on record count |
| Total with pipeline | ~7–8 GB |
If you download all HuggingFace datasets locally instead of streaming, add ~4 GB for phase 1, ~3 GB for phase 2, and ~6 GB for phase 3. Streaming mode (the default) avoids this entirely.
See pipeline.md for the full pipeline guide.