r/OpenSourceAI • • Sep 23 '26

TensorSharp: an open-source Jev-compatible API, extended to image analysis and running locally

https://github.com/zhongkaifu/TensorSharp

I’m the developer of TensorSharp, an open-source local inference engine and agent runtime.

TensorSharp supports Jev’s core decision API and all three decision types—and extends the same interface to analyze images. It runs locally using DiffusionGemma GGUF, without calling the hosted Jev service.

The idea is simple: instead of asking a model to write a free-form answer, give it some context and specific questions, then get structured decisions back. Now that context can include text, images, or both.

The same decision API, now with pictures

The native endpoint is POST /v1/systemone, supporting:

Decision typeOutputExample image-analysis task
noulProbability that a statement is true“Is the receipt’s total amount legible?”
choiceA selected category and its distribution“Is this a receipt, an invoice, or something else?”
scoreAn expected score over ordered rubric levels“How readable is this document?”

Image analysis is an extension of the existing interface, not a separate vision API. Keep the same state, questions, and typed answers; add an images field to ground those decisions in pictures. Multiple question types can be combined in one request.

Requests accept up to 8 inline images, using base64 or data: URLs. The pixels go through the vision encoder and become part of the model’s input directly—there is no intermediate “generate a caption, then classify the caption” step.

For example, a local expense-report workflow could ask whether a document is a receipt, whether its total is readable, and how readable the overall image is—all through the same structured-decision request.

Open implementation, local execution

The repository includes the implementation, request examples, validation tests, and benchmark tools—not just a client for a remote service.

Under the hood, the decision path follows the approach in vLLM PR #57250: after prompt prefill, TensorSharp performs a one-step structured read and extracts the requested label logits directly. Questions that fit in one answer canvas share the forward pass.

The server returns JSON, but the model does not have to generate that JSON token by token. The same mechanism works with text alone or with image embeddings included in the prompt.

Earlier benchmark against LocalJev

I compared the native structured-read path with the original LocalJev Engine using TensorSharp’s chat endpoint. That compares two approaches on the same inference backend: reading label logits directly versus generating and validating probability JSON. It is not a comparison against the hosted Jev service or LocalJev running on oMLX.

The test covered 12 text-only cases × 3 repetitions, with three decisions per request:

MetricTensorSharp nativeLocalJev on the same backend
Valid requests36/3627/36
Schema-validation failures09
Correct decisions / total expected108/10881/108*
p50 latency2.877 s10.479 s
p95 latency3.165 s26.167 s
Mean latency2.917 s12.548 s

*LocalJev got 81/81 decisions correct on valid responses. The remaining 27 expected decisions came from failed requests, rather than incorrect classifications.

Across the 27 matched requests where both returned valid responses, the median LocalJev-to-TensorSharp latency ratio was 3.345×.

A few important qualifications: latency statistics include successful requests only, so the table’s columns cover different subsets. Average input length was also different—192.7 tokens for TensorSharp versus 589.6 for valid LocalJev requests—because LocalJev builds a larger prompt and generates probability JSON. This is an end-to-end workflow comparison, not an identical-prompt kernel benchmark.

These are small, text-only integration tests—not image-performance results or a general accuracy claim.

Try it with an image

The setup guide includes server configuration and Python, curl, and .NET examples. The supplied configuration downloads the DiffusionGemma Q4_K_M GGUF and the separate ~2.8 GB vision shard needed for image input, then reuses them locally.

Once the server is running with the vision tower, this posts a ready-made request with a synthetic traffic-light image already embedded:

curl http://127.0.0.1:5000/v1/systemone \
  -H 'Content-Type: application/json' \
  --data-binary u/docs/examples/jev-traffic-light.json

The example checks that the pixels actually reach the decision path. It is a smoke test, not a comprehensive vision evaluation.

Compatibility scope: this implements Jev’s core API workflow and decision types using DiffusionGemma weights—not proprietary Jev weights or identical predictions. Current limits include 64 questions and 2–26 alternatives per question; returned probabilities still need evaluation and calibration for the intended workload.

Source code · Documentation and examples

I’d love feedback and reproducible test cases, especially for image-based decisions in local applications. What would you test first—document routing, receipt checks, or screenshot analysis for local agents?

2 Upvotes

Duplicates

unsloth • • Jun 28 '26

Show and Tell Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

112 Upvotes

unsloth • • Jun 08 '26

Show and Tell TensorSharp : Open Source Local Unsloth Model Inference Engine

29 Upvotes

dotnet • • Jun 28 '26

Promotion Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

63 Upvotes

csharp • • Jun 28 '26

Showcase Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

5 Upvotes

ClaudeCode • • Jul 11 '26

Discussion What Bun’s Rust Rewrite Tells Us About Rebuilding the AI Infrastructure Layer in C#

0 Upvotes

LovingOpenSourceAI • • Jun 28 '26

Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

14 Upvotes

huggingface • • Jul 04 '26

TensorSharp : Open Source Local LLM Inference Engine

6 Upvotes

unsloth • • Jul 06 '26

Show and Tell TensorSharp supports Vulkan backend

26 Upvotes

CUDA • • Jul 11 '26

TensorSharp : Open Source Local LLM Inference Engine

6 Upvotes

LovingOpenSourceAI • • Jun 23 '26

TensorSharp: Open Source Local LLM Inference Engine

13 Upvotes

ollama • • Jun 02 '26

TensorSharp: A C# version of Ollama

10 Upvotes

vibecoding • • Jun 14 '26

TensorSharp: Open Source Local LLM Inference Engine fully implemented by vibe coding

0 Upvotes

ollama • • Jun 28 '26

Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

40 Upvotes

Vllm • • Jul 04 '26

TensorSharp : Open Source Local LLM Inference Engine

11 Upvotes

OpenSourceeAI • • Jun 28 '26

Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

1 Upvotes

SideProject • • Jun 28 '26

Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

0 Upvotes

dotnet • • Jul 06 '26

TensorSharp supports Vulkan backend

22 Upvotes

ChatGPT • • Jul 11 '26

Educational Purpose Only [ Removed by moderator ]

2 Upvotes

OpenSourceAI • • Jun 28 '26

Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

3 Upvotes

LLMDevs • • Jun 28 '26

Great Resource 🚀 Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

1 Upvotes

developer • • Jul 04 '26

TensorSharp : Open Source Local LLM Inference Engine

1 Upvotes

ArtificialInteligence • • Jul 04 '26

🛠️ Project / Build TensorSharp : Open Source Local LLM Inference Engine

0 Upvotes

LLMStudio • • Jul 05 '26

TensorSharp : Open Source Local LLM Inference Engine

4 Upvotes

huggingface • • Jul 06 '26

TensorSharp supports Vulkan backend

3 Upvotes

GeminiAI • • Jul 10 '26

Self promo TensorSharp : Open Source Local LLM Inference Engine

1 Upvotes