|
1
|
use serde::Serialize; |
|
2
|
|
|
3
|
/// What gets sent to GresIQ when a model finishes loading. |
|
4
|
#[derive(Debug, Clone, Serialize)] |
|
5
|
pub struct ModelLoadedEvent { |
|
6
|
/// Which machine this is. Keep it stable across restarts — change it |
|
7
|
/// and you'll get a duplicate edge row in the dashboard. |
|
8
|
pub edge_id: String, |
|
9
|
/// The HuggingFace repo ID, e.g. `bartowski/Qwen2.5-3B-Instruct-GGUF`. |
|
10
|
pub model_id: String, |
|
11
|
/// What shows up in the UI, e.g. `Qwen 2.5 3B`. |
|
12
|
pub model_name: String, |
|
13
|
/// How long the load took. This is `elapsed.as_millis() as u64`, |
|
14
|
/// where `elapsed` is what `load_gguf_model` returns. |
|
15
|
pub load_duration_ms: u64, |
|
16
|
} |
|
17
|
|
|
18
|
/// What gets sent to GresIQ after each `send_message` or `generate`. |
|
19
|
#[derive(Debug, Clone, Serialize)] |
|
20
|
pub struct InferenceEvent { |
|
21
|
/// Same edge as in `ModelLoadedEvent`. |
|
22
|
pub edge_id: String, |
|
23
|
/// Same model as in `ModelLoadedEvent`. |
|
24
|
pub model_id: String, |
|
25
|
/// Auto-generated per request. Looks like `onde-1720000000000-42`. |
|
26
|
pub request_id: String, |
|
27
|
/// Wall-clock time for the whole response, in milliseconds. |
|
28
|
pub duration_ms: u64, |
|
29
|
/// `"success"`, `"cancelled"`, or `"error"`. Currently always |
|
30
|
/// `"success"` here — inference errors throw before we reach this point. |
|
31
|
pub status: String, |
|
32
|
} |