Dify

  • 启用企业版才有的大模型负载均衡功能:在api/services/feature_service.py文件中新增一行(https://github.com/brightwang/dify-model-lb):
    class FeatureService:
        @classmethod
        def get_features(cls, tenant_id: str) -> FeatureModel:
            features = FeatureModel()
            cls._fulfill_params_from_env(features)
            if dify_config.BILLING_ENABLED:
                cls._fulfill_params_from_billing_api(features, tenant_id)
            # 新增此行
            features.model_load_balancing_enabled = True
            return features

     

posted @ 2025-03-01 23:30  badwood  阅读(220)  评论(0)    收藏  举报
Badwood's Blog