@@ -14,54 +14,51 @@ import "proto/metadata.proto";
1414// This schema is NOT a general-purpose manifest and MUST NOT be extended
1515// to support dynamic loading, headless execution, or runtime configuration.
1616message EncoderfileManifest {
17- // ------------------------------------------------------------------
18- // 1–49: General model metadata
19- // ------------------------------------------------------------------
20-
21- // Logical model type (e.g. embedding, sentence-embedding, classification).
22- // Used to validate compatibility with the runtime binary.
23- encoderfile.metadata.ModelType model_type = 1 ;
24-
25- // User-declared model name.
26- // This value is informational and has no behavioral impact.
27- string name = 2 ;
28-
29- // User-declared model version.
30- // This value is informational and has no behavioral impact.
31- string version = 3 ;
32-
33- // Backend.
34- Backend backend = 4 ;
35-
36- // ------------------------------------------------------------------
37- // 50–99: Transforms and preprocessing
38- // ------------------------------------------------------------------
39-
40- // ------------------------------------------------------------------
41- // 100–999: Embedded artifacts
42- // ------------------------------------------------------------------
43- // Artifacts are referenced via explicit fields, not a generic table.
44- // Each artifact reserves its own numeric range for future expansion.
45- // Any protobuf field ≥100 that participates in layout or runtime loading
46- // MUST have value-independent encoded size.
47-
48- // Model weights blob.
49- optional Artifact weights = 100 ;
50-
51- // Optional transform blob applied during model initialization.
52- // If present, the runtime must support the declared TransformType.
53- optional Artifact transform = 110 ;
54-
55- // Model configuration (e.g. architecture, hyperparameters).
56- optional Artifact model_config = 120 ;
57-
58- // Tokenizer data (vocab, merges, config).
59- // Serialized runtime::tokenizer::TokenizerService
60- optional Artifact tokenizer = 130 ;
17+ // ------------------------------------------------------------------
18+ // 1–49: General model metadata
19+ // ------------------------------------------------------------------
20+
21+ // Logical model type (e.g. embedding, sentence-embedding, classification).
22+ // Used to validate compatibility with the runtime binary.
23+ encoderfile.metadata.ModelType model_type = 1 ;
24+
25+ // User-declared model name.
26+ // This value is informational and has no behavioral impact.
27+ string name = 2 ;
28+
29+ // User-declared model version.
30+ // This value is informational and has no behavioral impact.
31+ string version = 3 ;
32+
33+ // ------------------------------------------------------------------
34+ // 50–99: Transforms and preprocessing
35+ // ------------------------------------------------------------------
36+
37+ // ------------------------------------------------------------------
38+ // 100–999: Embedded artifacts
39+ // ------------------------------------------------------------------
40+ // Artifacts are referenced via explicit fields, not a generic table.
41+ // Each artifact reserves its own numeric range for future expansion.
42+ // Any protobuf field ≥100 that participates in layout or runtime loading
43+ // MUST have value-independent encoded size.
44+
45+ // Model weights blob.
46+ optional Artifact weights = 100 ;
47+
48+ // Optional transform blob applied during model initialization.
49+ // If present, the runtime must support the declared TransformType.
50+ optional Artifact transform = 110 ;
51+
52+ // Model configuration (e.g. architecture, hyperparameters).
53+ optional Artifact model_config = 120 ;
54+
55+ // Tokenizer data (vocab, merges, config).
56+ // Serialized runtime::tokenizer::TokenizerService
57+ optional Artifact tokenizer = 130 ;
6158}
6259
6360message LuaLibs {
64- repeated string libs = 1 ;
61+ repeated string libs = 1 ;
6562}
6663
6764// Transform describes embedded preprocessing/postprocessing steps applied to inputs
@@ -70,52 +67,37 @@ message LuaLibs {
7067// Transforms are embedded source code and executed by the runtime.
7168// Only explicitly supported TransformTypes are allowed.
7269message Transform {
73- // Declares the execution environment for the transform.
74- TransformType transform_type = 1 ;
70+ // Declares the execution environment for the transform.
71+ TransformType transform_type = 1 ;
7572
76- // Transform source code.
77- // Interpretation is defined by the TransformType.
78- string transform = 2 ;
73+ // Transform source code.
74+ // Interpretation is defined by the TransformType.
75+ string transform = 2 ;
7976
80- optional LuaLibs lua_libs = 3 ;
77+ optional LuaLibs lua_libs = 3 ;
8178}
8279
8380// Artifact describes a contiguous byte range within the embedded payload.
8481//
8582// Byte offsets are relative to manifest offset found in footer, not the start of the binary.
8683message Artifact {
87- // Byte offset relative to manifest offset found in footer
88- fixed64 offset = 1 ;
84+ // Byte offset relative to manifest offset found in footer
85+ fixed64 offset = 1 ;
8986
90- // Length of the artifact in bytes.
91- fixed64 length = 2 ;
87+ // Length of the artifact in bytes.
88+ fixed64 length = 2 ;
9289
93- // SHA-256 checksum of the artifact contents, hex-encoded.
94- // Used for integrity verification at runtime.
95- // MUST always be 32 bytes.
96- bytes sha256 = 3 ;
90+ // SHA-256 checksum of the artifact contents, hex-encoded.
91+ // Used for integrity verification at runtime.
92+ // MUST always be 32 bytes.
93+ bytes sha256 = 3 ;
9794}
9895
9996// Supported transform types.
10097enum TransformType {
101- // Unspecified transform type. This should not be used.
102- TRANSFORM_TYPE_UNSPECIFIED = 0 ;
98+ // Unspecified transform type. This should not be used.
99+ TRANSFORM_TYPE_UNSPECIFIED = 0 ;
103100
104- // Lua source executed by the runtime.
105- LUA = 1 ;
106- }
107-
108- // Execution backend required by the embedded runtime binary.
109- //
110- // This enum is informational here; backend compatibility is enforced
111- // by the runtime binary itself, not by the payload.
112- enum Backend {
113- // CPU-only execution (no hardware acceleration).
114- CPU = 0 ;
115-
116- // NVIDIA CUDA backend.
117- CUDA = 1 ;
118-
119- // Apple Metal backend.
120- METAL = 2 ;
101+ // Lua source executed by the runtime.
102+ LUA = 1 ;
121103}
0 commit comments