PEScn commited on
Commit
3b87e52
·
verified ·
1 Parent(s): 8c54cec

INFERENCE.md and knowline_server.py header: describe the front end directly

Browse files
Files changed (3) hide show
  1. INFERENCE.md +12 -14
  2. SHA256SUMS +2 -2
  3. knowline_server.py +3 -4
INFERENCE.md CHANGED
@@ -21,20 +21,18 @@ These settings reproduce our self-run Decision Index evaluation of these weights
21
 
22
  ### About the front end
23
 
24
- - `knowline_server.py` is the `/v1/systemone` front end of our run in one file. It contains:
25
- - rendering: the chat template with thinking off; the state is followed by one user turn with the instruction, the
26
- question and all options labelled A, B, ...; the assistant turn opens with `Answer:`;
27
- - label-token scoring: one prefill per question, a softmax over the option labels only;
28
- - the HTTP server.
29
- - Prompts and label tokens are byte-identical to llm2jev 0.6.1's `chat` style, which our run originally used. We checked
30
- this with a parity test:
31
- - prompts, answer keys and label token ids were identical on 7,500 rows (Decision Index rows plus training requests);
32
- - answers through a live SGLang engine matched our previous front end.
33
- - llm2jev is not needed. If you prefer the public package, `python -m llm2jev --prompt chat --temperature 1` against the
34
- same SGLang engine renders the same prompts.
35
- - Difference: it sends a request's questions to SGLang as one batched call, where ours sends one call per question
36
- from 16 threads.
37
- - Scores agree up to the engine's batching noise.
38
 
39
  ## Serve
40
 
 
21
 
22
  ### About the front end
23
 
24
+ `knowline_server.py` is the `/v1/systemone` front end of our run, packaged as one file. It contains:
25
+
26
+ - rendering: the chat template with thinking off; the state is followed by one user turn with the instruction, the
27
+ question and all options labelled A, B, ...; the assistant turn opens with `Answer:`;
28
+ - label-token scoring: one prefill per question, then a softmax over the option labels only;
29
+ - the HTTP server.
30
+
31
+ We checked it against the exact front end that produced our Decision Index run:
32
+
33
+ - prompts, answer keys and label token ids were identical on 7,500 Decision Index rows and training requests;
34
+ - through a live SGLang engine, choices agreed on all 953 questions of 200 Decision Index rows. The largest probability
35
+ difference, 0.02, is the same as between two identical calls to one engine (FP8 batching noise).
 
 
36
 
37
  ## Serve
38
 
SHA256SUMS CHANGED
@@ -1,8 +1,8 @@
1
  a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715 chat_template.jinja
2
  ddc63e1c717afa86c865bb5e01313d89d72bb53b97ad4a8a03ba8510c0621670 config.json
3
  f888421726665e8a84b738eed42a64875aed79de8be7daade851ac8bf4c0cef9 configuration.json
4
- 714dd8238f4fc81ab444930640cce35e1848d0e26a46a42d8288eca4063340ea INFERENCE.md
5
- a61eabde435ed6adb03318ab7e99bc34fbdaf7b62152a6874dd0c1b712bbd0b4 knowline_server.py
6
  50cbab8a892c5f2993b8c7351a99182507472def3b1374558308605d99b86b32 LICENSE
7
  a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt
8
  77d5d691c4c13ae08eacbddf9d145b2ebdaa0f6e69f4917630eb5a87691f15e5 model-00001-of-00002.safetensors
 
1
  a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715 chat_template.jinja
2
  ddc63e1c717afa86c865bb5e01313d89d72bb53b97ad4a8a03ba8510c0621670 config.json
3
  f888421726665e8a84b738eed42a64875aed79de8be7daade851ac8bf4c0cef9 configuration.json
4
+ ef6d24f67d5ebe37817037b509819cad8bb3f092f7a41ff9911880509119121e INFERENCE.md
5
+ 6ebf086c8a962e8b06962850b95cf91c085273995c25d3aa73636cf4c10cdd75 knowline_server.py
6
  50cbab8a892c5f2993b8c7351a99182507472def3b1374558308605d99b86b32 LICENSE
7
  a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt
8
  77d5d691c4c13ae08eacbddf9d145b2ebdaa0f6e69f4917630eb5a87691f15e5 model-00001-of-00002.safetensors
knowline_server.py CHANGED
@@ -1,4 +1,4 @@
1
- """KnowLine-4B-Gen1 /v1/systemone server: one self-contained file, no llm2jev or openjev install needed.
2
 
3
  python knowline_server.py --model PelaAI/KnowLine-4B-Gen1 --backend sglang --url http://127.0.0.1:9080 --port 8080
4
  python knowline_server.py --model PelaAI/KnowLine-4B-Gen1 --backend hf --port 8080 # transformers, no SGLang
@@ -6,14 +6,13 @@
6
  POST /v1/systemone {model?, state, questions: {id: {type, instructions, criteria}}} -> {id, model, answers, usage}
7
  GET /v1/models GET /health
8
 
9
- This is the front end of our Decision Index runs (openjev.prompting, "chat" style, temperature 1), in one file:
10
  - Rendering: the model's chat template with thinking off. The state comes as chat turns, followed by one user turn
11
  with the instruction, the question and all its options (labels A, B, ...); the assistant turn opens with "Answer:".
12
  - Scoring: one prefill per question, reading the logprob of every option's label token, then a softmax over the
13
  labels only.
14
  - A multi-question request first warms the shared prefix, then scores its questions in parallel (16 threads).
15
- Prompts and label tokens are byte-identical to llm2jev 0.6.1's chat style; the rendering and scoring code is ported from
16
- it (MIT, Copyright (c) 2026 AnyJev contributors).
17
  Dependencies: transformers and requests; torch as well for --backend hf; an SGLang server for --backend sglang.
18
  Licence of this file: MIT.
19
  """
 
1
+ """KnowLine-4B-Gen1 /v1/systemone server: one self-contained file, no extra package to install.
2
 
3
  python knowline_server.py --model PelaAI/KnowLine-4B-Gen1 --backend sglang --url http://127.0.0.1:9080 --port 8080
4
  python knowline_server.py --model PelaAI/KnowLine-4B-Gen1 --backend hf --port 8080 # transformers, no SGLang
 
6
  POST /v1/systemone {model?, state, questions: {id: {type, instructions, criteria}}} -> {id, model, answers, usage}
7
  GET /v1/models GET /health
8
 
9
+ This is the front end of our Decision Index runs ("chat" style, temperature 1), packaged as one file:
10
  - Rendering: the model's chat template with thinking off. The state comes as chat turns, followed by one user turn
11
  with the instruction, the question and all its options (labels A, B, ...); the assistant turn opens with "Answer:".
12
  - Scoring: one prefill per question, reading the logprob of every option's label token, then a softmax over the
13
  labels only.
14
  - A multi-question request first warms the shared prefix, then scores its questions in parallel (16 threads).
15
+ The rendering and scoring code is adapted from llm2jev 0.6.1 (MIT, Copyright (c) 2026 AnyJev contributors).
 
16
  Dependencies: transformers and requests; torch as well for --backend hf; an SGLang server for --backend sglang.
17
  Licence of this file: MIT.
18
  """