This is a viewer only at the moment see the article on how this works.
To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk
This is a preview from the server running through my markdig pipeline
Using Nimble from C# (Part 2): local alternatives to Jev and a layered mail classifier
Thursday, 01 October 2026
In the first StyloMail article, I used Jev to ask specific questions about email and get typed, probabilistic answers back. Nimble, from Bespoke Labs, brings that technique to a model I can host myself through Ollama. From C#, I can send the same kind of state and questions, then use the answers as evidence in the mail system.
That opens up more than a different endpoint. I can keep semantic interpretation within my own deployment, replay messages while changing the questions, and give a local model the first reading in a cascade. The interesting part is how those choices change the design of the product I'm working towards.
This article follows the Nimble call through real C# code, four live email examples, and the layers that turn those answers into a useful assessment. Jev and Nimble provide different ways to supply the interpretation; the application still owns the questions, context and decisions.
What changes when I use Nimble instead of Jev?
Jev is TypeSafe's model for structured decisions. The application supplies state and typed questions rather than requesting a generated explanation. Noul answers a yes/no question with a probability; Choice selects among named alternatives; Score evaluates against an ordered rubric.
Nimble is a separate 9B decision model from Bespoke Labs, fine-tuned from Qwen3.5-9B. Ollama exposes it through /v1/systemone, following the Jev-style API. That gives the C# integration a familiar shape: model, state and named questions going in, typed answers coming back. The models are different even though the decision interface is compatible.
| Concern | Jev in StyloMail | Nimble in StyloMail |
|---|---|---|
| Where inference runs | TypeSafe's hosted service | An Ollama server I choose and operate |
| What the client sends | State and typed questions, with a bearer credential | State and typed questions to the self-hosted endpoint |
| Where mail context goes | To the hosted provider | To the chosen machine or private server |
| Capacity and cost | Provider capacity and service usage | My hardware, inference time and server operation |
| What the application consumes | Named semantic evidence | The same semantic-evidence boundary |
There is also a difference in how to think about a batch of questions. TypeSafe describes Jev's questions as evaluated independently in parallel. Nimble's documentation describes reading the prompt once per question and scoring the answer tokens. One HTTP request therefore gives me a convenient batch; its cost depends on the model doing the work. The number and scope of questions matter when choosing which layer should ask them.
The compatible interface lets me keep the question's meaning stable while changing the provider. It does not make their probabilities interchangeable. A payment-change question still means the same thing, but each model supplies its own judgement of the text.
Calling Nimble from C#: the question structure
The Nimble request has three parts: the model to use, the state to interpret, and the questions to ask about that state. The unfamiliar part for a .NET developer is the decision contract: what a question means, how its possible answers are defined, and what the returned probability actually represents. These examples break down the request behind the live email results below.
State: the material being judged
For the email examples, the state contains the subject and body:
var state = JsonSerializer.Serialize(new
{
subject = mail.Subject,
body = mail.Body
});
All three questions receive this same state. The example serialises the email view as a JSON string; the endpoint also accepts structured state. The significant boundary is between the email as evidence and the instructions defining the model's task.
State is the material to interpret. The question defines how to interpret it. In a conversation assessment, the state can also carry relevant prior turns or relationship observations; the question still needs to say precisely what it is asking of that material.
A question: one condition with defined answers
A Noul question has a type, an instructions string, and criteria for its two possible answers. A small C# helper makes that repeated structure clear:
static object Noul(string instructions, string whenTrue, string whenFalse) => new
{
type = "noul",
instructions,
criteria = new { @true = whenTrue, @false = whenFalse }
};
| Field | Meaning |
|---|---|
type |
noul asks for the probability that a statement is true. |
instructions |
The complete question the model should answer about the state. |
criteria.true |
What counts as the condition being present. |
criteria.false |
What counts as the condition being absent. |
For the payment dimension, that becomes:
var paymentQuestion = Noul(
"Does the message ask to change where a payment is sent?",
"Requests a new bank account or other payment destination.",
"Does not request a change to the payment destination.");
The instruction asks about a payment destination. The criteria keep both sides of that question tied to the same condition. They do not redefine “true” as “fraudulent” or “false” as “safe”: that would mix an observation about the message with the eventual decision about it.
This is why question design matters. “Does it request a new payment destination?” has a clear job. “Is it suspicious, urgent or fraudulent?” combines several jobs whose answers may differ. A supplier can legitimately change banks; urgency is another observation, and the sender's authority needs other evidence.
Named questions: separate observations over the same state
The request gives each question a name. Here are the three used for the live examples:
var questions = new
{
credential_request = Noul(
"Does the message ask for credentials or authentication factors?",
"Requests passwords, one-time codes, PINs or access tokens.",
"Does not request credentials or authentication factors."),
payment_redirection = paymentQuestion,
urgency_pressure = Noul(
"Does the message pressure the recipient to act immediately?",
"Imposes urgent deadlines or threatens consequences for delay.",
"Does not pressure the recipient to act immediately.")
};
The names associate the answers with fields the application understands. The model's task is defined by the instruction and criteria; the name lets C# recognise which result belongs to which dimension.
Each question is evaluated separately. A message can request credentials and apply urgency at the same time, so their probabilities do not need to add up to one. Nor does an urgency answer automatically become context for the payment question: the application combines the returned observations. Separate evaluation also does not make the evidence statistically independent; several questions can pick up related features of the same message.
The resulting Nimble request is small:
var request = new
{
model = "nimble",
state,
questions
};
This is the body supplied to Ollama's /v1/systemone endpoint. The model name selects Nimble; state supplies the evidence; questions define the interpretations I want back. That separation is shared with the Jev-style interface.
Answers: a probability attached to a named condition
The response contains answers under the same question names. Showing just the payment answer from the supplier-change example below, rounded to three decimal places:
{
"answers": {
"payment_redirection": { "type": "noul", "noul": 0.988 }
}
}
With a typed response, the payment result is accessed as:
double? paymentProbability =
result?.Answers?.GetValueOrDefault("payment_redirection")?.Noul;
That number estimates whether the payment-change condition is present. It is not the severity of the request, a separate confidence score, or a probability that the sender is fraudulent. Noul returns no separate confidence field. For an ordered judgement such as degrees of urgency, the question type is Score and the criteria become levels on a rubric. A high Noul answer for urgency means urgency is present, not that its severity has been scored.
An absent answer is different from an answer of zero. The nullable result preserves that distinction for the surrounding application.
The surrounding adapter validates the answer's type and range before creating semantic evidence. Policy then combines that evidence with the other observations. This is the Constrained Fuzziness pattern: define the probabilistic component's job, retain its uncertainty, and give application code control over the action that follows.
Four emails through the live model
I supplied these four synthetic messages using the three-question request above, asking all three questions in one request per email. The client was compiled and all four messages were tested against the live endpoint. The responses below came from Nimble through Ollama 0.35.0 on 2 October 2026. Percentages are rounded to one decimal place.
Routine notification
Subject: Your order NW-4482 has shipped
Hello Alice, your order NW-4482 has shipped and should arrive within two working days. Your receipt is already available in your account. No action is required. Thank you for your custom.
Legitimate supplier change
Subject: Supplier bank details update for next month
Hello Alice, our company is changing its bank account next month. Please use the replacement account for future invoice payments after you have verified the change by calling your usual accounts contact on the number already in your records. There is no need to make a payment today.
Credential phishing
Subject: Urgent: your mailbox will be suspended in 30 minutes
Your mailbox will be disabled in 30 minutes unless you verify your account now. Reply with your password and the six-digit sign-in code immediately to prevent suspension.
Urgent payment redirection
Subject: Confidential: change today's supplier payment
Alice, this is the CEO. Send today's supplier payment to our replacement bank account instead of the one on file. Transfer it within the next 20 minutes. Do not call the supplier or discuss this with accounts; I need this kept confidential until it is complete.
| Credential request | Payment redirection | Urgency pressure | |
|---|---|---|---|
| Routine notification | 0.4% | 0.4% | 1.3% |
| Legitimate supplier change | 3.4% | 98.8% | 1.2% |
| Credential phishing | 100.0% | 0.9% | 99.9% |
| Urgent payment redirection | 3.4% | 99.9% | 99.3% |
The supplier change and the suspicious payment request both score highly for payment redirection. 98.8% here means the model sees a payment-change request. It does not mean a 98.8% probability of fraud. Keeping the questions separate preserves that distinction.
Urgency helps separate these examples. The supplier update has little time pressure and invites verification through an established contact. The suspicious request combines a new destination with a short deadline and instructions to avoid normal checks. The phishing message combines a request for a password and sign-in code with a threat of suspension.
The routine notification mentions an order and an account, but asks for none of those actions. Nimble's readings are low on all three dimensions. The technique captures what the message is asking the recipient to do, rather than treating business language as a classification in itself.
These are useful inputs to the next layer. Sender history, authentication and the conversation can establish whether the change fits an existing relationship. Policy can then determine what that combination of evidence justifies.
Giving those answers a place in StyloMail
The model supplies observations; the application combines them with other evidence. In StyloMail, the Nimble adapter returns a SemanticAssessment, the same kind of result as the Jev adapter:
ISemanticMailClassifier classifier =
new NimbleSemanticMailClassifier(http, options);
SemanticAssessment assessment =
await classifier.ClassifyAsync(input, cancellationToken);
Here input is the extracted message view and its applicable questions. The adapter owns the model-specific request and validates the response. A shared assessment lets the rest of the pipeline work with a question's meaning, its answer and its source. It also lets a cascade compose two providers behind the same boundary.
flowchart LR
Mail[Message and envelope] --> Facts[Extraction and authentication]
Mail --> Meaning[Nimble semantic questions]
History[Sender history and conversation] --> Policy[Evidence requirements and policy]
Facts --> Policy
Meaning --> Policy
Policy --> Outcome[Allow, hold or reject]
An answer also needs provenance and coverage. An absent result is different from a low probability, and an answer over a shortened message needs to preserve that fact. This lets a reviewer understand which observation came from the model and what information supported it.
What having a self-hosted decision model enables
For these experiments, Nimble runs on a second machine on the private LAN. I choose where the mail context goes and which model server interprets it. I can replay a corpus, adjust one question's criteria, and inspect the answers without making every experiment a hosted service call. The cost shifts to hardware, model execution and operating the server.
That control also makes model behaviour easier to explore as a separate part of the system. I can compare question banks, use a bounded conversation view, or change the serving machine while retaining the surrounding C# evidence pipeline.
The last of those produced a useful lesson. I sent the same six-message corpus through the real Nimble adapter on two servers holding the same model digest. Both answered all 67 requested semantic dimensions. Median request times after warmup were about 4.6 seconds on this machine and 2.0 seconds on the second machine for that corpus.
The same weights and byte-identical requests produced different probabilities across the two hosts. Across the 78 raw probabilities in that comparison, the largest difference was about 2.27 percentage points. Each host repeated its own duplicated case identically.
The serving environment therefore belongs in the answer's provenance, alongside the model and questions. StyloMail's Nimble cache includes the endpoint identity so moving the server does not reuse evidence from the previous one. This is a consequence of using a model I host: the deployment is part of the experiment, not just the location of a socket.
Nimble as the first reading in a cascade
A local decision model gives the layered design another useful choice: let Nimble provide the first reading, and spend a second interpretation on selected questions.
The cascade makes that selection in deterministic code. Missing or partial answers request another opinion. Indecision and disagreement with an available prior reading also escalate where the dimension carries policy weight. The application decides which evidence warrants another call; the model does not authorise its own escalation or a mail action.
flowchart TD
Input["Bounded message and applicable questions"] --> Local["Ask Nimble first"]
Local --> Rule["Apply the per-question rule<br/>including policy relevance"]
Rule --> Need{"Any answer needs<br/>another opinion?"}
Need -->|No| Keep["Keep the Nimble assessment<br/>No second model call"]
Need -->|Yes| Select["Select only the questions<br/>that need another opinion"]
Select --> Second["Ask the second provider"]
Second --> Combine["Combine usable second answers<br/>with the remaining Nimble answers"]
Keep --> Evidence["Semantic evidence with source and availability"]
Combine --> Trace["Record why each question escalated<br/>and whether the second opinion arrived"]
Trace --> Evidence
Evidence --> Policy["Combine with behavioural evidence<br/>and apply explicit policy"]
Policy --> Decision["Allow, hold or reject"]
A message can keep Nimble's payment answer while sending an indecisive credential answer for another opinion. Each returned row records its answering model and any escalation reason. If the second provider cannot answer, that outcome remains visible alongside the local evidence.
In a live exercise using two local models, one message kept all eleven applicable local answers and another sent all eleven questions to the second provider. That illustrates both routes while keeping the answering model and the reason for escalation legible.
Part 1.5's conversation analysis adds a related distinction: specialist routing chooses what to ask, while the model cascade chooses who should answer. A payment question bank concentrates on changed destinations, authority claims and secrecy; a credential bank concentrates on passwords, codes and account access. The same Nimble instance can serve several question banks.
Smaller Tev1 models give this architecture further choices for narrowly scoped tasks. Model size, question count, available context and the value of another opinion all affect how interpretation is distributed across the layers.
Input selection matters too. Extracting the relevant turn, relationship observations and prior events follows the Reduced RAG approach: give the model the material the question needs. A successful HTTP response does not describe how much of the original email was supplied, so that coverage remains part of the evidence.
From model calls to a mail product
Nimble gives me a self-hosted way to apply the same typed-decision technique I explored with Jev. The C# contract is small enough to experiment with directly, and the adapter lets those experiments contribute to the wider evidence pipeline.
The live bank-change examples show why that matters. Recognising a changed payment destination is useful in both legitimate and abusive mail. Separating that observation from urgency, credentials and relationship context gives policy—and a human reviewer—more to work with than a single spam label.
As I work towards a product, the value of local inference is the control it gives that design: where interpretation happens, which questions are asked, when another provider is involved, and how the resulting evidence is explained. Jev and Nimble fit into that system as providers of judgement. The application gives those judgements meaning and decides what to do with them.
StyloMail series
- Part 1: Behavioural inference with Jev, the mail system, semantic evidence and explicit policy.
- Part 1.5: Conversation analysis with specialists (research), profiles, conversation evidence and specialist question banks.
- Part 2: Using Nimble from C#, the C# call, live examples, differences from Jev and local-first interpretation.
- Part 3: Giving StyloMail a face, the Avalonia operator console and management API.