# bot-win7
**Repository Path**: yuyang2/bot-win7
## Basic Information
- **Project Name**: bot-win7
- **Description**: 使用python3.8重构nanobot,支持win7
- **Primary Language**: Python
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-10-29
- **Last Updated**: 2026-11-04
## Categories & Tags
**Categories**: Uncategorized
**Tags**: win7
## README
bot-win7: Ultra-Lightweight Personal AI Assistant
🐈 **bot-win7** is an **ultra-lightweight** personal AI assistant inspired by nanobot
## Key Features of bot-win7:
🪶 **Ultra-Lightweight**: Just ~4,000 lines of code — 99% smaller than OpenClaw - core functionality.
🔬 **Research-Ready**: Clean, readable code that's easy to understand, modify, and extend for research.
⚡️ **Lightning Fast**: Minimal footprint means faster startup, lower resource usage, and quicker iterations.
💎 **Easy-to-Use**: One-click to depoly and you're ready to go.
## 🏗️ Architecture
## 📦 Install
**Requirements:** Python 3.8+ (tested with 3.8.20). On Windows 7 SP1, see [Windows 7 Support](#-windows-7-support) for the runtime prerequisites.
**Install from source** (latest features, recommended for development)
```bash
git clone https://gitee.com/yuyang2/bot-win7.git
cd bot-win7
pip install -e .
```
## 🪟 Windows 7 Support
bot-win7 targets Python 3.8 and runs on Windows 7 SP1. Two litellm dependencies ship Rust
extensions that fail to load there because they import Windows 8+ APIs
(`bcryptprimitives.dll`, `api-ms-win-core-synch-l1-2-0.dll`):
| Dependency | Failure on Windows 7 | Fallback |
|------------|----------------------|----------|
| `fastuuid` | DLL load error during `import litellm` | stdlib `uuid` |
| `tokenizers` | DLL load error during `import litellm` (also needs `VCRUNTIME140_1.dll`) | stub `Tokenizer`; litellm falls back to `tiktoken` for token counting |
`bot-win7/_compat.py` registers the fallbacks in `sys.modules` right before litellm is
imported (from `bot-win7/providers/__init__.py`), so **no changes to site-packages are needed**
and reinstalling or upgrading litellm does not break the workaround. On Windows 10/11 and
Linux the real wheels load normally and the shims are a no-op.
The remaining compiled dependencies (`pydantic_core`, `tiktoken`, `jiter`) only need the
Visual C++ runtime and the Universal C Runtime:
- [Visual C++ 2015-2022 Redistributable (x64)](https://aka.ms/vs/17/release/vc_redist.x64.exe)
- KB2999226 (Universal C Runtime, already present on most updated Windows 7 SP1 machines)
Verify on the target machine (imports the real packages, bypassing the shims):
```bat
python -c "import pydantic_core._pydantic_core; print('pydantic_core ok')"
python -c "import tiktoken; print('tiktoken ok')"
python -c "import jiter; print('jiter ok')"
```
> [!NOTE]
> `rpds` is another Rust extension that cannot load on Windows 7, but it is only imported
> by `jsonschema` when validating `response_format={"type": "json_schema"}`. Tool calling
> and regular chat never touch it.
## 🚀 Quick Start
> [!TIP]
> Set your API key in `~/.bot-win7/config.json`.
> Get API keys: [OpenRouter](https://openrouter.ai/keys) (LLM) · [Brave Search](https://brave.com/search/api/) (optional, for web search)
**1. Initialize**
```bash
bot-win7 onboard
```
**2. Configure** (`~/.bot-win7/config.json`)
```json
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-xxx"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5"
}
},
"tools": {
"web": {
"search": {
"apiKey": "BSA-xxx"
}
}
}
}
```
**3. Chat**
```bash
bot-win7 agent -m "What is 2+2?"
```
That's it! You have a working AI assistant in 2 minutes.
## 🖥️ Local Models (vLLM)
Run bot-win7 with your own local models using vLLM or any OpenAI-compatible server
(vLLM, LM Studio, Ollama's OpenAI endpoint, one-api/new-api gateways, ...).
The `vllm` provider slot is the generic slot for custom endpoints: model IDs are sent to
the server exactly as written, without any provider prefix.
**1. Start your vLLM server**
```bash
vllm serve meta-llama/Llama-3.1-8B-Instruct --port 8000
```
**2. Configure** (`~/.bot-win7/config.json`)
```json
{
"providers": {
"vllm": {
"apiKey": "dummy",
"apiBase": "http://localhost:8000/v1"
}
},
"agents": {
"defaults": {
"model": "meta-llama/Llama-3.1-8B-Instruct"
}
}
}
```
**3. Chat**
```bash
bot-win7 agent -m "Hello from my local LLM!"
```
> [!TIP]
> The `apiKey` can be any non-empty string for local servers that don't require authentication.
> For gateways that do require a token, put the real token there — it is sent as the
> `Authorization: Bearer` header.
## ⚙️ Configuration
Config file: `~/.bot-win7/config.json`
### Providers
| Provider | Purpose | Get API Key |
|----------|---------|-------------|
| `openrouter` | LLM (recommended, access to all models) | [openrouter.ai](https://openrouter.ai) |
| `anthropic` | LLM (Claude direct) | [console.anthropic.com](https://console.anthropic.com) |
| `openai` | LLM (GPT direct) | [platform.openai.com](https://platform.openai.com) |
| `groq` | LLM (fast inference) | [console.groq.com](https://console.groq.com) |
| `gemini` | LLM (Gemini direct) | [aistudio.google.com](https://aistudio.google.com) |
Full config example
```json
{
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5"
}
},
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-xxx"
},
"groq": {
"apiKey": "gsk_xxx"
}
},
"tools": {
"web": {
"search": {
"apiKey": "BSA..."
}
}
}
}
```
## CLI Reference
| Command | Description |
|---------|-------------|
| `bot-win7 onboard` | Initialize config & workspace |
| `bot-win7 agent -m "..."` | Chat with the agent |
| `bot-win7 agent` | Interactive chat mode |
| `bot-win7 gateway` | Start the gateway |
| `bot-win7 status` | Show status |
Scheduled Tasks (Cron)
```bash
# Add a job
bot-win7 cron add --name "daily" --message "Good morning!" --cron "0 9 * * *"
bot-win7 cron add --name "hourly" --message "Check status" --every 3600
# List jobs
bot-win7 cron list
# Remove a job
bot-win7 cron remove
```
## 🐳 Docker
> [!TIP]
> The `-v ~/.bot-win7:/root/.bot-win7` flag mounts your local config directory into the container, so your config and workspace persist across container restarts.
Build and run bot-win7 in a container:
```bash
# Build the image
docker build -t bot-win7 .
# Initialize config (first time only)
docker run -v ~/.bot-win7:/root/.bot-win7 --rm bot-win7 onboard
# Edit config on host to add API keys
vim ~/.bot-win7/config.json
# Run gateway
docker run -v ~/.bot-win7:/root/.bot-win7 -p 18790:18790 bot-win7 gateway
# Or run a single command
docker run -v ~/.bot-win7:/root/.bot-win7 --rm bot-win7 agent -m "Hello!"
docker run -v ~/.bot-win7:/root/.bot-win7 --rm bot-win7 status
```
## 📁 Project Structure
```
bot-win7/
├── agent/ # 🧠 Core agent logic
│ ├── loop.py # Agent loop (LLM ↔ tool execution)
│ ├── context.py # Prompt builder
│ ├── memory.py # Persistent memory
│ ├── skills.py # Skills loader
│ ├── subagent.py # Background task execution
│ └── tools/ # Built-in tools (incl. spawn)
├── skills/ # 🎯 Bundled skills (github, weather, tmux...)
├── channels/ # 📱 Channel plugin framework
├── bus/ # 🚌 Message routing
├── cron/ # ⏰ Scheduled tasks
├── heartbeat/ # 💓 Proactive wake-up
├── providers/ # 🤖 LLM providers (OpenRouter, etc.)
├── session/ # 💬 Conversation sessions
├── config/ # ⚙️ Configuration
├── cli/ # 🖥️ Commands
└── _compat.py # 🧩 Compiled-dependency fallbacks (Windows 7)
```
## 🙏 Acknowledgments
This project is a renamed and modified fork of [nanobot](https://github.com/HKUDS/nanobot).
Thanks to the nanobot authors and contributors for the original work.
bot-win7 is for educational, research, and technical exchange purposes only