Transforming Gemma outputs into structured decision functions.
Project details
Gemma-to-Jev provides a streamlined approach to generating structured decision outputs from the Gemma model. Built in native Rust with Candle support for Apple Metal, this tool optimizes decision-making with swift performance and a clear path to actionable insights. Ideal for integrating language-conditioned decisions without open-ended generation.
Gemma-to-Jev is a Rust-based implementation that transforms Gemma (Gemma 3 4B) into a decision-making function modeled after Jev's System One. This project is designed to execute prompt-conditioned decisions with efficiency and precision, utilizing native Rust and leveraging the Candle framework on Apple Metal.
Instead of traditional token generation sequences, this implementation follows a streamlined process:
prompt -> legal-label logits -> softmax -> typed answer
The architecture efficiently directs inputs through a transformer, yielding output that directly informs decisions.
For seamless integration, the repository facilitates different modes of operation:
cargo run --release # Default conference demo
cargo run --release -- demo # Demo with adjustable temperature
cargo run --release -- bench # Performance benchmarking
cargo run --release -- serve # Access local API compatible with TypeSafe
Utilizing a structured approach for question processing, every query is handled with clearly defined types and responses, ensuring precision in the decision context:
| Primitive | Question Type | Returns |
|---|---|---|
noul | True/False | Probability of yes |
choice | Multiple Options | Winning label with probabilities and confidence |
score | Scale Inquiry | Fractional level with probabilities and confidence |
As an example, a standard decision request can be constructed and sent via a POST request to the local server:
curl http://127.0.0.1:8080/v1/systemone \
-H 'content-type: application/json' \
-d '{
"state": "The build failed with: ld: library not found for -lssl",
"questions": {
"route": {
"type": "choice",
"instructions": "Choose the next owner.",
"criteria": {
"build": "Build or linker failure",
"security": "Security incident",
"remote_llm": "Needs deeper investigation"
}
}
}
}'
The implementation showcases impressive benchmark results:
While inspired by Jev's architecture, this implementation differs significantly in terms of output generation and processing efficiency. Notably, it does not utilize Jev's trained model but instead incorporates a rapid softmax-based decision mechanism tailored for responsive querying.
Future enhancements include calibrating probability outputs, fine-tuning with decision-specific datasets, and optimizing the execution performance further to meet increasing demands.
Explore the full scope of functionalities and outcomes on the project's official page.
Comments
0Start the conversation
Share the first comment.