Skip to content

Commit bc1f22a

Browse files
committed
feat(julia): extend /gnn/health with model_path, vocab_size, training_records_received
Adds GNN_MODEL_PATH Ref so load_gnn_model records the path of the loaded weights. The /gnn/health handler now returns the superset payload (back- compat: all prior fields remain) so the Rust S5 harness can confirm a real model is loaded and distinguish it from the cosine-fallback path. https://claude.ai/code/session_01YPqu7gti4azBach6ZvpRFJ
1 parent 2ea4228 commit bc1f22a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/julia/api/gnn_endpoint.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ using LinearAlgebra
2929

3030
# Reference to global GNN model (loaded at server startup)
3131
const GNN_MODEL = Ref{Any}(nothing)
32+
const GNN_MODEL_PATH = Ref{Union{Nothing,String}}(nothing)
3233
const GNN_VOCAB = Ref{Any}(nothing)
3334

3435
# Per-(prover, domain) success-rate weights pushed from Rust via
@@ -64,6 +65,7 @@ function load_gnn_model(models_dir::String)
6465
try
6566
solver = load_solver(model_path)
6667
GNN_MODEL[] = solver
68+
GNN_MODEL_PATH[] = model_path
6769
@info "GNN model loaded successfully from $model_path"
6870
return true
6971
catch e
@@ -74,6 +76,7 @@ function load_gnn_model(models_dir::String)
7476
# All candidates exhausted — cosine fallback is genuine missing-model path.
7577
@warn "No trained GNN model found in $(joinpath(models_dir, "neural")) — ranking will use cosine similarity until weights are trained (run: just train-cpu)"
7678
GNN_MODEL[] = nothing
79+
GNN_MODEL_PATH[] = nothing
7780
return false
7881
end
7982

@@ -360,9 +363,12 @@ function handle_gnn_health(req::HTTP.Request)
360363
response = Dict(
361364
"status" => "ok",
362365
"gnn_model_loaded" => model_loaded,
366+
"model_path" => model_loaded ? GNN_MODEL_PATH[] : nothing,
367+
"vocab_size" => model_loaded ? length(GNN_VOCAB[]) : 0,
368+
"training_records_received" => TOTAL_TRAINING_RECORDS[],
363369
"num_gnn_layers" => model_loaded ? 4 : 0,
364370
"service" => "echidna-gnn",
365-
"version" => "2.1.0"
371+
"version" => "2.1.0",
366372
)
367373

368374
return HTTP.Response(200, JSON3.write(response))

0 commit comments

Comments
 (0)