config.toml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. [database]
  2. # The database for caching, support Redis, MySQL, Postgres and MongoDB:
  3. # redis://<user>:<password>@<host>:<port>/<db_number>
  4. # rediss://<user>:<password>@<host>:<port>/<db_number>
  5. # postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full
  6. # postgresql://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full
  7. # mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
  8. # mongodb+srv://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
  9. cache_store = "redis://localhost:6379/0"
  10. # The database for persist data, support MySQL, Postgres and MongoDB:
  11. # mysql://[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]
  12. # postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full
  13. # postgresql://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full
  14. # mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
  15. # mongodb+srv://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
  16. data_store = "mysql://gorse:gorse_pass@tcp(localhost:3306)/gorse"
  17. # The naming prefix for tables (collections, keys) in databases. The default value is empty.
  18. table_prefix = ""
  19. # The naming prefix for tables (collections, keys) in cache storage databases. The default value is `table_prefix`.
  20. cache_table_prefix = ""
  21. # The naming prefix for tables (collections, keys) in data storage databases. The default value is `table_prefix`.
  22. data_table_prefix = ""
  23. [master]
  24. # GRPC port of the master node. The default value is 8086.
  25. port = 8086
  26. # gRPC host of the master node. The default values is "0.0.0.0".
  27. host = "0.0.0.0"
  28. # HTTP port of the master node. The default values is 8088.
  29. http_port = 8088
  30. # HTTP host of the master node. The default values is "0.0.0.0".
  31. http_host = "0.0.0.0"
  32. # AllowedDomains is a list of allowed values for Http Origin.
  33. # The list may contain the special wildcard string ".*" ; all is allowed
  34. # If empty all are allowed.
  35. http_cors_domains = []
  36. # AllowedMethods is either empty or has a list of http methods names. Checking is case-insensitive.
  37. http_cors_methods = []
  38. # Number of working jobs in the master node. The default value is 1.
  39. n_jobs = 1
  40. # Meta information timeout. The default value is 10s.
  41. meta_timeout = "10s"
  42. # Username for the master node dashboard.
  43. dashboard_user_name = ""
  44. # Password for the master node dashboard.
  45. dashboard_password = ""
  46. # Secret key for admin APIs (SSL required).
  47. admin_api_key = ""
  48. [server]
  49. # Default number of returned items. The default value is 10.
  50. default_n = 10
  51. # Secret key for RESTful APIs (SSL required).
  52. api_key = ""
  53. # Clock error in the cluster. The default value is 5s.
  54. clock_error = "5s"
  55. # Insert new users while inserting feedback. The default value is true.
  56. auto_insert_user = true
  57. # Insert new items while inserting feedback. The default value is true.
  58. auto_insert_item = true
  59. # Server-side cache expire time. The default value is 10s.
  60. cache_expire = "10s"
  61. [recommend]
  62. # The cache size for recommended/popular/latest items. The default value is 10.
  63. cache_size = 100
  64. # Recommended cache expire time. The default value is 72h.
  65. cache_expire = "72h"
  66. # The time-to-live (days) of active users, 0 means disabled. Recommendation won't be cached for inactive users. The default value is 0.
  67. active_user_ttl = 0
  68. [recommend.data_source]
  69. # The feedback types for positive events.
  70. positive_feedback_types = ["star","like"]
  71. # The feedback types for read events.
  72. read_feedback_types = ["read"]
  73. # The time-to-live (days) of positive feedback, 0 means disabled. The default value is 0.
  74. positive_feedback_ttl = 0
  75. # The time-to-live (days) of items, 0 means disabled. The default value is 0.
  76. item_ttl = 0
  77. [recommend.popular]
  78. # The time window of popular items. The default values is 4320h.
  79. popular_window = "720h"
  80. [recommend.user_neighbors]
  81. # The type of neighbors for users. There are three types:
  82. # similar: Neighbors are found by number of common labels.
  83. # related: Neighbors are found by number of common liked items.
  84. # auto: If a user have labels, neighbors are found by number of common labels.
  85. # If this user have no labels, neighbors are found by number of common liked items.
  86. # The default value is "auto".
  87. neighbor_type = "similar"
  88. # Enable approximate user neighbor searching using vector index. The default value is true.
  89. enable_index = true
  90. # Minimal recall for approximate user neighbor searching. The default value is 0.8.
  91. index_recall = 0.8
  92. # Maximal number of fit epochs for approximate user neighbor searching vector index. The default value is 3.
  93. index_fit_epoch = 3
  94. [recommend.item_neighbors]
  95. # The type of neighbors for items. There are three types:
  96. # similar: Neighbors are found by number of common labels.
  97. # related: Neighbors are found by number of common users.
  98. # auto: If a item have labels, neighbors are found by number of common labels.
  99. # If this item have no labels, neighbors are found by number of common users.
  100. # The default value is "auto".
  101. neighbor_type = "similar"
  102. # Enable approximate item neighbor searching using vector index. The default value is true.
  103. enable_index = true
  104. # Minimal recall for approximate item neighbor searching. The default value is 0.8.
  105. index_recall = 0.8
  106. # Maximal number of fit epochs for approximate item neighbor searching vector index. The default value is 3.
  107. index_fit_epoch = 3
  108. [recommend.collaborative]
  109. # Enable approximate collaborative filtering recommend using vector index. The default value is true.
  110. enable_index = true
  111. # Minimal recall for approximate collaborative filtering recommend. The default value is 0.9.
  112. index_recall = 0.9
  113. # Maximal number of fit epochs for approximate collaborative filtering recommend vector index. The default value is 3.
  114. index_fit_epoch = 3
  115. # The time period for model fitting. The default value is "60m".
  116. model_fit_period = "60m"
  117. # The time period for model searching. The default value is "360m".
  118. model_search_period = "360m"
  119. # The number of epochs for model searching. The default value is 100.
  120. model_search_epoch = 100
  121. # The number of trials for model searching. The default value is 10.
  122. model_search_trials = 10
  123. # Enable searching models of different sizes, which consume more memory. The default value is false.
  124. enable_model_size_search = false
  125. [recommend.replacement]
  126. # Replace historical items back to recommendations. The default value is false.
  127. enable_replacement = false
  128. # Decay the weights of replaced items from positive feedbacks. The default value is 0.8.
  129. positive_replacement_decay = 0.8
  130. # Decay the weights of replaced items from read feedbacks. The default value is 0.6.
  131. read_replacement_decay = 0.6
  132. [recommend.offline]
  133. # The time period to check recommendation for users. The default values is 1m.
  134. check_recommend_period = "1m"
  135. # The time period to refresh recommendation for inactive users. The default values is 120h.
  136. refresh_recommend_period = "24h"
  137. # Enable latest recommendation during offline recommendation. The default value is false.
  138. enable_latest_recommend = true
  139. # Enable popular recommendation during offline recommendation. The default value is false.
  140. enable_popular_recommend = false
  141. # Enable user-based similarity recommendation during offline recommendation. The default value is false.
  142. enable_user_based_recommend = true
  143. # Enable item-based similarity recommendation during offline recommendation. The default value is false.
  144. enable_item_based_recommend = false
  145. # Enable collaborative filtering recommendation during offline recommendation. The default value is true.
  146. enable_collaborative_recommend = true
  147. # Enable click-though rate prediction during offline recommendation. Otherwise, results from multi-way recommendation
  148. # would be merged randomly. The default value is false.
  149. enable_click_through_prediction = true
  150. # The explore recommendation method is used to inject popular items or latest items into recommended result:
  151. # popular: Recommend popular items to cold-start users.
  152. # latest: Recommend latest items to cold-start users.
  153. # The default values is { popular = 0.0, latest = 0.0 }.
  154. explore_recommend = { popular = 0.1, latest = 0.2 }
  155. [recommend.online]
  156. # The fallback recommendation method is used when cached recommendation drained out:
  157. # item_based: Recommend similar items to cold-start users.
  158. # popular: Recommend popular items to cold-start users.
  159. # latest: Recommend latest items to cold-start users.
  160. # Recommenders are used in order. The default values is ["latest"].
  161. fallback_recommend = ["item_based", "latest"]
  162. # The number of feedback used in fallback item-based similar recommendation. The default values is 10.
  163. num_feedback_fallback_item_based = 10
  164. [tracing]
  165. # Enable tracing for REST APIs. The default value is false.
  166. enable_tracing = false
  167. # The type of tracing exporters should be one of "jaeger", "zipkin", "otlp" and "otlphttp". The default value is "jaeger".
  168. exporter = "jaeger"
  169. # The endpoint of tracing collector.
  170. collector_endpoint = "http://localhost:14268/api/traces"
  171. # The type of tracing sampler should be one of "always", "never" and "ratio". The default value is "always".
  172. sampler = "always"
  173. # The ratio of ratio based sampler. The default value is 1.
  174. ratio = 1
  175. [experimental]
  176. # Enable deep learning recommenders. The default value is false.
  177. enable_deep_learning = false
  178. # Batch size for deep learning recommenders. The default value is 128.
  179. deep_learning_batch_size = 128