Jevelin 0.1.0

dotnet add package Jevelin --version 0.1.0
                    
NuGet\Install-Package Jevelin -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jevelin" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jevelin" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Jevelin" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Jevelin --version 0.1.0
                    
#r "nuget: Jevelin, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Jevelin@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Jevelin&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Jevelin&version=0.1.0
                    
Install as a Cake Tool

Jevelin

A simple C# client for TypeSafe AI's Jev decision model.

Jev doesn't write prose. You give it some content (the state) and a set of named questions, and it returns numbers: the probability of yes, which option it picked and how sure it is, or a score on a scale you define. TypeSafe publishes official SDKs for Python and JavaScript only; Jevelin covers .NET.

Jevelin is an unofficial, community client and is not affiliated with TypeSafe AI.

Requirements

  • .NET 10 SDK
  • A TypeSafe API key

Getting started

Install the Jevelin package from NuGet:

dotnet add package Jevelin

Then ask some questions:

using Jevelin;

// Reads the key from the TYPESAFE_API_KEY environment variable,
// or pass it in: new JevClient("your-key")
using var jev = new JevClient();

var response = await jev.AskAsync(new JevRequest
{
    State = "I was charged twice for my subscription this month.",
    Questions =
    {
        ["tone"] = JevQuestion.Choice("What is the tone of this message?", "angry", "calm", "excited"),
        ["urgency"] = JevQuestion.Score("How urgent is this message?",
            "Can wait", "Needs attention this week", "Needs attention today"),
        ["billing"] = JevQuestion.Noul("Is this about billing?"),
    },
});

Console.WriteLine(response["tone"].Choice);      // e.g. "calm"
Console.WriteLine(response["urgency"].Score);    // e.g. 1.4 (0 = "Can wait", 2 = "Needs attention today")
Console.WriteLine(response["billing"].Noul);     // e.g. 0.97

For a single yes/no question there's a shortcut:

double p = await jev.AskYesNoAsync("Order #1234 arrived damaged.", "Does the customer want a refund?");

Question types

Factory Asks Answer fields
JevQuestion.Noul(instructions, whenTrue?, whenFalse?) Yes/no (true/false) Noul: probability of yes, 0–1
JevQuestion.Choice(instructions, params string[] options) Pick one of 1–255 options Choice, Confidence, Probabilities per option
JevQuestion.Choice(instructions, IReadOnlyDictionary<string, string?>) Same, with a description per option Same as above
JevQuestion.Score(instructions, params string[] levels) Rate on 1–10 ordered levels (first level is 0) Score (probability-weighted), Confidence, Legend, Probabilities per level

State can be a string or any object that serializes to JSON, such as a record or a list of messages.

Configuration

var jev = new JevClient(
    apiKey: "your-key",
    options: new JevClientOptions
    {
        DefaultModel = "jev-latest",   // used when JevRequest.Model is null
        Timeout = TimeSpan.FromSeconds(30),
        BaseAddress = new Uri("https://api.typesafe.ai/"),
    });

You can also pass your own HttpClient, for example one from IHttpClientFactory. Jevelin won't dispose a client you pass in.

To pin a specific model version for reproducible results, set Model on the request:

new JevRequest { Model = "jev-1.13.0", State = ..., Questions = { ... } }

Errors

If the API returns a non-success status, AskAsync throws JevApiException. It has the StatusCode, the raw ResponseBody, and a message that includes the API's detail text:

try
{
    await jev.AskAsync(request);
}
catch (JevApiException ex) when (ex.StatusCode == HttpStatusCode.Unauthorized)
{
    Console.WriteLine("Check your API key.");
}

Running the demo

The demo in samples/Jevelin.Demo reads the key from .NET user secrets, so it works with Visual Studio's debugger and the key never lands in the repo:

dotnet user-secrets set TYPESAFE_API_KEY "your-key" --project samples/Jevelin.Demo
dotnet run --project samples/Jevelin.Demo

In Visual Studio you can instead right-click Jevelin.Demo → Manage User Secrets. If no secret is set, the demo falls back to the TYPESAFE_API_KEY environment variable.

Running the tests

dotnet test

The tests use a fake HTTP handler, so they don't need an API key or network access.

Not supported yet

  • Image inputs and box questions
  • Long-context mode
  • Listing models (GET /v1/models)

License

MIT

Project layout

src/Jevelin/              The client library
samples/Jevelin.Demo/     Console demo
tests/Jevelin.Tests/      xUnit tests
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 129 10/28/2026