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 Fri Aug 21 14:05:36 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-07-24

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-07-24 05:33:54
rmse=0.055149
mae=0.025045
r2=0.929897
objective=regression;verbosity=-1;boosting_type=gbdt;num_leaves=508;learning_rate=0.013215764967762413;max_depth=27;max_bin=236;num_boost_round=2755;early_stopping_rounds=588;linear_tree=false;linear_lambda=0.0;early_stopping_min_delta=0.002;extra_trees=false;path_smooth=0.005;min_child_samples=103;bagging_fraction=0.7903638122503858;feature_fraction=0.963467973863788;lambda_l1=4.436959500929216;lambda_l2=1.4621869130378644;min_split_gain=0.12957609593961184;bagging_freq=13;max_delta_step=0.5031759579264496;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=(1033787, 30)
weight_min=0.000110
weight_max=1.312783
weight_mean=1.065334
weight_std=0.208292

feature_importance residuals actual_vs_predicted error_by_weight_range correlation_heatmap