https://github.com/tryagi/huggingface
C# SDK based on official HuggingFace OpenAPI specification
https://github.com/tryagi/huggingface
ai api csharp dotnet generated huggingface langchain langchain-dotnet nswag openapi sdk tokenizer
Last synced: 2 months ago
JSON representation
C# SDK based on official HuggingFace OpenAPI specification
- Host: GitHub
- URL: https://github.com/tryagi/huggingface
- Owner: tryAGI
- License: mit
- Created: 2023-07-16T02:35:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-08T21:23:42.000Z (2 months ago)
- Last Synced: 2025-05-13T01:16:23.197Z (2 months ago)
- Topics: ai, api, csharp, dotnet, generated, huggingface, langchain, langchain-dotnet, nswag, openapi, sdk, tokenizer
- Language: C#
- Homepage: https://tryagi.github.io/HuggingFace/
- Size: 313 KB
- Stars: 40
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HuggingFace
[](https://www.nuget.org/packages/HuggingFace/)
[](https://github.com/tryAGI/HuggingFace/actions/workflows/dotnet.yml)
[](https://github.com/tryAGI/HuggingFace/blob/main/LICENSE.txt)
[](https://discord.gg/Ca2xhfBf3v)## Features 🔥
- ~~Fully generated C# SDK based on [official HuggingFace OpenAPI specification](https://huggingface.github.io/text-generation-inference/openapi.json) using [OpenApiGenerator](https://github.com/HavenDV/OpenApiGenerator)~~
- ~~Same day update to support new features~~
- ~~Updated and supported automatically if there are no breaking changes~~
- All modern .NET features - nullability, trimming, NativeAOT, etc.
- Support .Net Framework/.Net Standard 2.0
- Now supports only Serverless Inference API### Usage
```csharp
using HuggingFace;using var client = new HuggingFaceClient(apiKey, client);
var response = await client.GenerateTextAsync(
"gpt2",
new GenerateTextRequest
{
Inputs = "Hello",
Parameters = new GenerateTextRequestParameters
{
MaxNewTokens = 250,
},
});
```## Support
Priority place for bugs: https://github.com/tryAGI/HuggingFace/issues
Priority place for ideas and general questions: https://github.com/tryAGI/HuggingFace/discussions
Discord: https://discord.gg/Ca2xhfBf3v## OpenAPI specs
- Serverless Inference OpenAPI spec - (Can't find the link)
- [Local Text Generation Inference OpenAPI spec](https://huggingface.github.io/text-generation-inference/openapi.json)
- [Local Text Embeddings Inference OpenAPI spec](https://huggingface.github.io/text-embeddings-inference/openapi.json)
- [Inference Endpoints (dedicated) OpenAPI spec](https://api.endpoints.huggingface.cloud/openapi.json)## Acknowledgments

This project is supported by JetBrains through the [Open Source Support Program](https://jb.gg/OpenSourceSupport).

This project is supported by CodeRabbit through the [Open Source Support Program](https://github.com/marketplace/coderabbitai).