Skip to content

v1.2.0

Choose a tag to compare

@adham90 adham90 released this 26 Jan 23:48
· 289 commits to main since this release

What's Changed

Added

  • Per-Tenant API Configuration - New Configurable concern for tenant-specific API keys:

    • configure_api - Block syntax for configuring tenant API settings
    • api_key_for(:provider) - Get API key for a specific provider
    • has_custom_api_keys? - Check if tenant has custom API keys
    • effective_api_configuration - Get resolved config with fallbacks
    • configured_providers - List all configured providers
  • Polymorphic Tenant Support - Flexible tenant associations for any model

Changed

  • Tenant Model Refactor - Unified tenant management with organized concerns:
    • Renamed TenantBudget model to Tenant as the central entity for all tenant functionality
    • Added Budgetable concern for budget limits and enforcement
    • Added Trackable concern for usage tracking (cost, tokens, executions)
    • Added Configurable concern for per-tenant API configuration
    • New tracking methods: usage_by_agent, usage_by_model, usage_by_day, recent_executions, failed_executions
    • New status methods: active?, linked?, activate!, deactivate!
    • TenantBudget is now an alias for backward compatibility (deprecated, will be removed in future major version)
    • Added tenant table rename to upgrade generator for seamless migration

Deprecated

  • RubyLLM::Agents::TenantBudget - Use RubyLLM::Agents::Tenant instead
  • llm_budget association in LLMTenant concern - Use llm_tenant_record instead
  • llm_configure_budget method - Use llm_configure instead

Removed

  • Limitable concern - Rate limiting, feature flags, and model restrictions removed (may return in a future release)

Full Changelog: v1.1.0...v1.2.0