PTENES
MODULE 1.3

βš™ Environment Setup

From scratch to a working Jarvis: Python 3.11, Docker, an OpenRouter account, a .env file, the setup wizard, and your first message on Telegram.

6
Topics
60
Minutes
Basic
Level
Hands-on
Type
1

🐍 Prerequisites and Python

INTELECTO requires Python 3.11+ as the absolute minimum. Earlier versions lack some of the async and typing features the project uses. The dependencies are deliberately minimal.

πŸ“¦ Minimal requirements.txt

httpx>=0.27.0 # HTTP async client
python-telegram-bot # Telegram Channel
cryptography # Fernet + PBKDF2
python-dotenv # .env loader
aiosqlite # SQLite async
# Nothing else. Zero frameworks.
1

python3 --version

Must return Python 3.11 or higher

2

python3 -m venv .venv && source .venv/bin/activate

Always use venv for isolation

3

pip install -r requirements.txt

Installs only the 5 required dependencies

2

πŸ”‘ OpenRouter Account

O OpenRouter is the default choice for INTELECTO because it solves the vendor lock-in problem with surgical elegance: one API key provides access to 100+ models, and changing models is just a matter of swapping a string.

🎯 Why OpenRouter?

  • β€’100+ models: GPT-4o, Claude 3.5, Mistral, Llama 3, Geminiβ€”all with one key
  • β€’Unified billing: One card, one bill, cost visibility by model
  • β€’Automatic fallback: If a model goes down, you can switch in seconds
  • β€’OpenAI-compatible interface: The same code works without changes
1

Create an account on openrouter.ai

2

Go to Keys β†’ Create API Key

3

Copy the key (starts with sk-or-)

3

πŸ“ .env Configuration

The file .env is the only source of sensitive configuration. Never put keys directly in the code. .env is loaded automatically by setup and must NEVER be committed to git.

πŸ“„ Complete .env Example

# Main Provider
OPENROUTER_API_KEY=sk-or-v1-...
MODEL_NAME=anthropic/claude-3.5-sonnet

# Telegram Channel
TELEGRAM_BOT_TOKEN=1234567890:AAF...
TELEGRAM_ALLOWED_USERS=123456789

# Agent Settings
MAX_ROUNDS=5
WORKSPACE_DIR=./workspace
LOG_LEVEL=INFO

⚠ Critical Security Rule

O .env must be in the .gitignore. Always check before committing. An API key exposed on GitHub can generate bills of hundreds of dollars in hoursβ€”this happens often with automated scanning bots.

4

πŸ§™ The Setup Wizard

O setup.py is an interactive wizard that asks the right questions and configures everything automatically. It creates the necessary files, validates credentials, and ensures nothing required is overlooked.

πŸ’¬ Wizard Questions

$ python setup.py
? Which channel should you use? [telegram/discord/cli]: telegram
? Use Docker or native? [docker/native]: native
? LLM provider? [openrouter/ollama]: openrouter
? Default model?: anthropic/claude-3.5-sonnet
? Your assistant's name?: Atlas
βœ“ .env created
βœ“ workspace/ initialized
βœ“ ~/.intelecto/ created
βœ“ Setup complete! Run: python main.py
5

🐳 Docker vs Native

The choice between Docker and native affects your workflow. For development, native is more agile. For production, Docker Compose ensures reproducibility and makes monitoring easier.

🐍 Native Mode

  • βœ“Instant debugging with pdb/breakpoint
  • βœ“Automatic reload with watchdog
  • βœ“Direct filesystem access
  • βœ—Depends on the local environment
python main.py

🐳 Docker Mode

  • βœ“Complete environment isolation
  • βœ“Reproducible deploy on any server
  • βœ“Automatic restart with --restart unless-stopped
  • βœ—Build and Startup Overhead
docker compose up -d
6

πŸ“± First Message on Telegram

The moment of truth. If the first message works, the entire stack is correct: channel connected, provider responding, memory initialized, and workspace loaded.

1

Create a Bot in BotFather

Open Telegram β†’ BotFather β†’ /newbot β†’ follow the instructions β†’ copy the token that starts with numbers followed by :

2

Get Your User ID

Send /start to @userinfobot in Telegram. Copy the returned number and put it in TELEGRAM_ALLOWED_USERS.

3

Start INTELECTO

python main.py β€” wait for "Bot iniciado. Aguardando mensagens..."

4

Send β€œHello” and wait

Jarvis will respond with the personality defined in its SOUL.md. If it responds, congratulations β€” you have a working Jarvis.

πŸ’‘ Smoke Test Checklist

  • βœ“Bot running without errors in the terminal
  • βœ“Message was received (appears in the log)
  • βœ“LLM was called (cost on OpenRouter)
  • βœ“Response arrived on Telegram
  • βœ“audit.log contains the interaction record

βœ… Module 1.3 Summary

βœ“
Python 3.11+ β€” 5 minimal dependencies, zero AI frameworks
βœ“
OpenRouter β€” 100+ models, unified billing, no vendor lock-in
βœ“
Secure .env β€” keys outside the code, in the required .gitignore
βœ“
Setup wizard β€” guided questions, automatic configuration, and validation
βœ“
Docker vs. native β€” native for development, Docker Compose for production
βœ“
First message β€” smoke test that validates the entire stack end to end

Next Learning Path:

Track 2 β€” Identity and Channels: SOUL.md, AIEOS, Telegram, WhatsApp, and SQLite memory