ESC

Type to search...

Configuration

EVOID uses TOML configuration. Change infrastructure by changing config — business logic stays untouched.

Project Structure

When you run evo init my-api:

my-api/
  evoid.toml          # Project config
  shared/             # Shared code between services
  services/
    api/
      evoid.toml      # Service config (optional)
      main.py         # Service entry point

Project Config

The root evoid.toml:

[project]
name = "my-api"
version = "1.0.0"

[runtime]
adapter = "asgi"
host = "0.0.0.0"
port = 8000

[engines]
schema = "native"
storage = "memory"
cache = "memory"
serializer = "json"
di = "native"
logger = "loguru"
metrics = "simple"
auth = "simple"

Service Config

Each service can override project config:

[service]
name = "api"
port = 8000

[engines]
storage = "sqlite"
cache = "memory"

Service config takes precedence over project config for that service.

Engine Reference

EngineOptionsDefaultPurpose
schemanative, pydanticnativeData validation
storagememory, sqlite, postgresmemoryData persistence
cachememorymemoryCaching layer
serializerjsonjsonSerialization
dinativenativeDependency injection
loggerstructlog, loguruloguruLogging
metricssimplesimpleMetrics collection
authsimplesimpleAuthentication

Swapping Infrastructure

Switch from SQLite to PostgreSQL without touching code:

# Before
[engines]
storage = "sqlite"

# After
[engines]
storage = "postgres"

Then sync dependencies:

evo sync

Syncing Dependencies

evo sync reads evoid.toml, maps engine names to packages, and installs them via uv:

EnginePackage
sqliteaiosqlite
redisredis.asyncio
structlogstructlog
loguruloguru
pydanticpydantic
sqlalchemysqlalchemy[asyncio]

Runtime Adapter

The adapter determines how Intents are triggered:

AdapterUse CasePackage
asgiHTTP APIsevoid[asgi]
cliCommand-line toolscore only
telegramTelegram botsevoid[telegram]
robynRobyn frameworkevoid[robyn]
websocketWebSocket connectionsevoid[asgi]

Environment Variables

Override config with environment variables:

EVOID_HOST=127.0.0.1
EVOID_PORT=3000
EVOID_ADAPTER=cli

Optional Dependencies

Install only what you need:

uv add "evoid[asgi]"           # HTTP APIs
uv add "evoid[pydantic]"       # Pydantic schemas
uv add "evoid[redis]"          # Redis cache
uv add "evoid[sqlalchemy]"     # SQL storage
uv add "evoid[loguru]"         # Loguru logging
uv add "evoid[full]"           # Everything

See Installation for the full extras list.