https://github.com/bot08/lede-llm-via-api
https://github.com/bot08/lede-llm-via-api
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bot08/lede-llm-via-api
- Owner: bot08
- Created: 2025-10-07T13:45:50.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-15T23:37:35.000Z (8 months ago)
- Last Synced: 2025-10-17T01:09:15.447Z (8 months ago)
- Language: Shell
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# AI Client on LEDE 17.01 (OpenWrt)
This project demonstrates how to run a simple AI client directly on an OpenWrt/LEDE 17.01 router using **temporary RAM storage**. Tested on a 4/32 router.
---
## Installation
### 1. Configure `opkg` to install packages into RAM
```bash
# Add a temporary installation destination
echo "dest ram /tmp" >> /etc/opkg.conf
# Update package lists
opkg update
```
### 2. Install required packages
```bash
# Install curl and CA certificates into /tmp (RAM)
opkg install -d ram curl ca-certificates
# Verify installation
ls -la /tmp/usr/bin/curl
ls -la /tmp/etc/ssl/certs/ca-certificates.crt
```
### 3. Create the AI script
Create a new file `/tmp/ai.sh` and paste the contents from this repository’s [`ai.sh`](./ai.sh) file.
```bash
cat > /tmp/ai.sh << 'EOF'
# Paste the contents from ai.sh here
EOF
chmod +x /tmp/ai.sh
```
### 4. Usage
Once the script is executable, you can run it directly with a text prompt:
```bash
/tmp/ai.sh "Hello, I'm running on a router!"
/tmp/ai.sh "What is OpenWrt?"
/tmp/ai.sh "Tell me a joke"
```
The script will send the prompt to the AI model via the Gemini API and output the response.
---
## Uninstallation
### Option 1 — Clean up manually (recommended)
```bash
# Delete packages
opkg remove curl --autoremove
opkg remove ca-certificates --autoremove
# Remove temporary data from RAM
rm -rf /tmp/usr /tmp/lib /tmp/bin /tmp/etc/ssl
# Remove the AI script
rm /tmp/ai.sh
# Remove the opkg RAM configuration
sed -i '/dest ram \/tmp/d' /etc/opkg.conf
```
### Option 2 — Reboot the router
```bash
reboot
```