2026-09-13 12:17:25 +00:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
2026-09-04 13:48:07 +00:00
|
|
|
namespace AIStudio.Provider.HuggingFace;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// One inference provider serving a model.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Provider">The slug of the inference provider, e.g. "novita".</param>
|
|
|
|
|
/// <param name="Status">Whether the provider currently serves the model. Known value: "live".</param>
|
2026-09-13 12:17:25 +00:00
|
|
|
/// <param name="ContextWindowTokens">How much this provider reads and writes in one conversation, in tokens.</param>
|
|
|
|
|
public readonly record struct HFModelProvider(string Provider, string Status, [property: JsonPropertyName("context_length")] int? ContextWindowTokens)
|
|
|
|
|
{
|
|
|
|
|
private const string LIVE = "live";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether this provider serves the model right now.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsLive => string.Equals(this.Status, LIVE, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
}
|