Skip to content

Releases: vernesong/mihomo

Mihomo Alpha with Smart Group

Pre-release

Choose a tag to compare

@github-actions github-actions released this 27 May 01:12

[声明] 本分支是在上游代码的基础上增加Smart策略组功能,关于Smart策略组的任何问题均与上游无关!
[Announcement] This branch is based on the upstream code to add Smart Groups functionality, any questions about Smart Groups are not related to the upstream!

Release created at Sat Sep 5 23:37:06 CST 2026
Synchronize Alpha branch code updates, keeping only the latest version


我应该下载哪个文件? / Which file should I download?
二进制文件筛选 / Binary file selector
查看文档 / Docs

Smart 策略组使用 / Smart Group Introduce

What's Changed

  • fix: clean up code formatting by @hhkbble in #1
  • Switch readiness from first-write to first-read; add firstReadCallBackConn by @hhkbble in #2
  • Smart: parallel dialing with racing and accurate connect-time by @hhkbble in #3
  • 增加Docker by @harbor66 in #5
  • fix: The icon and hidden options for smart group are not effective by @lamprose in #6
  • fix: 修复 Smart 组状态探测导致进程反复退出(StatusTest 缺少 DialContext) by @NevermoreN in #12

New Contributors

Full Changelog: LightGBM-Model...Prerelease-Alpha

LightGBM Model

LightGBM Model Pre-release
Pre-release

Choose a tag to compare

@vernesong vernesong released this 27 May 09:40

Date: 2026-08-26

Usage:

# enable model auto update, the default is false
lgbm-auto-update: true
# model auto update interval, the default is 72 (hours)
lgbm-update-interval: 72
# model update url
lgbm-url: "https://github.com/vernesong/mihomo/releases/download/LightGBM-Model/Model.bin"

profile:
  #smart-collector-size: data collection file size, the default is 100 (MB)
  smart-collector-size: 100

proxy-groups:
- name: Smart Group
  type: smart
  # policy-priority: <1 means lower priority, >1 means higher priority, the default is 1, pattern support regex and string
  policy-priority: "Premium:0.9;SG:1.3" 
  # uselightgbm: use LightGBM model predict weight
  uselightgbm: false
  # collectdata: collect datas for model training
  collectdata: false
  # sample-rate: data acquisition rate, desirable values are 0-1, the default is 1
  sample-rate: 1
  # prefer-asn: force and lookup asn first when nodes select, the default is false
  prefer-asn: true
  # tolerance: sort when proxies delays within tolerance are treated as equal, preventing jitter
  tolerance: 50
  ...
  • LightGBM for weight prediction (option: uselightgbm: true),need Model.bin file exist HomeDir (.config/mihomo/Model.bin) or use in OpenClash: (/etc/openclash/Model.bin)
  • Data collection function to facilitate for yourself-training of weight prediction models (option: collectdata: true), path in HomeDir (.config/mihomo/smart_weight_data.csv) or (/etc/openclash/smart_weight_data.csv) in OpenClash
  • If you need to train the model yourself, you could use feature transforms,support LightGBM v4.x

Api:

# Show proxy weight
curl -H 'Authorization: Bearer ${secret}' -X GET http://${controller-api}/group/${groupname}/weights
curl -H 'Authorization: Bearer ${secret}' -X GET http://${controller-api}/group/weights

# Flush cache data
curl -H 'Authorization: Bearer ${secret}' -X POST http://${controller-api}/cache/smart/flush
curl -H 'Authorization: Bearer ${secret}' -X POST http://${controller-api}/cache/smart/flush/${configname}

# Block(degrade) connections - node result to forceing choice another best
curl -H 'Authorization: Bearer ${secret}' -X DELETE http://${controller-api}/connections/smart/${id}

# LightGBM model upgrade
curl -H 'Authorization: Bearer ${secret}' -X POST http://${controller-api}/upgrade/lgbm

Predicting performance (Large)

train_time=2026-08-26 18:25:44
rmse=0.079078
mae=0.031351
r2=0.825161
metrics_scope=training_data_non_generalization
objective=huber;verbosity=-1;boosting_type=gbdt;num_leaves=632;learning_rate=0.014166814047156244;max_depth=21;max_bin=131;num_boost_round=695;early_stopping_rounds=567;linear_tree=false;linear_lambda=0.0;early_stopping_min_delta=0.0004732256777311774;extra_trees=false;path_smooth=0.005;monotone_constraints=[1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];alpha=0.33224321519132777;min_child_samples=195;bagging_fraction=0.8965682852506759;feature_fraction=0.8501747661181127;lambda_l1=1.0243428848542186;lambda_l2=0.09958644906054087;min_split_gain=0.004894782777099968;bagging_freq=13;cat_smooth=8.896753169053254;cat_l2=4.434072866313375;max_cat_threshold=18;max_delta_step=0.22613001826767937;min_child_weight=2.208690043450558;feature_fraction_bynode=0.9001032781786658;device=gpu;n_jobs=1;feature_pre_filter=false;force_col_wise=true;gpu_platform_id=0;gpu_device_id=0;metric=['rmse', 'r2']
data_shape=(2054924, 30)
weight_min=0.000110
weight_max=1.352108
weight_mean=1.070190
weight_std=0.189119

feature_importance residuals actual_vs_predicted error_by_weight_range correlation_heatmap