Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Server Configuration
PORT=8080
# PORT=8080

# Maximum request body size (prevents DoS attacks)
# Accepts values like "10M", "1G", "500K" (default: 10M)
Expand Down Expand Up @@ -27,7 +27,7 @@ PORT=8080
# Type:
# - "local" (default) for single instance,
# - "redis" for multiple instances
CACHE_TYPE=local
# CACHE_TYPE=local

# Redis Configuration (only used when CACHE_TYPE=redis)
# REDIS_URL=redis://localhost:6379
Expand Down Expand Up @@ -61,7 +61,7 @@ CACHE_TYPE=local

# Enable/disable audit logging (default: false)
# When enabled, all requests and responses are logged to the configured storage
LOGGING_ENABLED=false
# LOGGING_ENABLED=false

# Log full request/response bodies (default: false)
# WARNING: May contain PII, API keys in prompts, or sensitive data
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Environment variables
/.env

# User config (created from config/config.example.yaml)
/config/config.yaml

# Cache
/.cache

Expand Down
101 changes: 101 additions & 0 deletions config/config.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# GOModel Configuration (optional)
# Copy to config/config.yaml to customize.
# Environment variables always override values in this file.
# All settings have sensible defaults — no config file is required.

server:
port: "8080"
master_key: "your-secret-key"
body_size_limit: "10M"

cache:
type: "local" # "local" or "redis"
cache_dir: ".cache" # local cache directory
redis:
url: "redis://localhost:6379"
key: "gomodel:models"
ttl: 86400 # 24 hours in seconds

storage:
type: "sqlite" # "sqlite", "postgresql", or "mongodb"
sqlite:
path: ".cache/gomodel.db"
postgresql:
url: "postgres://user:pass@localhost/gomodel"
max_conns: 10
mongodb:
url: "mongodb://localhost:27017"
database: "gomodel"

logging:
enabled: false
log_bodies: true # WARNING: may contain sensitive data
log_headers: true
buffer_size: 1000
flush_interval: 5 # seconds
retention_days: 30 # 0 = keep forever
only_model_interactions: true

usage:
enabled: true
enforce_returning_usage_data: true
buffer_size: 1000
flush_interval: 5
retention_days: 90

metrics:
enabled: false
endpoint: "/metrics"

http:
timeout: 600 # seconds (10 minutes)
response_header_timeout: 600

providers:
openai:
type: openai
api_key: "sk-..."

anthropic:
type: anthropic
api_key: "sk-ant-..."

gemini:
type: gemini
api_key: "..."

xai:
type: xai
api_key: "..."

groq:
type: groq
api_key: "gsk_..."

ollama:
type: ollama
base_url: "http://localhost:11434/v1"

# Custom OpenAI-compatible provider
# my-provider:
# type: openai
# base_url: "https://api.example.com/v1"
# api_key: "..."

# Example: Groq (OpenAI-compatible)
# groq:
# type: "openai"
# base_url: "https://api.groq.com/openai/v1"
# api_key: "${GROQ_API_KEY}"

# Example: Azure OpenAI
# azure-openai:
Comment thread
SantiagoDePolonia marked this conversation as resolved.
# type: "openai"
# base_url: "https://your-resource.openai.azure.com/openai/deployments/your-deployment"
# api_key: "${AZURE_OPENAI_API_KEY}"

# Example: DeepSeek (OpenAI-compatible)
# deepseek:
# type: "openai"
# base_url: "https://api.deepseek.com/v1"
# api_key: "${DEEPSEEK_API_KEY}"
Comment thread
SantiagoDePolonia marked this conversation as resolved.
Loading