Sign inSign up

gramax/editor-ai

By gramax

Updated about 1 month ago

Image
0

1.1K

gramax/editor-ai repository overview

Server for AI Features in the Gramax editor
Docker-compose
version: "3.8"
services:
  editor-ai:
    image: editor-ai
    environment:
      - CHAT__TYPE=openai
      - CHAT__MODEL=gpt-4o
      - CHAT__APIKEY=<your key>

      - AUTH__ADMIN__TOKEN=<key for Gramax>
    ports:
      - 3005:3005
    volumes:
      - ./config.yaml:/app/config/config.yaml
Configuration

The configuration file must be located at /app/config/config.yaml inside the container.

Configuration can be set via environment variables using __ as a section delimiter. Examples:

  • CHAT__TYPE=openai
  • AUTH__ADMIN__TOKEN=token
  • LOGGING__TARGETS__0__TYPE=file
  • LOGGING__TARGETS__0__OPTIONS__DESTINATION=/app/logs/server.log
  • LOGGING__TARGETS__1__TYPE=seq

The configuration file is optional - all settings can be specified via environment variables. The configuration file is loaded first, and then environment variables are loaded, which can override properties from the file.

Minimal Configuration

config.yaml:

chat:
  type: openai
  model: gpt-4o
  apiKey: <your key>
auth:
  admin:
    token: <key for Gramax>

Equivalent in environment variables:

CHAT__TYPE=openai
CHAT__MODEL=gpt-4o
CHAT__APIKEY=<your key>

AUTH__ADMIN__TOKEN=<key for Gramax>
Description of All Configuration Properties
# LLM settings for generating responses
chat:
  # Provider type
  # Type openai supports any provider compatible with OpenAI API
  # Values: openai, anthropic
  # Required
  type: openai
  # Model to use
  # The model must support Chat Completions
  # Required
  model: gpt-4o
  # Provider endpoint
  # Optional if using OpenAI directly
  # Examples:
  #   DeepSeek: https://api.deepseek.com/v1
  #   OpenRouter: https://openrouter.ai/api/v1
  # Optional
  host: https://openrouter.ai/api/v1
  # API key for provider
  # Some providers may require an API key even if not used
  # You can use any random string if not required
  # Optional
  apiKey: token
  # Proxy URL
  # Requests to the provider will be routed through this proxy
  # Optional
  socksProxyUrl: socks5://some-proxy-url
  # HTTP(S) proxy address
  # Optional
  httpProxyUrl: https://some-proxy-url
  # Properties added to each response generation request
  # Here you can specify generation parameters such as temperature, top_p, or other request properties
  # Optional
  samplingParams:
    temperature: 0.1

  # Properties of type anthropic
  type: anthropic
  # Required
  apiKey: token
  model: claude-opus-4-0
  httpProxyUrl: https://some-proxy-url
  samplingParams:
    temperature: 0.1

# LLM settings for transcription
transcription:
  # Provider type
  # Values: openai
  # Required
  type: openai
  # Model to use
  # The model must support Transcription
  # Required
  model: whisper-1
  # Same description as for chat
  host: https://openai-compatible-provider
  # Same description as for chat
  apiKey: token
  # Same description as for chat
  socksProxyUrl: socks5://some-proxy-url

# Server authentication settings
# At least one user must be specified to access the server
# Required
auth:
  # User ID
  # Only used in logs
  myNewUser:
    # Token required to access via Gramax
    # Required
    token: token
    # List of allowed endpoints for this user
    # Examples:
    #   - * - all endpoints allowed
    #   - /endpoint1/*
    #   - /end/*/point2
    # Use quotes around "*" because * has special meaning in YAML
    # Default: ["*"]
    # Optional
    allowed:
    - "*"

# CORS configuration
# Optional
cors:
  # List of allowed origins
  # If omitted or empty, all origins will be allowed (reflected dynamically)
  # Optional
  allowed:
    - "http://example.com"
    - "https://my-site.io"

# Logging settings
# Optional
logging:
  # Enable console logging
  # true = log to console
  # Values: true, false
  # Default: true
  # Optional
  console: false
  # Log targets configuration
  # As a list
  targets:
      # Target type
      # Values: file, seq, elasticsearch
      # Required
    - type: file
      # Minimum log level
      # Only logs at this level or higher will be sent
      # silent = disable logs for this target
      # Values: silent, trace, debug, info, warn, error, fatal
      # Default: trace
      # Optional
      level: trace
      # Target-specific options
      # Required
      options:
        # Path to the file
        # Required
        destination: app/logs/log1.log
      
      # Seq target type
    - type: seq
      options:
        # Seq server URL
        # Required
        serverUrl: http://localhost:5341
        apiKey: token

      # Elasticsearch target type
    - type: elasticsearch
      options:
        # Elasticsearch node address
        # Required
        node: http://localhost:9200
        # Index name in Elasticsearch
        # Required
        index: my-precious-logs
        # You can specify either username + password or just apiKey
        auth:
          username: elastic
          password: Password1
          apiKey: token

Tag summary

Content type

Image

Digest

sha256:0dbfdff96

Size

108.4 MB

Last updated

about 1 month ago

docker pull gramax/editor-ai