@@ -46,6 +46,11 @@ service Backend {
4646 rpc StopFineTune (FineTuneStopRequest ) returns (Result ) {}
4747 rpc ListCheckpoints (ListCheckpointsRequest ) returns (ListCheckpointsResponse ) {}
4848 rpc ExportModel (ExportModelRequest ) returns (Result ) {}
49+
50+ // Quantization RPCs
51+ rpc StartQuantization (QuantizationRequest ) returns (QuantizationJobResult ) {}
52+ rpc QuantizationProgress (QuantizationProgressRequest ) returns (stream QuantizationProgressUpdate ) {}
53+ rpc StopQuantization (QuantizationStopRequest ) returns (Result ) {}
4954}
5055
5156// Define the empty request
@@ -637,3 +642,36 @@ message ExportModelRequest {
637642 string model = 5 ; // base model name (for merge operations)
638643 map <string , string > extra_options = 6 ;
639644}
645+
646+ // Quantization messages
647+
648+ message QuantizationRequest {
649+ string model = 1 ; // HF model name or local path
650+ string quantization_type = 2 ; // q4_k_m, q5_k_m, q8_0, f16, etc.
651+ string output_dir = 3 ; // where to write output files
652+ string job_id = 4 ; // client-assigned job ID
653+ map <string , string > extra_options = 5 ; // hf_token, custom flags, etc.
654+ }
655+
656+ message QuantizationJobResult {
657+ string job_id = 1 ;
658+ bool success = 2 ;
659+ string message = 3 ;
660+ }
661+
662+ message QuantizationProgressRequest {
663+ string job_id = 1 ;
664+ }
665+
666+ message QuantizationProgressUpdate {
667+ string job_id = 1 ;
668+ float progress_percent = 2 ;
669+ string status = 3 ; // queued, downloading, converting, quantizing, completed, failed, stopped
670+ string message = 4 ;
671+ string output_file = 5 ; // set when completed — path to the output GGUF file
672+ map <string , float > extra_metrics = 6 ; // e.g. file_size_mb, compression_ratio
673+ }
674+
675+ message QuantizationStopRequest {
676+ string job_id = 1 ;
677+ }
0 commit comments