4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
1
|
# Unified Configuration for Multi-Tenant Search Engine
|
33839b37
tangwang
属性值参与搜索:
|
2
3
|
# 统一配置文件,所有租户共用一套配置
# 注意:索引结构由 mappings/search_products.json 定义,此文件只配置搜索行为
|
86d0e83d
tangwang
query翻译,根据源语言是否在索...
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#
# 约定:下列键为必填;进程环境变量可覆盖 infrastructure / runtime 中同名语义项
#(如 ES_HOST、API_PORT 等),未设置环境变量时使用本文件中的值。
# Process / bind addresses (环境变量 APP_ENV、RUNTIME_ENV、ES_INDEX_NAMESPACE 可覆盖前两者的语义)
runtime:
environment: "prod"
index_namespace: ""
api_host: "0.0.0.0"
api_port: 6002
indexer_host: "0.0.0.0"
indexer_port: 6004
embedding_host: "0.0.0.0"
embedding_port: 6005
embedding_text_port: 6005
embedding_image_port: 6008
|
cda1cd62
tangwang
意图分析&应用 baseline
|
20
|
translator_host: "0.0.0.0"
|
86d0e83d
tangwang
query翻译,根据源语言是否在索...
|
21
|
translator_port: 6006
|
cda1cd62
tangwang
意图分析&应用 baseline
|
22
|
reranker_host: "0.0.0.0"
|
86d0e83d
tangwang
query翻译,根据源语言是否在索...
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
reranker_port: 6007
# 基础设施连接(敏感项优先读环境变量:ES_*、REDIS_*、DB_*、DASHSCOPE_API_KEY、DEEPL_AUTH_KEY)
infrastructure:
elasticsearch:
host: "http://localhost:9200"
username: null
password: null
redis:
host: "localhost"
port: 6479
snapshot_db: 0
password: null
socket_timeout: 1
socket_connect_timeout: 1
retry_on_timeout: false
cache_expire_days: 720
embedding_cache_prefix: "embedding"
anchor_cache_prefix: "product_anchors"
anchor_cache_expire_days: 30
database:
host: null
port: 3306
database: null
username: null
password: null
secrets:
dashscope_api_key: null
deepl_auth_key: null
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
52
53
54
55
|
# Elasticsearch Index
es_index_name: "search_products"
|
86d0e83d
tangwang
query翻译,根据源语言是否在索...
|
56
57
58
|
# 检索域 / 索引列表(可为空列表;每项字段均需显式给出)
indexes: []
|
86d8358b
tangwang
config optimize
|
59
60
61
62
|
# Config assets
assets:
query_rewrite_dictionary_path: "config/dictionaries/query_rewrite.dict"
|
41f0b2e9
tangwang
product_enrich支持并发
|
63
64
65
66
|
# Product content understanding (LLM enrich-content) configuration
product_enrich:
max_workers: 40
|
33839b37
tangwang
属性值参与搜索:
|
67
|
# ES Index Settings (基础设置)
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
68
69
70
71
72
|
es_settings:
number_of_shards: 1
number_of_replicas: 0
refresh_interval: "30s"
|
33839b37
tangwang
属性值参与搜索:
|
73
|
# 字段权重配置(用于搜索时的字段boost)
|
0536222c
tangwang
query parser优化
|
74
|
# 统一按“字段基名”配置;查询时按实际检索语言动态拼接 .{lang}。
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
75
|
# 若需要按某个语言单独调权,也可以加显式 key(例如 title.de: 3.2)。
|
33839b37
tangwang
属性值参与搜索:
|
76
|
field_boosts:
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
77
|
title: 3.0
|
69881ecb
tangwang
相关性调参、enrich内容解析优化
|
78
79
80
81
|
qanchors: 2.5
tags: 2.0
category_name_text: 2.0
category_path: 2.0
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
82
|
brief: 1.5
|
69881ecb
tangwang
相关性调参、enrich内容解析优化
|
83
|
description: 1.5
|
e756b18e
tangwang
重构了文本召回构建器,现在每个 b...
|
84
|
vendor: 1.5
|
69881ecb
tangwang
相关性调参、enrich内容解析优化
|
85
86
87
|
option1_values: 1.5
option2_values: 1.5
option3_values: 1.5
|
33839b37
tangwang
属性值参与搜索:
|
88
|
|
33839b37
tangwang
属性值参与搜索:
|
89
|
# Query Configuration(查询配置)
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
90
|
query_config:
|
33839b37
tangwang
属性值参与搜索:
|
91
|
# 支持的语言
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
92
93
94
|
supported_languages:
- "zh"
- "en"
|
2739b281
tangwang
多语言索引调整
|
95
|
default_language: "en"
|
33839b37
tangwang
属性值参与搜索:
|
96
|
|
345d960b
tangwang
1. 删除全局 enable_tr...
|
97
|
# 功能开关(翻译开关由tenant_config控制)
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
98
99
|
enable_text_embedding: true
enable_query_rewrite: true
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
100
|
|
86d0e83d
tangwang
query翻译,根据源语言是否在索...
|
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# 查询翻译模型(须与 services.translation.capabilities 中某项一致)
# 源语种在租户 index_languages 内:主召回可打在源语种字段,用下面三项。
# zh_to_en_model: "opus-mt-zh-en"
# en_to_zh_model: "opus-mt-en-zh"
# default_translation_model: "nllb-200-distilled-600m"
zh_to_en_model: "deepl"
en_to_zh_model: "deepl"
default_translation_model: "deepl"
# 源语种不在 index_languages:翻译对可检索文本更关键,可单独指定(缺省则与上一组相同)
zh_to_en_model__source_not_in_index: "deepl"
en_to_zh_model__source_not_in_index: "deepl"
default_translation_model__source_not_in_index: "deepl"
|
1556989b
tangwang
query翻译等待超时逻辑
|
114
115
|
# 查询解析阶段:翻译与 query 向量并发执行,共用同一等待预算(毫秒)。
# 检测语言已在租户 index_languages 内:较短;不在索引语言内:较长(翻译对召回更关键)。
|
86d0e83d
tangwang
query翻译,根据源语言是否在索...
|
116
|
translation_embedding_wait_budget_ms_source_in_index: 500 # 80
|
837d5d76
tangwang
sku筛选匹配规则优化,按 tok...
|
117
|
translation_embedding_wait_budget_ms_source_not_in_index: 700 #200
|
1556989b
tangwang
query翻译等待超时逻辑
|
118
|
|
cda1cd62
tangwang
意图分析&应用 baseline
|
119
120
|
style_intent:
enabled: true
|
87cacb1b
tangwang
融合公式优化。加入意图匹配因子
|
121
|
selected_sku_boost: 1.2
|
cda1cd62
tangwang
意图分析&应用 baseline
|
122
123
124
125
126
127
|
color_dictionary_path: "config/dictionaries/style_intent_color.csv"
size_dictionary_path: "config/dictionaries/style_intent_size.csv"
dimension_aliases:
color: ["color", "colors", "colour", "colours", "颜色", "色", "色系"]
size: ["size", "sizes", "sizing", "尺码", "尺寸", "码数", "号码", "码"]
|
74fdf9bd
tangwang
1.
|
128
129
130
131
|
product_title_exclusion:
enabled: true
dictionary_path: "config/dictionaries/product_title_exclusion.tsv"
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
132
133
134
135
136
137
|
# 动态多语言检索字段配置
# multilingual_fields 会被拼成 title.{lang}/brief.{lang}/... 形式;
# shared_fields 为无语言后缀字段。
search_fields:
multilingual_fields:
- "title"
|
69881ecb
tangwang
相关性调参、enrich内容解析优化
|
138
|
- "qanchors"
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
139
140
|
- "category_path"
- "category_name_text"
|
69881ecb
tangwang
相关性调参、enrich内容解析优化
|
141
142
|
- "brief"
- "description"
|
e756b18e
tangwang
重构了文本召回构建器,现在每个 b...
|
143
|
- "vendor"
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
144
|
shared_fields:
|
445496cd
tangwang
fix last up: 每个翻译...
|
145
146
147
148
|
# - "tags"
# - "option1_values"
# - "option2_values"
# - "option3_values"
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
149
150
|
core_multilingual_fields:
- "title"
|
e756b18e
tangwang
重构了文本召回构建器,现在每个 b...
|
151
|
- "qanchors"
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
152
153
|
- "category_name_text"
|
0536222c
tangwang
query parser优化
|
154
|
# 统一文本召回策略(主查询 + 翻译查询)
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
155
156
157
|
text_query_strategy:
base_minimum_should_match: "75%"
translation_minimum_should_match: "75%"
|
69881ecb
tangwang
相关性调参、enrich内容解析优化
|
158
159
|
translation_boost: 0.75
tie_breaker_base_query: 0.5
|
e756b18e
tangwang
重构了文本召回构建器,现在每个 b...
|
160
161
162
163
164
165
166
167
168
|
best_fields_boost: 2.0
best_fields:
title: 4.0
qanchors: 3.0
category_name_text: 2.0
phrase_fields:
title: 5.0
qanchors: 4.0
phrase_match_boost: 3.0
|
bd96cead
tangwang
1. 动态多语言字段与统一策略配置
|
169
|
|
33839b37
tangwang
属性值参与搜索:
|
170
171
172
|
# Embedding字段名称
text_embedding_field: "title_embedding"
image_embedding_field: null
|
325eec03
tangwang
1. 日志、配置基础设施,使用优化
|
173
|
|
33839b37
tangwang
属性值参与搜索:
|
174
175
|
# 返回字段配置(_source includes)
# null表示返回所有字段,[]表示不返回任何字段,列表表示只返回指定字段
|
a7cc9078
tangwang
sku排序
|
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
# 下列字段与 api/result_formatter.py(SpuResult 填充)及 search/searcher.py(SKU 排序/主图替换)一致
source_fields:
- spu_id
- handle
- title
- brief
- description
- vendor
- category_name
- category_name_text
- category_path
- category_id
- category_level
- category1_name
- category2_name
- category3_name
- tags
- min_price
- compare_at_price
- image_url
- sku_prices
- sku_weights
- sku_weight_units
- total_inventory
- option1_name
- option1_values
|
dad3c867
tangwang
configs
|
202
203
204
205
|
- option2_name
- option2_values
- option3_name
- option3_values
|
a7cc9078
tangwang
sku排序
|
206
207
|
- specifications
- skus
|
70dab99f
tangwang
add logs
|
208
209
|
# KNN boost配置(向量召回的boost值)
|
ef5baa86
tangwang
混杂语言处理
|
210
|
knn_boost: 2.0 # Lower boost for embedding recall
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
211
|
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
212
213
214
215
|
# Function Score配置(ES层打分规则)
function_score:
score_mode: "sum"
boost_mode: "multiply"
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
216
217
|
functions: []
|
42e3aea6
tangwang
tidy
|
218
|
# 重排配置(provider/URL 在 services.rerank)
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
219
|
rerank:
|
5f7d7f09
tangwang
性能测试报告.md
|
220
|
enabled: true
|
fb973d19
tangwang
configs
|
221
|
rerank_window: 400
|
42e3aea6
tangwang
tidy
|
222
|
timeout_sec: 15.0
|
506c39b7
tangwang
feat(search): 统一重...
|
223
224
|
weight_es: 0.4
weight_ai: 0.6
|
ff32d894
tangwang
rerank
|
225
226
|
rerank_query_template: "{query}"
rerank_doc_template: "{title}"
|
814e352b
tangwang
乘法公式配置化
|
227
228
229
230
231
232
233
|
# 乘法融合:fused = Π (max(score,0) + bias) ** exponent(rerank / text / knn 三项)
fusion:
rerank_bias: 0.00001
rerank_exponent: 1.0
text_bias: 0.1
text_exponent: 0.35
knn_bias: 0.6
|
9de5ef49
tangwang
qwen3_vllm_score ...
|
234
|
knn_exponent: 0.0
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
235
|
|
42e3aea6
tangwang
tidy
|
236
237
238
|
# 可扩展服务/provider 注册表(单一配置源)
services:
translation:
|
5e4dc8e4
tangwang
翻译架构按“一个翻译服务 +
|
239
|
service_url: "http://127.0.0.1:6006"
|
b754fd41
tangwang
图片向量化支持优先级参数
|
240
|
default_model: "nllb-200-distilled-600m"
|
5e4dc8e4
tangwang
翻译架构按“一个翻译服务 +
|
241
|
default_scene: "general"
|
42e3aea6
tangwang
tidy
|
242
|
timeout_sec: 10.0
|
d4cadc13
tangwang
翻译重构
|
243
|
cache:
|
d4cadc13
tangwang
翻译重构
|
244
245
|
ttl_seconds: 62208000
sliding_expiration: true
|
8140e942
tangwang
translator model ...
|
246
247
248
249
250
251
252
253
254
255
256
|
# When false, cache keys are exact-match per request model only (ignores model_quality_tiers for lookups).
enable_model_quality_tier_cache: true
# Higher tier = better quality. Multiple models may share one tier (同级).
# A request may reuse Redis keys from models with tier > A or tier == A (not from lower tiers).
model_quality_tiers:
deepl: 30
qwen-mt: 30
llm: 30
nllb-200-distilled-600m: 20
opus-mt-zh-en: 10
opus-mt-en-zh: 10
|
5e4dc8e4
tangwang
翻译架构按“一个翻译服务 +
|
257
|
capabilities:
|
d4cadc13
tangwang
翻译重构
|
258
|
qwen-mt:
|
5e4dc8e4
tangwang
翻译架构按“一个翻译服务 +
|
259
|
enabled: true
|
0fd2f875
tangwang
translate
|
260
|
backend: "qwen_mt"
|
5e4dc8e4
tangwang
翻译架构按“一个翻译服务 +
|
261
|
model: "qwen-mt-flash"
|
0fd2f875
tangwang
translate
|
262
|
base_url: "https://dashscope-us.aliyuncs.com/compatible-mode/v1"
|
42e3aea6
tangwang
tidy
|
263
|
timeout_sec: 10.0
|
5e4dc8e4
tangwang
翻译架构按“一个翻译服务 +
|
264
|
use_cache: true
|
a0a173ae
tangwang
last
|
265
|
llm:
|
5e4dc8e4
tangwang
翻译架构按“一个翻译服务 +
|
266
|
enabled: true
|
0fd2f875
tangwang
translate
|
267
|
backend: "llm"
|
a0a173ae
tangwang
last
|
268
|
model: "qwen-flash"
|
0fd2f875
tangwang
translate
|
269
|
base_url: "https://dashscope-us.aliyuncs.com/compatible-mode/v1"
|
a0a173ae
tangwang
last
|
270
|
timeout_sec: 30.0
|
cd4ce66d
tangwang
trans logs
|
271
|
use_cache: true
|
d4cadc13
tangwang
翻译重构
|
272
|
deepl:
|
cd4ce66d
tangwang
trans logs
|
273
|
enabled: true
|
0fd2f875
tangwang
translate
|
274
275
|
backend: "deepl"
api_url: "https://api.deepl.com/v2/translate"
|
d4cadc13
tangwang
翻译重构
|
276
|
timeout_sec: 10.0
|
d4cadc13
tangwang
翻译重构
|
277
|
glossary_id: ""
|
cd4ce66d
tangwang
trans logs
|
278
|
use_cache: true
|
0fd2f875
tangwang
translate
|
279
280
281
282
283
|
nllb-200-distilled-600m:
enabled: true
backend: "local_nllb"
model_id: "facebook/nllb-200-distilled-600M"
model_dir: "./models/translation/facebook/nllb-200-distilled-600M"
|
ea293660
tangwang
CTranslate2
|
284
285
286
287
|
ct2_model_dir: "./models/translation/facebook/nllb-200-distilled-600M/ctranslate2-float16"
ct2_compute_type: "float16"
ct2_conversion_quantization: "float16"
ct2_auto_convert: true
|
46ce858d
tangwang
在NLLB模型的 /data/sa...
|
288
|
ct2_inter_threads: 4
|
ea293660
tangwang
CTranslate2
|
289
|
ct2_intra_threads: 0
|
46ce858d
tangwang
在NLLB模型的 /data/sa...
|
290
|
ct2_max_queued_batches: 32
|
ea293660
tangwang
CTranslate2
|
291
|
ct2_batch_type: "examples"
|
46ce858d
tangwang
在NLLB模型的 /data/sa...
|
292
293
294
|
ct2_decoding_length_mode: "source"
ct2_decoding_length_extra: 8
ct2_decoding_length_min: 32
|
0fd2f875
tangwang
translate
|
295
296
|
device: "cuda"
torch_dtype: "float16"
|
4747e2f4
tangwang
embedding perform...
|
297
|
batch_size: 64
|
0fd2f875
tangwang
translate
|
298
|
max_input_length: 256
|
3eff49b7
tangwang
trans nllb-200-di...
|
299
|
max_new_tokens: 64
|
0fd2f875
tangwang
translate
|
300
|
num_beams: 1
|
cd4ce66d
tangwang
trans logs
|
301
|
use_cache: true
|
0fd2f875
tangwang
translate
|
302
303
304
305
306
|
opus-mt-zh-en:
enabled: true
backend: "local_marian"
model_id: "Helsinki-NLP/opus-mt-zh-en"
model_dir: "./models/translation/Helsinki-NLP/opus-mt-zh-en"
|
ea293660
tangwang
CTranslate2
|
307
308
309
310
311
312
313
314
|
ct2_model_dir: "./models/translation/Helsinki-NLP/opus-mt-zh-en/ctranslate2-float16"
ct2_compute_type: "float16"
ct2_conversion_quantization: "float16"
ct2_auto_convert: true
ct2_inter_threads: 1
ct2_intra_threads: 0
ct2_max_queued_batches: 0
ct2_batch_type: "examples"
|
0fd2f875
tangwang
translate
|
315
316
317
318
319
320
|
device: "cuda"
torch_dtype: "float16"
batch_size: 16
max_input_length: 256
max_new_tokens: 256
num_beams: 1
|
cd4ce66d
tangwang
trans logs
|
321
|
use_cache: true
|
0fd2f875
tangwang
translate
|
322
323
324
325
326
|
opus-mt-en-zh:
enabled: true
backend: "local_marian"
model_id: "Helsinki-NLP/opus-mt-en-zh"
model_dir: "./models/translation/Helsinki-NLP/opus-mt-en-zh"
|
ea293660
tangwang
CTranslate2
|
327
328
329
330
331
332
333
334
|
ct2_model_dir: "./models/translation/Helsinki-NLP/opus-mt-en-zh/ctranslate2-float16"
ct2_compute_type: "float16"
ct2_conversion_quantization: "float16"
ct2_auto_convert: true
ct2_inter_threads: 1
ct2_intra_threads: 0
ct2_max_queued_batches: 0
ct2_batch_type: "examples"
|
0fd2f875
tangwang
translate
|
335
336
337
338
339
340
|
device: "cuda"
torch_dtype: "float16"
batch_size: 16
max_input_length: 256
max_new_tokens: 256
num_beams: 1
|
cd4ce66d
tangwang
trans logs
|
341
|
use_cache: true
|
42e3aea6
tangwang
tidy
|
342
|
embedding:
|
950a640e
tangwang
embeddings
|
343
|
provider: "http" # http
|
42e3aea6
tangwang
tidy
|
344
345
|
providers:
http:
|
7214c2e7
tangwang
mplemented**
|
346
347
|
text_base_url: "http://127.0.0.1:6005"
image_base_url: "http://127.0.0.1:6008"
|
07cf5a93
tangwang
START_EMBEDDING=...
|
348
|
# 服务内文本后端(embedding 进程启动时读取)
|
efd435cf
tangwang
tei性能调优:
|
349
|
backend: "tei" # tei | local_st
|
07cf5a93
tangwang
START_EMBEDDING=...
|
350
351
352
|
backends:
tei:
base_url: "http://127.0.0.1:8080"
|
efd435cf
tangwang
tei性能调优:
|
353
|
timeout_sec: 20
|
07cf5a93
tangwang
START_EMBEDDING=...
|
354
355
356
357
358
359
|
model_id: "Qwen/Qwen3-Embedding-0.6B"
local_st:
model_id: "Qwen/Qwen3-Embedding-0.6B"
device: "cuda"
batch_size: 32
normalize_embeddings: true
|
86d8358b
tangwang
config optimize
|
360
361
362
363
364
365
366
367
368
369
370
371
372
|
# 服务内图片后端(embedding 进程启动时读取)
image_backend: "clip_as_service" # clip_as_service | local_cnclip
image_backends:
clip_as_service:
server: "grpc://127.0.0.1:51000"
model_name: "CN-CLIP/ViT-L-14"
batch_size: 8
normalize_embeddings: true
local_cnclip:
model_name: "ViT-L-14"
device: null
batch_size: 8
normalize_embeddings: true
|
42e3aea6
tangwang
tidy
|
373
|
rerank:
|
701ae503
tangwang
docs
|
374
|
provider: "http"
|
42e3aea6
tangwang
tidy
|
375
376
377
378
|
base_url: "http://127.0.0.1:6007"
providers:
http:
base_url: "http://127.0.0.1:6007"
|
701ae503
tangwang
docs
|
379
|
service_url: "http://127.0.0.1:6007/rerank"
|
86d8358b
tangwang
config optimize
|
380
381
382
|
request:
max_docs: 1000
normalize: true
|
701ae503
tangwang
docs
|
383
|
# 服务内后端(reranker 进程启动时读取)
|
9de5ef49
tangwang
qwen3_vllm_score ...
|
384
|
backend: "qwen3_vllm_score" # bge | qwen3_vllm | qwen3_vllm_score | qwen3_transformers | qwen3_gguf | qwen3_gguf_06b | dashscope_rerank
|
701ae503
tangwang
docs
|
385
386
387
388
389
390
|
backends:
bge:
model_name: "BAAI/bge-reranker-v2-m3"
device: null
use_fp16: true
batch_size: 64
|
00c8ddb9
tangwang
suggest rank opti...
|
391
|
max_length: 160
|
701ae503
tangwang
docs
|
392
393
394
395
396
|
cache_dir: "./model_cache"
enable_warmup: true
qwen3_vllm:
model_name: "Qwen/Qwen3-Reranker-0.6B"
engine: "vllm"
|
00c8ddb9
tangwang
suggest rank opti...
|
397
|
max_model_len: 160
|
701ae503
tangwang
docs
|
398
|
tensor_parallel_size: 1
|
ef5baa86
tangwang
混杂语言处理
|
399
|
gpu_memory_utilization: 0.20
|
07cf5a93
tangwang
START_EMBEDDING=...
|
400
|
dtype: "float16"
|
bc089b43
tangwang
refactor(reranker...
|
401
402
|
enable_prefix_caching: true
enforce_eager: false
|
00c8ddb9
tangwang
suggest rank opti...
|
403
|
infer_batch_size: 100
|
9f5994b4
tangwang
reranker
|
404
|
sort_by_doc_length: true
|
fb973d19
tangwang
configs
|
405
|
# instruction: "Given a query, score the product for relevance"
|
6adbf18a
tangwang
reranker提示词优化
|
406
407
408
409
410
411
412
413
|
# "rank products by given query" 比 “Given a query, score the product for relevance” 更好点
# instruction: "rank products by given query, category match first"
# instruction: "Rank products by query relevance, prioritizing category match"
# instruction: "Rank products by query relevance, prioritizing category and style match"
# instruction: "Rank by query relevance, prioritize category & style"
# instruction: "Relevance ranking: category & style match first"
# instruction: "Score product relevance by query with category & style match prioritized"
instruction: "Rank products by query with category & style match prioritized"
|
9de5ef49
tangwang
qwen3_vllm_score ...
|
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
|
# vLLM LLM.score()(跨编码打分);与 qwen3_vllm 共用 .venv-reranker 与同模型权重(vLLM 0.17+ 用 runner/convert=auto,旧版曾用 task=score)
qwen3_vllm_score:
model_name: "Qwen/Qwen3-Reranker-0.6B"
# 官方 Hub 原版需 true;若改用已转换的 seq-cls 权重(如 tomaarsen/...-seq-cls)则设为 false
use_original_qwen3_hf_overrides: true
# 可选:与 vLLM 对齐;一般保持 auto
# vllm_runner: "auto"
# vllm_convert: "auto"
# 可选:在 use_original_qwen3_hf_overrides 为 true 时与内置 overrides 合并
# hf_overrides: {}
engine: "vllm"
max_model_len: 160
tensor_parallel_size: 1
gpu_memory_utilization: 0.20
dtype: "float16"
enable_prefix_caching: true
enforce_eager: false
infer_batch_size: 100
sort_by_doc_length: true
instruction: "Rank products by query with category & style match prioritized"
|
d31c7f65
tangwang
补充云服务reranker
|
434
435
|
qwen3_transformers:
model_name: "Qwen/Qwen3-Reranker-0.6B"
|
77bfa7e3
tangwang
query translate
|
436
|
instruction: "rank products by given query"
|
fb973d19
tangwang
configs
|
437
|
# instruction: "Score the product’s relevance to the given query"
|
d31c7f65
tangwang
补充云服务reranker
|
438
439
440
|
max_length: 8192
batch_size: 64
use_fp16: true
|
fb973d19
tangwang
configs
|
441
442
|
# sdpa:默认无需 flash-attn;若已安装 flash_attn 可改为 flash_attention_2
attn_implementation: "sdpa"
|
3d508beb
tangwang
reranker-4b-gguf
|
443
444
445
446
447
448
|
qwen3_gguf:
repo_id: "DevQuasar/Qwen.Qwen3-Reranker-4B-GGUF"
filename: "*Q8_0.gguf"
cache_dir: "./model_cache"
local_dir: "./models/reranker/qwen3-reranker-4b-gguf"
instruction: "Rank products by query with category & style match prioritized"
|
5c21a485
tangwang
qwen3-reranker-0....
|
449
450
451
452
453
|
# T4 16GB / 性能优先配置:全量层 offload,实测比保守配置明显更快
n_ctx: 512
n_batch: 512
n_ubatch: 512
n_gpu_layers: 999
|
3d508beb
tangwang
reranker-4b-gguf
|
454
455
456
457
458
459
460
461
462
463
464
465
|
main_gpu: 0
n_threads: 2
n_threads_batch: 4
flash_attn: true
offload_kqv: true
use_mmap: true
use_mlock: false
infer_batch_size: 8
sort_by_doc_length: true
length_sort_mode: "char"
enable_warmup: true
verbose: false
|
5c21a485
tangwang
qwen3-reranker-0....
|
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
|
qwen3_gguf_06b:
repo_id: "ggml-org/Qwen3-Reranker-0.6B-Q8_0-GGUF"
filename: "qwen3-reranker-0.6b-q8_0.gguf"
cache_dir: "./model_cache"
local_dir: "./models/reranker/qwen3-reranker-0.6b-q8_0-gguf"
instruction: "Rank products by query with category & style match prioritized"
# 0.6B GGUF / online rerank baseline:
# 实测 400 titles 单请求约 265s,因此它更适合作为低显存功能后备,不适合在线低延迟主路由。
n_ctx: 256
n_batch: 256
n_ubatch: 256
n_gpu_layers: 999
main_gpu: 0
n_threads: 2
n_threads_batch: 4
flash_attn: true
offload_kqv: true
use_mmap: true
use_mlock: false
infer_batch_size: 32
sort_by_doc_length: true
length_sort_mode: "char"
reuse_query_state: false
enable_warmup: true
verbose: false
|
d31c7f65
tangwang
补充云服务reranker
|
491
492
493
494
495
496
497
|
dashscope_rerank:
model_name: "qwen3-rerank"
# 按地域选择 endpoint:
# 中国: https://dashscope.aliyuncs.com/compatible-api/v1/reranks
# 新加坡: https://dashscope-intl.aliyuncs.com/compatible-api/v1/reranks
# 美国: https://dashscope-us.aliyuncs.com/compatible-api/v1/reranks
endpoint: "https://dashscope.aliyuncs.com/compatible-api/v1/reranks"
|
0d3e73ba
tangwang
rerank mini batch
|
498
499
|
api_key_env: "RERANK_DASHSCOPE_API_KEY_CN"
timeout_sec: 10.0 #
|
d31c7f65
tangwang
补充云服务reranker
|
500
|
top_n_cap: 0 # 0 表示 top_n=当前请求文档数;>0 则限制 top_n 上限
|
0d3e73ba
tangwang
rerank mini batch
|
501
|
batchsize: 64 # 0 关闭;>0 启用并发小包调度(top_n/top_n_cap 仍生效,分包后全局截断)
|
d31c7f65
tangwang
补充云服务reranker
|
502
503
504
|
instruct: "Given a shopping query, rank product titles by relevance"
max_retries: 2
retry_backoff_sec: 0.2
|
42e3aea6
tangwang
tidy
|
505
|
|
cadc77b6
tangwang
索引字段名、变量名、API数据结构...
|
506
|
# SPU配置(已启用,使用嵌套skus)
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
507
508
|
spu_config:
enabled: true
|
cadc77b6
tangwang
索引字段名、变量名、API数据结构...
|
509
|
spu_field: "spu_id"
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
510
|
inner_hits_size: 10
|
33839b37
tangwang
属性值参与搜索:
|
511
512
513
|
# 配置哪些option维度参与检索(进索引、以及在线搜索)
# 格式为list,选择option1/option2/option3中的一个或多个
searchable_option_dimensions: ['option1', 'option2', 'option3']
|
0064e946
tangwang
feat: 增量索引服务、租户配置...
|
514
515
|
# 租户配置(Tenant Configuration)
|
038e4e2f
tangwang
refactor(i18n): t...
|
516
|
# 每个租户可配置主语言 primary_language 与索引语言 index_languages(主市场语言,商家可勾选)
|
6f7840cf
tangwang
refactor: rename ...
|
517
|
# 默认 index_languages: [en, zh],可配置为任意 SOURCE_LANG_CODE_MAP.keys() 的子集
|
0064e946
tangwang
feat: 增量索引服务、租户配置...
|
518
|
tenant_config:
|
0064e946
tangwang
feat: 增量索引服务、租户配置...
|
519
|
default:
|
2739b281
tangwang
多语言索引调整
|
520
|
primary_language: "en"
|
038e4e2f
tangwang
refactor(i18n): t...
|
521
|
index_languages: ["en", "zh"]
|
0064e946
tangwang
feat: 增量索引服务、租户配置...
|
522
523
524
|
tenants:
"1":
primary_language: "zh"
|
038e4e2f
tangwang
refactor(i18n): t...
|
525
|
index_languages: ["zh", "en"]
|
0064e946
tangwang
feat: 增量索引服务、租户配置...
|
526
527
|
"2":
primary_language: "en"
|
038e4e2f
tangwang
refactor(i18n): t...
|
528
|
index_languages: ["en", "zh"]
|
0064e946
tangwang
feat: 增量索引服务、租户配置...
|
529
530
|
"3":
primary_language: "zh"
|
038e4e2f
tangwang
refactor(i18n): t...
|
531
|
index_languages: ["zh", "en"]
|
0064e946
tangwang
feat: 增量索引服务、租户配置...
|
532
533
|
"162":
primary_language: "zh"
|
038e4e2f
tangwang
refactor(i18n): t...
|
534
|
index_languages: ["zh", "en"]
|
cff5e86f
tangwang
reindex
|
535
536
|
"170":
primary_language: "en"
|
038e4e2f
tangwang
refactor(i18n): t...
|
537
|
index_languages: ["en", "zh"]
|