jev-compatible-server 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jev_compatible_server-0.1.0/.gitignore +8 -0
- jev_compatible_server-0.1.0/CONTRIBUTING.md +25 -0
- jev_compatible_server-0.1.0/PKG-INFO +157 -0
- jev_compatible_server-0.1.0/README.md +123 -0
- jev_compatible_server-0.1.0/configs/public-models.json +981 -0
- jev_compatible_server-0.1.0/pyproject.toml +99 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/__init__.py +5 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/app.py +144 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/backends.py +320 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/batching.py +68 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/bosun.py +229 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/causal_options.py +228 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/classifier_adapters.py +472 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/cross_encoder.py +71 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/custom_heads.py +704 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/encoder_decoder.py +630 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/gliner2.py +40 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/hidden_state_probe.py +384 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/laya.py +135 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/native_systemone.py +248 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/protocol.py +104 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/registry.py +283 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/runtime.py +237 -0
- jev_compatible_server-0.1.0/src/jev_compatible_server/sequence_classifier.py +219 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome for reusable decision readouts, execution backends,
|
|
4
|
+
model recipes, compatibility tests, performance work, and documentation.
|
|
5
|
+
|
|
6
|
+
Before contributing:
|
|
7
|
+
|
|
8
|
+
1. Keep model behavior declarative when an existing backend and readout already
|
|
9
|
+
cover it. New model IDs should normally require registry metadata, not a
|
|
10
|
+
model-name conditional.
|
|
11
|
+
2. Add a reusable readout only when the model introduces genuinely new output
|
|
12
|
+
semantics or scoring math.
|
|
13
|
+
3. Include tests for protocol compatibility and invalid configuration.
|
|
14
|
+
4. Keep the README concise and put detailed material in `docs/`.
|
|
15
|
+
|
|
16
|
+
Run the test and static-analysis suite before submitting a change:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
uv run --with pytest pytest
|
|
20
|
+
uvx ruff check .
|
|
21
|
+
uv run --with mypy mypy src
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Open an issue before a large architectural change so the backend/readout
|
|
25
|
+
boundary and compatibility contract can be agreed first.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: jev-compatible-server
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open inference runtime for decision models with a Jev-compatible API.
|
|
5
|
+
Project-URL: Documentation, https://github.com/Hanno-Labs/jev-compatible-server/tree/main/docs
|
|
6
|
+
Project-URL: Issues, https://github.com/Hanno-Labs/jev-compatible-server/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/Hanno-Labs/jev-compatible-server
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Requires-Dist: fastapi>=0.115.0
|
|
10
|
+
Requires-Dist: pydantic>=2.8.0
|
|
11
|
+
Requires-Dist: uvicorn>=0.30.0
|
|
12
|
+
Provides-Extra: all
|
|
13
|
+
Requires-Dist: accelerate>=1.10.0; extra == 'all'
|
|
14
|
+
Requires-Dist: gliclass>=0.1.0; extra == 'all'
|
|
15
|
+
Requires-Dist: huggingface-hub>=0.30.0; extra == 'all'
|
|
16
|
+
Requires-Dist: llama-cpp-python>=0.3.0; extra == 'all'
|
|
17
|
+
Requires-Dist: numpy>=1.26.0; extra == 'all'
|
|
18
|
+
Requires-Dist: peft>=0.21.0; extra == 'all'
|
|
19
|
+
Requires-Dist: sentence-transformers>=5.0.0; extra == 'all'
|
|
20
|
+
Requires-Dist: torch>=2.3.0; extra == 'all'
|
|
21
|
+
Requires-Dist: transformers>=5.3.0; extra == 'all'
|
|
22
|
+
Provides-Extra: llama
|
|
23
|
+
Requires-Dist: llama-cpp-python>=0.3.0; extra == 'llama'
|
|
24
|
+
Provides-Extra: transformers
|
|
25
|
+
Requires-Dist: accelerate>=1.10.0; extra == 'transformers'
|
|
26
|
+
Requires-Dist: gliclass>=0.1.0; extra == 'transformers'
|
|
27
|
+
Requires-Dist: huggingface-hub>=0.30.0; extra == 'transformers'
|
|
28
|
+
Requires-Dist: numpy>=1.26.0; extra == 'transformers'
|
|
29
|
+
Requires-Dist: peft>=0.21.0; extra == 'transformers'
|
|
30
|
+
Requires-Dist: sentence-transformers>=5.0.0; extra == 'transformers'
|
|
31
|
+
Requires-Dist: torch>=2.3.0; extra == 'transformers'
|
|
32
|
+
Requires-Dist: transformers>=5.3.0; extra == 'transformers'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
<h1 align="center">jev-compatible-server</h1>
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
Run open decision models behind a Jev-compatible API.
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<a href="docs/README.md">Documentation</a> ·
|
|
43
|
+
<a href="docs/API.md">API</a> ·
|
|
44
|
+
<a href="docs/MODELS.md">Models</a> ·
|
|
45
|
+
<a href="CONTRIBUTING.md">Contributing</a>
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
## Quickstart
|
|
49
|
+
|
|
50
|
+
Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then start
|
|
51
|
+
the server with the Transformers backend:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uvx --from 'jev-compatible-server[transformers]' jev-compatible-server
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Send a decision request to `POST /v1/systemone`:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
curl http://localhost:8000/v1/systemone \
|
|
61
|
+
--header 'content-type: application/json' \
|
|
62
|
+
--data '{
|
|
63
|
+
"model": "kev-0.5b",
|
|
64
|
+
"state": "A customer says they were charged twice.",
|
|
65
|
+
"questions": {
|
|
66
|
+
"route": {
|
|
67
|
+
"type": "choice",
|
|
68
|
+
"instructions": "Which team should own this ticket?",
|
|
69
|
+
"criteria": {
|
|
70
|
+
"billing": "Payment, invoice, or refund problems",
|
|
71
|
+
"technical": "Product bugs and technical failures"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The first request downloads the selected model and its backbone from Hugging
|
|
79
|
+
Face. See the [API reference](docs/API.md) for all question and response types.
|
|
80
|
+
|
|
81
|
+
## Installation
|
|
82
|
+
|
|
83
|
+
`uvx` installs the server into an isolated environment and runs it directly.
|
|
84
|
+
Select the extra for the inference backend you need:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Hugging Face Transformers models
|
|
88
|
+
uvx --from 'jev-compatible-server[transformers]' jev-compatible-server
|
|
89
|
+
|
|
90
|
+
# llama.cpp/GGUF models
|
|
91
|
+
DECISION_BACKEND=llama \
|
|
92
|
+
DECISION_MODEL_PATH=/path/to/model.gguf \
|
|
93
|
+
uvx --from 'jev-compatible-server[llama]' jev-compatible-server
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The bundled public-model registry is used by default. Custom GGUF models and
|
|
97
|
+
registries require the environment described in the
|
|
98
|
+
[model recipe guide](docs/MODEL_RECIPES.md).
|
|
99
|
+
|
|
100
|
+
## Description
|
|
101
|
+
|
|
102
|
+
`jev-compatible-server` is an open inference runtime for decision models. It
|
|
103
|
+
accepts one shared state with one or more typed questions, runs the selected
|
|
104
|
+
model through llama.cpp or Hugging Face Transformers, and returns normalized
|
|
105
|
+
`choice`, `score`, and `noul` answers. Models that implement only part of that
|
|
106
|
+
contract return an explicit `unsupported` result for each incompatible
|
|
107
|
+
question without discarding compatible answers in the same request.
|
|
108
|
+
|
|
109
|
+
The HTTP interface implements Jev's `POST /v1/systemone` request and response
|
|
110
|
+
shape so applications can move between hosted Jev and self-hosted models
|
|
111
|
+
without replacing their decision API.
|
|
112
|
+
|
|
113
|
+
## Goals
|
|
114
|
+
|
|
115
|
+
- Provide a common runtime for open decision models, as llama.cpp does for
|
|
116
|
+
language models.
|
|
117
|
+
- Preserve the Jev API contract for straightforward application cutover.
|
|
118
|
+
- Keep model behavior declarative when an existing backend and readout can run
|
|
119
|
+
it.
|
|
120
|
+
- Support multiple execution engines without coupling applications to model
|
|
121
|
+
architecture.
|
|
122
|
+
- Make batching, model coverage, and compatibility behavior explicit and
|
|
123
|
+
testable.
|
|
124
|
+
|
|
125
|
+
## Supported backends
|
|
126
|
+
|
|
127
|
+
| Backend | Model format | Built-in readouts |
|
|
128
|
+
| --- | --- | --- |
|
|
129
|
+
| llama.cpp | GGUF | token logits |
|
|
130
|
+
| Hugging Face Transformers | Transformers checkpoints | token logits, native Bosun decision tokens, pointer head, encoder-decoder margin, scalar sequence classifier, hidden-state probe |
|
|
131
|
+
|
|
132
|
+
Backends execute the neural network; readouts convert model outputs into typed
|
|
133
|
+
decision probabilities. See [models and backends](docs/MODELS.md) for supported
|
|
134
|
+
checkpoints and the exact distinction.
|
|
135
|
+
|
|
136
|
+
## Documentation
|
|
137
|
+
|
|
138
|
+
- [API reference](docs/API.md)
|
|
139
|
+
- [Supported models and backends](docs/MODELS.md)
|
|
140
|
+
- [Model recipes and registries](docs/MODEL_RECIPES.md)
|
|
141
|
+
- [Batching and performance](docs/PERFORMANCE.md)
|
|
142
|
+
|
|
143
|
+
## Contributing
|
|
144
|
+
|
|
145
|
+
Contributions for new backends, reusable readouts, model recipes, tests, and
|
|
146
|
+
documentation are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) before making
|
|
147
|
+
a change.
|
|
148
|
+
|
|
149
|
+
## Acknowledgements
|
|
150
|
+
|
|
151
|
+
`jev-compatible-server` builds on
|
|
152
|
+
[llama.cpp](https://github.com/ggml-org/llama.cpp),
|
|
153
|
+
[llama-cpp-python](https://github.com/abetlen/llama-cpp-python),
|
|
154
|
+
[Transformers](https://github.com/huggingface/transformers),
|
|
155
|
+
[FastAPI](https://github.com/fastapi/fastapi), and
|
|
156
|
+
[uv](https://github.com/astral-sh/uv). It also depends on the authors who
|
|
157
|
+
publish open decision-model checkpoints and document their readout contracts.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<h1 align="center">jev-compatible-server</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
Run open decision models behind a Jev-compatible API.
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="docs/README.md">Documentation</a> ·
|
|
9
|
+
<a href="docs/API.md">API</a> ·
|
|
10
|
+
<a href="docs/MODELS.md">Models</a> ·
|
|
11
|
+
<a href="CONTRIBUTING.md">Contributing</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
## Quickstart
|
|
15
|
+
|
|
16
|
+
Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then start
|
|
17
|
+
the server with the Transformers backend:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
uvx --from 'jev-compatible-server[transformers]' jev-compatible-server
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Send a decision request to `POST /v1/systemone`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
curl http://localhost:8000/v1/systemone \
|
|
27
|
+
--header 'content-type: application/json' \
|
|
28
|
+
--data '{
|
|
29
|
+
"model": "kev-0.5b",
|
|
30
|
+
"state": "A customer says they were charged twice.",
|
|
31
|
+
"questions": {
|
|
32
|
+
"route": {
|
|
33
|
+
"type": "choice",
|
|
34
|
+
"instructions": "Which team should own this ticket?",
|
|
35
|
+
"criteria": {
|
|
36
|
+
"billing": "Payment, invoice, or refund problems",
|
|
37
|
+
"technical": "Product bugs and technical failures"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The first request downloads the selected model and its backbone from Hugging
|
|
45
|
+
Face. See the [API reference](docs/API.md) for all question and response types.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
`uvx` installs the server into an isolated environment and runs it directly.
|
|
50
|
+
Select the extra for the inference backend you need:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Hugging Face Transformers models
|
|
54
|
+
uvx --from 'jev-compatible-server[transformers]' jev-compatible-server
|
|
55
|
+
|
|
56
|
+
# llama.cpp/GGUF models
|
|
57
|
+
DECISION_BACKEND=llama \
|
|
58
|
+
DECISION_MODEL_PATH=/path/to/model.gguf \
|
|
59
|
+
uvx --from 'jev-compatible-server[llama]' jev-compatible-server
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The bundled public-model registry is used by default. Custom GGUF models and
|
|
63
|
+
registries require the environment described in the
|
|
64
|
+
[model recipe guide](docs/MODEL_RECIPES.md).
|
|
65
|
+
|
|
66
|
+
## Description
|
|
67
|
+
|
|
68
|
+
`jev-compatible-server` is an open inference runtime for decision models. It
|
|
69
|
+
accepts one shared state with one or more typed questions, runs the selected
|
|
70
|
+
model through llama.cpp or Hugging Face Transformers, and returns normalized
|
|
71
|
+
`choice`, `score`, and `noul` answers. Models that implement only part of that
|
|
72
|
+
contract return an explicit `unsupported` result for each incompatible
|
|
73
|
+
question without discarding compatible answers in the same request.
|
|
74
|
+
|
|
75
|
+
The HTTP interface implements Jev's `POST /v1/systemone` request and response
|
|
76
|
+
shape so applications can move between hosted Jev and self-hosted models
|
|
77
|
+
without replacing their decision API.
|
|
78
|
+
|
|
79
|
+
## Goals
|
|
80
|
+
|
|
81
|
+
- Provide a common runtime for open decision models, as llama.cpp does for
|
|
82
|
+
language models.
|
|
83
|
+
- Preserve the Jev API contract for straightforward application cutover.
|
|
84
|
+
- Keep model behavior declarative when an existing backend and readout can run
|
|
85
|
+
it.
|
|
86
|
+
- Support multiple execution engines without coupling applications to model
|
|
87
|
+
architecture.
|
|
88
|
+
- Make batching, model coverage, and compatibility behavior explicit and
|
|
89
|
+
testable.
|
|
90
|
+
|
|
91
|
+
## Supported backends
|
|
92
|
+
|
|
93
|
+
| Backend | Model format | Built-in readouts |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| llama.cpp | GGUF | token logits |
|
|
96
|
+
| Hugging Face Transformers | Transformers checkpoints | token logits, native Bosun decision tokens, pointer head, encoder-decoder margin, scalar sequence classifier, hidden-state probe |
|
|
97
|
+
|
|
98
|
+
Backends execute the neural network; readouts convert model outputs into typed
|
|
99
|
+
decision probabilities. See [models and backends](docs/MODELS.md) for supported
|
|
100
|
+
checkpoints and the exact distinction.
|
|
101
|
+
|
|
102
|
+
## Documentation
|
|
103
|
+
|
|
104
|
+
- [API reference](docs/API.md)
|
|
105
|
+
- [Supported models and backends](docs/MODELS.md)
|
|
106
|
+
- [Model recipes and registries](docs/MODEL_RECIPES.md)
|
|
107
|
+
- [Batching and performance](docs/PERFORMANCE.md)
|
|
108
|
+
|
|
109
|
+
## Contributing
|
|
110
|
+
|
|
111
|
+
Contributions for new backends, reusable readouts, model recipes, tests, and
|
|
112
|
+
documentation are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) before making
|
|
113
|
+
a change.
|
|
114
|
+
|
|
115
|
+
## Acknowledgements
|
|
116
|
+
|
|
117
|
+
`jev-compatible-server` builds on
|
|
118
|
+
[llama.cpp](https://github.com/ggml-org/llama.cpp),
|
|
119
|
+
[llama-cpp-python](https://github.com/abetlen/llama-cpp-python),
|
|
120
|
+
[Transformers](https://github.com/huggingface/transformers),
|
|
121
|
+
[FastAPI](https://github.com/fastapi/fastapi), and
|
|
122
|
+
[uv](https://github.com/astral-sh/uv). It also depends on the authors who
|
|
123
|
+
publish open decision-model checkpoints and document their readout contracts.
|