IICSM AI Development

LINUX · LOCAL MODELS · YOUR CONVERSATIONAL COMPANION

Build an AI brain
you can talk to.

Start with your Linux computer. Add local language, hearing, speech and deliberate memory—one verified step at a time.

Updated 1 November 2026 (UTC) · English CPU-first starter · No cloud subscription required

1. What you will build

A private, local conversational companion on your Linux computer: type a question or intentionally record your voice, read and hear the answer, and save a few facts you want it to remember.

This is a practical “AI brain”: an existing language model plus hearing, speech, a controller, and explicit memory. It is not a human brain, consciousness, or a self-training system. You do not need to train an LLM, buy a robot, or pay for an API subscription to start.

Keyboard / microphone→Confirm transcript→Qwen + saved facts→Text + Piper speech

Baseline: Ubuntu 24.04 LTS Desktop, x86_64, Python 3.12, English conversation, a modern CPU. No dedicated GPU is required for this CPU-first path. Start with 16 GB RAM; 32 GB is more comfortable. These are planning targets, not measured performance guarantees. The earlier movie GPU requirements do not apply to this small chat setup.

First successful result: you type a question and get a local answer. Then make speech output work, then microphone input, then verify remembered facts after restarting. Later upgrades are separate milestones.

Download the companion starter → · Shopping checklist · Budget JSON

2. Complete buying checklist and estimated cost

All amounts below are USD planning allowances, not current vendor quotes. Buy only what you lack. Every physical item is quantity one unless described as a set. The base list reuses your computer, display, keyboard, mouse, power supply and network. A headset replaces separate microphone and speakers and reduces acoustic feedback.

Item / specificationWhen neededAllowance USDPurchase website and selection notes
Existing Linux computerRequired; reuse$0.00Purchase / configure
x86_64 modern 4+ core CPU; 16 GB RAM starting target, 32 GB preferred; 50 GB free space; 1 TB SSD preferred. Working power supply/cooling included.
Monitor, keyboard and mouseRequired; reuse$0.00Purchase / configure
Reuse your normal desktop peripherals; a laptop already includes these.
Internet / home routerRequired initially; reuse$0.00Use existing service
For software/model downloads. Local conversations can be tested offline afterward; no paid cloud plan.
Logitech H390 wired USB headset, quantity 1Primary purchase allowance$40.00Purchase / configure
One device provides microphone and headphones. Choose USB-A or USB-C to match your computer; verify Ubuntu recording/playback during the return window. Not a Linux certification claim.
External 1 TB USB SSD, quantity 1Recommended backup allowance$90.00Purchase / configure
For an independent backup of program, facts and configuration. Product family link: choose exact capacity/connector at checkout. Avoid proprietary security software dependencies.
Linux desktop/mini PC, 32 GB RAM, 1 TB SSD, quantity 1New-computer alternative allowance$1,300.00Purchase / configure
Only if you do not own a suitable machine. Use manufacturer configurator for 32 GB RAM and 1 TB storage; request a quote and compatible Ubuntu version. This is a budget, not an exact configured quote.
24-inch 1080p monitor with compatible cableNew-computer alternative allowance$120.00Purchase / configure
Only if needed. Match HDMI/DisplayPort and confirm cable is included.
USB keyboard and mouse setNew-computer alternative allowance$30.00Purchase / configure
Only if needed; select a connector compatible with the computer.
Powered USB hub with supplyOptional allowance; excluded$20.00Purchase / configure
Only if short of ports. No hub is needed when headset and SSD connect directly.
USB webcamOptional allowance; excluded$30.00Purchase / configure
Not used by this voice/text starter. Add only in the later vision phase.
UPS with sufficient rating for your computerOptional allowance; excluded$120.00Purchase / configure
Choose by actual watts and required runtime; useful for desktop power interruptions.
ScenarioItems15% contingencyShipping reserveTax/import reservePlanned total
Reuse suitable Linux PC$130.00$19.50$20.00$20.00$189.50
Buy computer + monitor + input set$1,580.00$237.00$50.00$170.00$2,037.00

Program/model downloads have no required subscription fee in this plan. Electricity, existing Internet, your time, repair, and future upgrades are excluded. The headset and PC pages were reviewed directly; the SSD and other supplier links are sourcing references. A purchase link alone does not establish stock or Linux compatibility.

Sources: [11], [12], [13]

3. Programs and models to install

Program / modelPurposeInstalled by
Ubuntu 24.04 LTS DesktopOperating system; keep a working existing installationUbuntu official installer only if needed
Python 3 + venv + pipRun the companion in its own environmentapt + python3 -m venv
curl, unzip, ca-certificatesDownload and unpack the starter and runtimeapt
FFmpeg / ffplay, ALSA tools, PortAudioPlay speech and inspect microphone hardwareapt: ffmpeg alsa-utils libportaudio2
Ollama + qwen3:4bLocal language understanding and response generationOfficial installer; ollama pull
faster-whisper 1.2.1 + base.enEnglish speech-to-text, CPU int8pip requirements; model fetched on first use
piper-tts 1.8.0 + en_US-lessac-mediumLocal English speech outputpip requirements; Piper voice downloader
sounddevice 0.5.6 + NumPyExplicit microphone recording and silence checkpip requirements
SQLite via Python standard libraryStore up to twenty explicitly approved factsAlready included with normal Ubuntu Python
companion.pyConnect the components and manage the terminal conversationDownload this page’s three-file starter

Top-level package versions were checked on PyPI on 1 November 2026. Dependencies are resolved by pip; save the full environment after your own validation. No Docker, CUDA toolkit, ROS, training framework, cloud account or vector database is required for version 1.

Sources: [2], [3], [6], [7], [9], [10], [14], [15], [16]

4. Check Linux and prepare your computer

If Linux is already working, keep it. The commands below target Ubuntu 24.04 LTS; adapt package names for other distributions. If starting from a blank computer, follow Ubuntu’s official installer, back up existing files before changing partitions, and choose the correct disk. Installing to a disk can erase it. Enable disk encryption during installation if you need protection for saved facts when the computer is off.

Sources: [1]

bash · Linux terminal
cat /etc/os-release
uname -m
python3 --version
free -h
df -h "$HOME"
lsusb

sudo apt update
sudo apt install -y python3 python3-venv python3-pip curl unzip ca-certificates ffmpeg alsa-utils libportaudio2

mkdir -p ~/ai-brain/{models,data}
chmod 700 ~/ai-brain ~/ai-brain/data
cd ~/ai-brain
ffplay -version

Checkpoint: x86_64, Python 3.12 on Ubuntu 24.04, working desktop audio, at least 16 GB RAM as a starting target and 50 GB free disk headroom. Model downloads are smaller than this; space also supports environments and backups. Close heavy applications for your first test. A 1 TB system SSD is a convenient new-computer choice, not a model minimum.

5. Install Ollama and test the language model

bash · Linux terminal
curl -fsSL https://ollama.com/install.sh -o /tmp/ollama-install.sh
less /tmp/ollama-install.sh
# Press q to exit less after reviewing the script.
sh /tmp/ollama-install.sh
ollama --version
ollama pull qwen3:4b
ollama run qwen3:4b

The installer may ask for administrator access. If Ollama is already installed, check its version and service instead of reinstalling it. Ask: “Explain in two sentences what a local AI assistant can do.” Type /bye to leave Ollama’s own chat. This 4B quantized model is about a 2.5 GB download; runtime memory is higher. Do not substitute a cloud-tagged model for the offline test.

bash · Linux terminal
curl -fsS http://127.0.0.1:11434/api/tags
ollama show qwen3:4b
ollama ps
# Only if the local API is unavailable on a systemd installation:
systemctl status ollama --no-pager
# If installed as a service but stopped:
sudo systemctl start ollama

On a manual installation without a service, run ollama serve in another terminal. Do not start a second server when port 11434 is already in use. Keep Ollama bound to localhost; do not expose its unauthenticated API on your router or a public interface.

Checkpoint: Ollama responds before installing voice integration. A slow first reply can include loading the model; measure later replies too.

Sources: [2], [3], [4], [5]

6. Download, verify and install the companion

Run the commands from your normal user account. The starter contains three readable files, not model weights. Review companion.py and README.txt before running. Keep this separate from the movie starter and its environment.

bash · Linux terminal
cd ~/ai-brain
curl -fLO https://iicsm.org/aidevel/ai-brain-starter.zip
curl -fLO https://iicsm.org/aidevel/ai-brain-starter.zip.sha256
sha256sum -c ai-brain-starter.zip.sha256
unzip -n ai-brain-starter.zip
less README.txt
less companion.py

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip check
python companion.py --help

Checkpoint: the checksum says OK, pip reports no broken requirements, and the help text appears. unzip -n preserves existing files. For a future starter upgrade, compare files in a separate directory rather than assuming that command overwrites them. A checksum downloaded from this same site checks transfer consistency, not independent publisher identity.

7. Get typed conversation working first

bash · Linux terminal
cd ~/ai-brain
source .venv/bin/activate
python companion.py --text

At You>, type “My goal is to learn Linux. Suggest one simple exercise.” Then ask a follow-up. The app sends messages only to Ollama at 127.0.0.1:11434. In text mode it does not import the microphone or speech libraries. The last six question/answer turns are available as temporary conversation context; this is limited context, not complete lifelong recall.

Type /reset to clear the current conversation, or /quit to exit. Ctrl+C at the prompt also stops it. Do not run this program with sudo. Model answers may be wrong; the starter can describe shell commands but cannot execute them.

Checkpoint: a question and follow-up work. Quit and restart: the ordinary conversation is gone. This is intentional; persistent facts are added in step 10.

8. Download a voice and test speech output

bash · Linux terminal
cd ~/ai-brain
source .venv/bin/activate
cd models
python -m piper.download_voices en_US-lessac-medium
ls -l en_US-lessac-medium.onnx en_US-lessac-medium.onnx.json
python -m piper -m en_US-lessac-medium -f test.wav -- 'Hello. Your local AI voice is working.'
ffplay -nodisp -autoexit -loglevel error test.wav
cd ..

Select the USB headset as the output device in Ubuntu Settings → Sound. Start at a low volume. Both the ONNX file and its matching JSON configuration must remain in ~/ai-brain/models/. Read the voice-specific model card: engine licensing and a particular voice’s dataset/model terms are separate.

Checkpoint: you hear the sentence through the selected device. Piper loads the voice for each reply in this minimal starter, which adds latency. A persistent speech service is a later optimization.

Sources: [7], [8], [17]

9. Test hearing and then the complete voice loop

bash · Linux terminal
cd ~/ai-brain
source .venv/bin/activate
arecord -l
python -m sounddevice
python - <<'PY'
from faster_whisper import WhisperModel
WhisperModel("base.en", device="cpu", compute_type="int8")
print("English speech model downloaded and ready.")
PY
python companion.py

Select the headset microphone in Ubuntu Settings → Sound and verify its input meter moves. At You>, press Enter with no text to start a six-second recording. Speak after “Recording” appears. Wait for the printed transcript. Type y to submit it; press Enter to discard and retry. You can type a corrected request at the next prompt.

The microphone records only during that requested interval and stops before inference and playback. There is no always-on listener. The model’s answer prints and is then spoken. A silence-level check and speech activity detection reduce empty recordings, but they do not prove the transcript is correct. Whisper recognizes speech; environmental-sound classification is covered separately in the hearing models section.

bash · Linux terminal
# Optional overrides: replace 3 with the actual INPUT device ID.
python companion.py --device 3 --seconds 10
# If your microphone rejects 16000 Hz, try its supported rate:
python companion.py --device 3 --rate 48000

Checkpoint: successfully record, read, confirm, receive and hear three short questions. Intentionally discard one wrong transcript. Try silence: verify no request is accepted accidentally. The app stays in English with base.en; multilingual support requires changing both recognition configuration and the voice, then retesting.

Sources: [6], [9]

10. Add controlled memory and test it after restarting

Type these commands at You>, not in Bash. They are handled by Python before a request reaches the model.

companion prompt · Linux terminal
/remember preferred_name = Alex
/remember learning_goal = Learn Linux and build a local AI companion
/facts

Ask “What learning goal have I asked you to remember?” Quit with /quit, restart the companion, then run /facts and ask again. Only explicitly entered /remember facts persist in ~/ai-brain/data/memory.sqlite3. Saying “remember this” in ordinary conversation does not automatically save it.

companion prompt · Linux terminal
/forget preferred_name
/facts
/reset
/quit

/forget removes that key and clears current conversation to avoid reintroducing it from earlier turns. /reset clears conversation but leaves saved facts. There are at most twenty saved facts, each with a 50-character key and 300-character value; replace a key to correct it. This intentionally small store sends its facts as context. It is not a vector database, model training, proof of truth, or unlimited memory.

Saved facts and backups are plain data on disk; private file permissions do not encrypt them. Avoid passwords and secrets. Review facts directly rather than trusting the model’s claim that it saved something. The Python controller is the source of truth.

Sources: [10]

11. Local operation, daily use and backup

Initial software/model downloads use the Internet. The conversation path uses your locally downloaded model and the loopback API; it has no cloud API key. Keep cloud models and optional cloud tools out of this starter. After all weights are downloaded, temporarily disconnect Wi-Fi/Ethernet and test typed and spoken questions. A failed download while offline means some weights are still missing.

The app does not save raw audio or chat logs. Temporary WAV files are removed on normal cleanup; that is not secure erasure and a crash may leave temporary files. Ollama and your OS can have separate logs. Disk encryption, a locked login and protected backups matter. The browser hosting this guide does not access your microphone or run these programs.

bash · Linux terminal
# Start each session manually; no background listener is configured.
cd ~/ai-brain
source .venv/bin/activate
python companion.py

# After quitting every copy, record the working environment:
python -m pip freeze > installed-packages.txt
ollama --version > ollama-version.txt
ollama show qwen3:4b > model-info.txt
sha256sum models/*.onnx models/*.onnx.json > voice-checksums.txt

# Set this to the actual mounted path of YOUR independent backup drive.
backup_dir="/media/$USER/AI_BACKUP"
if [ -d "$backup_dir" ] && mountpoint -q "$backup_dir"; then
  tar -czf "$backup_dir/ai-brain-$(date +%Y%m%d-%H%M%S).tar.gz"     companion.py requirements.txt README.txt data models     installed-packages.txt ollama-version.txt model-info.txt voice-checksums.txt
else
  echo 'Backup drive not found; no backup was made. Check its mounted path.'
fi

The backup excludes the reproducible virtual environment and separate Ollama/Whisper caches. Restoring offline also requires preserving those model caches according to their tools’ documentation, or downloading them again. Inspect the archive with tar -tzf and restore a copy into a separate test directory before relying on it. Protect the archive because it contains your saved facts.

Sources: [5]

12. Acceptance checks before calling it usable

CheckPass condition
Typed chatFive short questions receive useful answers; a follow-up uses the current context.
HearingTen short quiet-room utterances: record exact transcript matches and meaning-changing errors. Inspect each transcript before accepting it.
SpeechTen replies are intelligible at comfortable volume with no clipping or feedback.
MemoryA saved fact appears after restart; deleting it removes it from /facts and subsequent fresh conversation.
PrivacyDownloaded models still answer with network disconnected; no conversation data is intentionally sent to a cloud service.
Failure recoveryStop Ollama once: see a readable failure, restart it and retry manually. A missing voice still leaves the printed answer.
Listening boundaryNo recording starts until Enter; microphone is inactive during TTS. Verify using your OS audio indicator/input tools if available.
PerformanceRecord speech-to-text time, LLM response time and TTS delay on your machine. There is no real-time or sub-second guarantee.
Backup restoreOpen a restored copy and verify /facts without overwriting the original database.

Suggested progression: day 1 typed chat; day 2 audio; day 3 memory and offline checks; days 4–7 improve prompts and test your own typical conversations. These are a learning schedule, not a completion-time promise. Write down failures before spending money on a larger model or GPU.

13. Troubleshooting

ProblemWhat to do
Connection refused / port in useCheck systemctl status ollama and /api/tags. Start one Ollama server, then retry.
Reply too slow / high RAM useClose other workloads; keep short turns; use ollama ps and free -h. Try qwen3:1.7b by pulling it and passing --model qwen3:1.7b; quality may change. A GPU upgrade needs a separate compatible driver/runtime plan.
pip install failsCheck Ubuntu/Python architecture and version, active .venv, free space and package error. Do not use sudo pip or modify system Python to force a wheel.
No input device / wrong microphoneCheck Ubuntu Sound settings, headset mute switch and python -m sounddevice; pass the actual input device ID. Do not assume example ID 3 is correct.
Invalid sample rateUse an advertised device rate such as --rate 48000. The recorded WAV includes that rate; Whisper decodes/resamples it.
Silence gate rejects quiet voiceMove microphone closer, unmute it and raise input gain. The starter threshold is a simple heuristic; do not disable transcript review.
Hallucinated or inaccurate transcriptDiscard it, reduce noise, adjust mic position or try --stt-model small.en after downloading it. Recognition accuracy is not guaranteed.
Text answer but no soundVerify ffplay test, output device, volume and both voice files. Use --text while diagnosing.
Cannot remember after restartUse /facts. Ordinary chat is not saved; /remember must confirm the key. Verify the data directory beside the script.
Offline startup tries to downloadComplete the exact Ollama, Whisper and Piper downloads online first using the same user and cache paths.
Interrupting takes too longCtrl+C interrupts the current call; the companion reports failure or exits. Use /quit at the prompt. No always-running service or robot action continues.

14. Upgrade only after the basic conversation passes

Next capabilityConcrete changeNew validation needed
Personal document retrievalIndex copies you choose; retrieve relevant text as untrusted context with source filenamesCheck citations and access boundaries; do not let document text issue tool instructions.
VisionAdd a webcam and a supported vision model; send a snapshot only when requestedVerify image consent and object descriptions; images are not depth sensing or identity proof.
Logic and calculationsAdd a bounded calculator or Z3 task with validated inputsCheck deterministic results; an LLM explanation alone is not a proof.
Faster / richer speechKeep TTS loaded; measure a larger STT model and dialogue modelTest CPU/GPU memory and full conversational latency before buying hardware.
Wake word, streaming and interruptionAdd local wake detection, streaming STT/TTS and echo cancellationTest accidental activations, visible listening state, hardware mute and interruption. Not supplied in this starter.
Robot bodyConnect only approved high-level requests to the separate guarded robot controllerFollow the existing biped plan and physical safety tests; this companion sends no robot commands.
Fine-tuningCollect consented, reviewed examples and compare held-out tasksFirst try prompting and retrieval; retain the base model and evaluate regressions.

All five AI model families · Optional fine-tuning workflow · Walking humanoid plan · Movie and agent guide

15. References and what was verified

Official software documentation and package metadata reviewed on 1 November 2026 (UTC). Budgets are this guide’s allowances. Vendor listings, software releases and model terms can change; check them before purchase or installation.

  1. Ubuntu — desktop installation walkthrough
  2. Ollama — Linux installation and service setup
  3. Qwen3 4B — local Ollama model entry
  4. Ollama — chat API and messages
  5. Ollama — local service, cloud features and network configuration
  6. SYSTRAN faster-whisper — installation, CPU int8 and VAD
  7. Piper — current local TTS CLI and voice download
  8. Piper Lessac medium — voice-specific model card and source license
  9. python-sounddevice — official Linux/PortAudio installation source
  10. Python — SQLite persistence API
  11. System76 — Meerkat Linux mini computer and configurator
  12. Logitech — H390 USB headset; select the connector you need
  13. Samsung — portable SSD product family; choose 1 TB and verify Linux/filesystem compatibility
  14. PyPI — faster-whisper published releases
  15. PyPI — piper-tts published releases
  16. PyPI — sounddevice published releases
  17. FFmpeg — ffplay audio playback reference

Documentation and starter verification

Checks cover starter Python syntax and logic, simulated Ollama requests, memory save/delete/restart behavior, fixed subprocess argument handling, shell-command syntax, download contents/checksums, page links and responsive rendering. Actual Linux installation, model inference, microphone capture, audio playback, offline operation and hardware performance have not been executed for this release. Run the acceptance checks on your machine. No items have been purchased.

This educational starter is a foundation you can inspect and extend. It does not provide guaranteed accuracy, secure secret storage, professional advice, an autonomous tool agent, or a physical robot controller. Each dependency, voice and model retains its own license.