|
|
|
|
| |
andrewjameslee
Thursday, 19 February 2026
Thursday, 7 August 2025
Running your own AI LLM locally on your computer
I recently purchased a new M4 Macbook Pro and was keen to see how well it performs. What better way then trying to run a local AI language model. While there are different ways to deploy LLMs, this post focuses on the quick and easy way and aims to compare it to what is available in the cloud. Why do you want to run a local LLM you may ask? Firstly the fact that it can be run offline and all of your prompt details are not sent to a third party (i.e. OpenAI / meta, google, etc.) and secondly because you can :)
For this post I am using LMStudio (https://lmstudio.ai/) which is extremely simple to download and install (uses approx 500MB of space). Once installed you are prompted to choose a model with the default being OpenAI's gpt-oss-20b (~12GB) - which you can read more about here.
Tuesday, 4 March 2025
Running Linux on Microsoft Surface 2 RT
Journey
Things that dont seem to work
Method
- Download the following files from open-rt.party and copy to a USB drive
- https://files.open-rt.party/Linux/Other/surface-2-linux-resizepart-emmc.zip
- https://github.com/andrewjameslee/surface2/blob/main/tegra114-microsoft-surface-2-all.dtb
- Download Raspberian - 2022-09-22-raspios-bullseye-armhf
- Theres a bunch of work needed for this:
- pull out root partition from image using dd and partx
- fix /etc/fstab for /dev/mmcblk0p5 to be the / partition
- put kernel modules to the /lib/modules/ directory to get the wifi working
- Boot into Windows RT and load disk management
- Shrink the windows partition to the smallest size (~16GB) and delete the recovery partition
- Create two new FAT32 paritions
- Partition 5 - FAT32 - ~6 GB
- Partition 6 - FAT 32 - ~5GB
- Copy the raspios-bullseye-root-image onto partition 6 (~4GB) and potentially kernel modules (used in later steps)
- Create Linux Bootable USB (Raspberian - 2022-09-22-raspios-bullseye-armhf using pi imager then copy boot files from surface-2-linux-resizepart-emmc.zip)
- Ensure the commandline.txt is configured correctly on USB (initrd=initrd.gz, root=/dev/ram0, init=/init.sh)
- Boot into Linux from USB
- mkdir /a
- mount /dev/mmcblk0p6 /a
- dd if=/a/raspios_armhf-2022-09-26/2022-09-22-raspios-bullseye-armhf-root.img of=/dev/mmcblk0p5 bs=1M status=progress
- mkdir /b
- mount /dev/mmcblk0p5 /b
- cp -Rp /a/lib/modules/* /b/lib/modules/
- nano /etc/fstab (add /dev/mmcblk0p5 / and hash out other entries)
- umount /a
- unmount /b
- sync
- CTRL-D (reboot)
- Ensure the commandline.txt is configured correctly on USB (root=/dev/mmcblk0p5) and a similar screen to the following should pop up
Boot from internal flash instead of USB
- mount EFI partition (linux = mmcblk0p2 | windows disk 0 partition 1)
- copy boot files to EFI partition (microsoft/boot, test.efi (shim to boot.efi), boot.efi (linux kernel), tegra114-microsoft-surface-2.dtb, commandline.txt, config.txt
- rename microsoft/boot to microsoft/boot_win
- copy in microsoft/boot to microsoft/boot which will load the test.efi policy to enable linux to boot
- can edit boot sequence from EFI partion in linux (mount /dev/mmcblk0p2)
- can edit boot sequence from EFI partion in windows (/dev/mmcblk0p2) diskpart, list disk, select disk 0, list partition, select partition 1, assign letter=b, exit
These steps allow for you to automatically reboot into your OS of choosing though it doesnt give you a nice menu selector with a time out like say GRUB does. Further consideration is to look into bcdedit to add a second boot menu option for test.efi though need to consider if you reboot the surface and you are prompted to choose a boot option this may not be possible if you are accessing remotely.
Other considerations
- consider compiling ARM32 ext driver for windows 8 - seems like cygwin would need to be compiled first, no one has compiled to date based on list of arm windows software
- other distributions like ubuntu 18 server seems to run on the surface2
- cross compiling custom kernels
#apt install git make gcc g++ device-tree-compiler bc bison flex libssl-dev libncurses-dev python3-ply python3-git libgmp3-dev libmpc-dev gcc-arm-linux-gnueabihf
#export ARCH=arm
#export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
#make surface-2_defconfig
Confirm the following is in .config
CONFIG_EFI=y
CONFIG_EFI_STUB=y
#make
Compiled zImage will be in arch/arm/boot/zImage which can be renamed to boot.efi
- initramfs attached to zImage (EFI Stub)
- compile kernel with CONFIG_INITRAMFS_SOURCE="/initram/fs/root/directory"
Sunday, 21 January 2024
The Cosmic Symphony: Where Faith and Science Dance
Saturday, 20 January 2024
Hypothesis for Further Investigation: Quantum Entanglement for Revolutionary Memory Storage
Wednesday, 17 January 2024
Hypothesis for Further Investigation: Using the Wilkinson Microwave Anisotropy Probe (WMAP) for Space Navigation around Black Holes and Stars
-
The Microsoft Surface 2 is an ARM32 based tablet which is largely defunct for many reasons which you can read all about online. The aim was ...
-
Recently upgraded to Windows 10 and noticed there was no driver available for the Belkin F5U257 USB to serial adapter on the below official ...
-
I'm on ADSL2+ and receive a flyer in the mail saying NBN is available in your area. So I pop on over to the NBN website, put in m...





