mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 09:40:58 +00:00
[feat] add monitoring template for the LM Studio platform (#4082)
Co-authored-by: Tomsun28 <tomsun28@outlook.com>
This commit is contained in:
@@ -0,0 +1,202 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
|
||||
category: llm
|
||||
# The monitoring type eg: linux windows tomcat mysql aws...
|
||||
app: lmstudio
|
||||
# The monitoring i18n name
|
||||
name:
|
||||
zh-CN: LM Studio 监控
|
||||
en-US: LM Studio
|
||||
ja-JP: LM Studio
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 将调用 LM Studio REST API 接口,监测本地模型列表数据。<br>您可以先点击"新增 LM Studio"按钮并进行配置,或在"更多操作"中导入已有配置。
|
||||
en-US: HertzBeat will call the LM Studio REST API to monitor local models.<br>You can click the "Add LM Studio" button to configure it first, or import existing configurations in the "More Actions" section.
|
||||
zh-TW: HertzBeat 將調用 LM Studio REST API 接口,監測本地模型列表數據。<br>您可以先點擊"新增 LM Studio"按鈕並進行配置,或在"更多操作"中導入已有配置。
|
||||
ja-JP: HertzBeatは、LM Studio REST APIを呼び出してメトリクスを監視します。<br>「<i>新規 LM Studio</i>」をクリックして設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/lmstudio
|
||||
en-US: https://hertzbeat.apache.org/docs/help/lmstudio
|
||||
# Input params define for monitoring(render web ui by the definition)
|
||||
params:
|
||||
# field-param field key
|
||||
- field: host
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: ターゲットホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
required: true
|
||||
- field: port
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
range: '[0,65535]'
|
||||
required: true
|
||||
defaultValue: 1234
|
||||
- field: ssl
|
||||
name:
|
||||
zh-CN: 启用HTTPS
|
||||
en-US: HTTPS
|
||||
ja-JP: HTTPS
|
||||
type: boolean
|
||||
required: false
|
||||
defaultValue: false
|
||||
- field: token
|
||||
name:
|
||||
zh-CN: API Token
|
||||
en-US: API Token
|
||||
ja-JP: APIトークン
|
||||
type: text
|
||||
required: false
|
||||
# collect metrics config list
|
||||
metrics:
|
||||
# metrics - models
|
||||
- name: models
|
||||
# metrics name i18n label
|
||||
i18n:
|
||||
zh-CN: 模型列表
|
||||
en-US: Models
|
||||
ja-JP: モデル一覧
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
# collect metrics content
|
||||
fields:
|
||||
# field-metric name, i18n-metric name i18n label, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: key
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 模型标识
|
||||
en-US: Model Key
|
||||
ja-JP: モデルキー
|
||||
label: true
|
||||
- field: display_name
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 模型名称
|
||||
en-US: Display Name
|
||||
ja-JP: 表示名
|
||||
- field: type
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 模型类型
|
||||
en-US: Model Type
|
||||
ja-JP: モデルタイプ
|
||||
- field: publisher
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 发布者
|
||||
en-US: Publisher
|
||||
ja-JP: パブリッシャー
|
||||
- field: architecture
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 架构
|
||||
en-US: Architecture
|
||||
ja-JP: アーキテクチャ
|
||||
- field: quantization_name
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 量化方式
|
||||
en-US: Quantization
|
||||
ja-JP: 量子化
|
||||
- field: quantization_bits
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 量化位数
|
||||
en-US: Quantization Bits
|
||||
ja-JP: 量子化ビット数
|
||||
- field: size_bytes
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 模型大小
|
||||
en-US: Model Size
|
||||
ja-JP: モデルサイズ
|
||||
unit: MB
|
||||
- field: params_string
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 参数量
|
||||
en-US: Parameters
|
||||
ja-JP: パラメータ数
|
||||
- field: max_context_length
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大上下文长度
|
||||
en-US: Max Context Length
|
||||
ja-JP: 最大コンテキスト長
|
||||
- field: format
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 模型格式
|
||||
en-US: Format
|
||||
ja-JP: フォーマット
|
||||
aliasFields:
|
||||
- $.key
|
||||
- $.display_name
|
||||
- $.type
|
||||
- $.publisher
|
||||
- $.architecture
|
||||
- $.quantization.name
|
||||
- $.quantization.bits_per_weight
|
||||
- $.size_bytes
|
||||
- $.params_string
|
||||
- $.max_context_length
|
||||
- $.format
|
||||
calculates:
|
||||
- key=$.key
|
||||
- display_name=$.display_name
|
||||
- type=$.type
|
||||
- publisher=$.publisher
|
||||
- architecture=$.architecture
|
||||
- quantization_name=$.quantization.name
|
||||
- quantization_bits=$.quantization.bits_per_weight
|
||||
- size_bytes=$.size_bytes
|
||||
- params_string=$.params_string
|
||||
- max_context_length=$.max_context_length
|
||||
- format=$.format
|
||||
units:
|
||||
- size_bytes=B->MB
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
http:
|
||||
# http host: ipv4 ipv6 domain
|
||||
host: ^_^host^_^
|
||||
# http port
|
||||
port: ^_^port^_^
|
||||
# http url
|
||||
url: /api/v1/models
|
||||
# http method: GET POST PUT DELETE PATCH
|
||||
method: GET
|
||||
# if enabled https
|
||||
ssl: ^_^ssl^_^
|
||||
# http auth
|
||||
authorization:
|
||||
# http auth type: Basic Auth, Digest Auth, Bearer Token
|
||||
type: Bearer Token
|
||||
bearerTokenToken: ^_^token^_^
|
||||
# http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule
|
||||
parseType: jsonPath
|
||||
parseScript: '$.models[*]'
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
id: lmstudio
|
||||
title: Monitoring LM Studio
|
||||
sidebar_label: LM Studio
|
||||
keywords: [ open source monitoring system, open source network monitoring, LM Studio monitoring, local LLM monitoring ]
|
||||
---
|
||||
|
||||
### Prerequisites
|
||||
|
||||
> Ensure that the LM Studio server is running and the REST API is enabled.
|
||||
> By default, LM Studio listens on `localhost:1234`.
|
||||
|
||||
### Notes
|
||||
|
||||
> 1. HertzBeat needs network access to the LM Studio server. Ensure the target host and port are reachable.
|
||||
> 2. By default, LM Studio does not require authentication for API requests. To enable authentication so that only
|
||||
requests with a valid API Token are accepted, toggle the switch in the Developers Page > Server Settings.
|
||||
|
||||
### Configuration Parameters
|
||||
|
||||
| Parameter Name | Parameter Description |
|
||||
|:------------------|:-----------------------------------------------------------------------------------------------|
|
||||
| Target Host | The IP address or domain of the LM Studio server. Default: `localhost`. |
|
||||
| Port | The port of the LM Studio REST API. Default: `1234`. |
|
||||
| HTTPS | Whether to enable HTTPS. |
|
||||
| API Token | The API token for authentication (optional, required if API auth is enabled in LM Studio). |
|
||||
| Task Name | Identify the name of this monitoring, ensuring uniqueness. |
|
||||
| Collector | Configure which collector to use for scheduling collection for this monitoring. |
|
||||
| Monitoring Period | Interval time for periodic data collection, in seconds, with a minimum interval of 30 seconds. |
|
||||
| Bound Tags | Tags for managing classification of monitoring resources. |
|
||||
| Description | Additional identification and description for this monitoring, users can leave remarks here. |
|
||||
|
||||
### Collection Metrics
|
||||
|
||||
#### Metric Set: Models
|
||||
|
||||
| Metric Name | Metric Unit | Metric Description |
|
||||
|--------------------|-------------|------------------------------------------|
|
||||
| Model Key | None | Unique model identifier |
|
||||
| Display Name | None | Human-readable model name |
|
||||
| Model Type | None | Model category: llm or embedding |
|
||||
| Publisher | None | Model creator identifier |
|
||||
| Architecture | None | Model architecture (e.g., gemma3, llama) |
|
||||
| Quantization | None | Quantization method (e.g., Q4_0, F16) |
|
||||
| Quantization Bits | None | Bits per weight for quantization |
|
||||
| Model Size | MB | Model file size |
|
||||
| Parameters | None | Parameter count (e.g., 7B, 270M) |
|
||||
| Max Context Length | None | Maximum token context window |
|
||||
| Format | None | Model file format (gguf, mlx) |
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
id: lmstudio
|
||||
title: 监控:LM Studio
|
||||
sidebar_label: LM Studio
|
||||
keywords: [ 开源监控系统, 开源网络监控, LM Studio监控, 本地大模型监控 ]
|
||||
---
|
||||
|
||||
### 准备工作
|
||||
|
||||
> 确保 LM Studio 服务已启动并开启了 REST API。
|
||||
> 默认情况下,LM Studio 监听 `localhost:1234`。
|
||||
|
||||
### 注意事项
|
||||
|
||||
> 1. HertzBeat 需要能够访问 LM Studio 服务器,请确保目标主机和端口可达。
|
||||
> 2. 默认情况下,LM Studio 不要求对 API 请求进行身份验证。要启用身份验证,以便仅接受带有有效 API
|
||||
令牌的请求,请在“开发者页面”>“服务器设置”中切换开关。
|
||||
|
||||
### 配置参数
|
||||
|
||||
| 参数名称 | 参数帮助描述 |
|
||||
|:----------|:----------------------------------------|
|
||||
| 目标Host | LM Studio 服务器的 IP 地址或域名。默认:`localhost`。 |
|
||||
| 端口 | LM Studio REST API 的端口。默认:`1234`。 |
|
||||
| 启用HTTPS | 是否启用 HTTPS。 |
|
||||
| API Token | API 认证令牌 |
|
||||
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
|
||||
| 采集器 | 配置此监控使用哪台采集器调度采集。 |
|
||||
| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 |
|
||||
| 绑定标签 | 对监控资源的分类管理标签。 |
|
||||
| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 |
|
||||
|
||||
### 采集指标
|
||||
|
||||
#### 指标集合:模型列表
|
||||
|
||||
| 指标名称 | 指标单位 | 指标帮助描述 |
|
||||
|:--------|:-----|:---------------------|
|
||||
| 模型标识 | 无 | 模型唯一标识符 |
|
||||
| 模型名称 | 无 | 可读的模型名称 |
|
||||
| 模型类型 | 无 | 模型类别:llm 或 embedding |
|
||||
| 发布者 | 无 | 模型创建者标识 |
|
||||
| 架构 | 无 | 模型架构(如 gemma3、llama) |
|
||||
| 量化方式 | 无 | 量化方法(如 Q4_0、F16) |
|
||||
| 量化位数 | 无 | 每权重的量化位数 |
|
||||
| 模型大小 | MB | 模型文件大小 |
|
||||
| 参数量 | 无 | 参数数量(如 7B、270M) |
|
||||
| 最大上下文长度 | 无 | 最大 token 上下文窗口 |
|
||||
| 模型格式 | 无 | 模型文件格式(gguf、mlx) |
|
||||
+6
-1
@@ -295,7 +295,12 @@
|
||||
{
|
||||
"type": "category",
|
||||
"label": "llm",
|
||||
"items": ["help/openai","help/deepseek","help/ollama"]
|
||||
"items": [
|
||||
"help/openai",
|
||||
"help/deepseek",
|
||||
"help/ollama",
|
||||
"help/lmstudio"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
|
||||
Reference in New Issue
Block a user