LlmsInk 0.1.0

dotnet add package LlmsInk --version 0.1.0
                    
NuGet\Install-Package LlmsInk -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="LlmsInk" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LlmsInk" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LlmsInk" />
                    
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 LlmsInk --version 0.1.0
                    
#r "nuget: LlmsInk, 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 LlmsInk@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=LlmsInk&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LlmsInk&version=0.1.0
                    
Install as a Cake Tool

LlmsInk for .NET

NuGet

.NET client for llms.ink: turn any public link (a site, docs page, GitHub repo, PDF or video) into llms.txt or llms-full.txt, stream the build, check a site's own llms.txt, and convert HTML to Markdown. BCL only (System.Net.Http, System.Text.Json), source-generated JSON, trim- and AOT-safe. Targets .NET 8 and .NET Standard 2.0.

dotnet add package LlmsInk
using LlmsInk;

using var ink = new LlmsInkClient(); // reads LLMS_INK_KEY if set; anonymous otherwise

LlmsResult r = await ink.LlmsAsync("https://llmstxt.org");
Console.WriteLine($"{r.Title}: {r.Tokens} tokens\n{r.Text}");

LlmsResult full = await ink.FullAsync("https://llmstxt.org");          // llms-full.txt
string text = await ink.LlmsTextAsync("https://llmstxt.org");          // just the file

CheckResult chk = await ink.CheckAsync("llmstxt.org");
Console.WriteLine($"{chk.Found} {chk.Summary.Errors} errors, {chk.Summary.Warnings} warnings");

Streaming

StreamLlmsAsync yields progress while a big site or video is built, then one result. Breaking out of the loop cancels the request.

await foreach (var e in ink.StreamLlmsAsync("https://docs.example.com", new LlmsOptions { Mode = LlmsMode.Full }))
{
    switch (e)
    {
        case LlmsProgressEvent p: Console.WriteLine($"{p.Stage}: {p.Detail}"); break;
        case LlmsPartialEvent part: /* text so far, incomplete */ break;
        case LlmsResultEvent done: Console.WriteLine(done.Result.Text); break;
    }
}

A failed build arrives as a terminal error event and is thrown as LlmsInkException.

Methods

Method Endpoint Returns
LlmsAsync(url, LlmsOptions?) GET /api/v0/llms LlmsResult
FullAsync(url, LlmsOptions?) same, mode=full LlmsResult
LlmsTextAsync(url, LlmsOptions?) same, format=text string
StreamLlmsAsync(url, LlmsOptions?) same, application/x-ndjson IAsyncEnumerable<LlmsEvent>
CheckAsync(url) GET /api/v0/check CheckResult
CheckTextAsync(text, baseUrl?, links?) POST /api/v0/check CheckResult
ReportAsync(url) GET /api/v0/report ReportResult
GenerateAsync(url, DraftKind, fresh?) GET /api/v0/generate GenerateResult
MarkdownAsync(html, url?) POST /api/v0/markdown MarkdownResult (Markdown, HiddenDropped)
FrameAsync(url, time?, width?) GET /api/v0/frame byte[] (JPEG)
InspectUsageAsync() GET /api/v0/inspect/usage InspectUsage

Every method takes a CancellationToken. LlmsOptions { Mode, Fresh, Native }: LlmsMode.Llms (default, the index) or LlmsMode.Full (the content); Fresh = true skips the cache; Native = false always generates instead of returning the site's own file. CheckTextAsync lints llms.txt you haven't published: baseUrl resolves relative links, links: true also checks linked URLs. ReportResult.Extra and ReportCheck.Extra keep fields added to the report later, as JsonElement.

Configuration and IHttpClientFactory

var ink = new LlmsInkClient(new LlmsInkClientOptions
{
    ApiKey = "lk_…",                          // default: LLMS_INK_KEY
    BaseAddress = new Uri("https://llms.ink"), // default: LLMS_INK_API, else https://llms.ink
    UserAgent = "my-app/1.0",                  // default: llms-ink-dotnet/<version>
});

Pass your own HttpClient, for example a typed client from IHttpClientFactory. Its BaseAddress is used when the options have none, it isn't modified (headers are set per request), and the client doesn't dispose it:

services.AddHttpClient("llms-ink", http => http.Timeout = TimeSpan.FromMinutes(5));
services.AddSingleton(sp => new LlmsInkClient(sp.GetRequiredService<IHttpClientFactory>().CreateClient("llms-ink")));

Building a big site or a video can take minutes. The client's own HttpClient waits up to 5 minutes; HttpClient's default is 100 seconds, so raise Timeout on yours or use StreamLlmsAsync.

API key (optional)

Without a key, requests are anonymous and share per-IP limits. A key (Authorization: Bearer lk_…) gets its own daily quota. Set LLMS_INK_KEY or ApiKey; ApiKey = "" forces anonymous. An invalid or revoked key fails with 401 invalid_key; it never falls back to anonymous. Request a key.

Errors

API errors throw LlmsInkException (Status, Code, Title, Detail, RetryAfter, Errors), from the API's problem details. Common codes have their own types:

try
{
    await ink.LlmsAsync(url);
}
catch (Exception e) when (e is RateLimitedException or QuotaExceededException)
{
    await Task.Delay(((LlmsInkException)e).RetryAfter ?? TimeSpan.FromMinutes(1));
}
catch (InvalidKeyException) { /* fix the key */ }
catch (InvalidUrlException e) { Console.WriteLine(e.Detail); }
catch (LlmsInkException e) { Console.WriteLine($"{e.Code}: {e.Detail}"); }

When llms.ink can't be reached, Status and Code are null and InnerException holds the HttpRequestException. Cancellation and timeouts surface as OperationCanceledException.

Development

dotnet test
dotnet test -p:LibraryFramework=netstandard2.0   # the same suite against the netstandard2.0 build
dotnet pack src/LlmsInk -c Release -o artifacts

Release: bump <Version> in src/LlmsInk/LlmsInk.csproj, LlmsInkClient.Version and CHANGELOG.md, then push a vX.Y.Z tag. The publish workflow tests, packs and pushes to NuGet with trusted publishing.

MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 91 11/14/2026