Update README.md
Browse files
README.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
| 1 |
---
|
| 2 |
-
title: Uni
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
-
license:
|
| 9 |
-
short_description: uni-api
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Uni API
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: yellow
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 8000
|
| 8 |
pinned: false
|
| 9 |
+
license: gpl-3.0
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Uni API Deployment on HuggingFace Spaces
|
| 13 |
+
|
| 14 |
+
This space deploys the uni-api service, which provides unified management of multiple LLM API backends.
|
| 15 |
+
|
| 16 |
+
## Features
|
| 17 |
+
|
| 18 |
+
- Unified API interface for multiple LLM providers
|
| 19 |
+
- Load balancing across different API endpoints
|
| 20 |
+
- Support for OpenAI, Anthropic, Gemini, and other providers
|
| 21 |
+
- Automatic retry and failover mechanisms
|
| 22 |
+
|
| 23 |
+
## Usage
|
| 24 |
+
|
| 25 |
+
Once deployed, you can use this API endpoint like any OpenAI-compatible API:
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
curl -X POST https://your-space-name.hf.space/v1/chat/completions \
|
| 29 |
+
-H "Content-Type: application/json" \
|
| 30 |
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
| 31 |
+
-d '{
|
| 32 |
+
"model": "gpt-4o",
|
| 33 |
+
"messages": [{"role": "user", "content": "Hello!"}]
|
| 34 |
+
}'
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## Configuration
|
| 38 |
+
|
| 39 |
+
The API configuration is managed through the `API_YAML_CONTENT` secret in the Space settings.
|
| 40 |
+
|
| 41 |
+
For more information, visit: https://github.com/yym68686/uni-api
|