fahmiaziz98 commited on
Commit
e6b4aad
Β·
1 Parent(s): 80db4a8

init README

Browse files
Files changed (3) hide show
  1. .github/workflows/check.yml +0 -16
  2. API.md +0 -729
  3. README.md +143 -100
.github/workflows/check.yml DELETED
@@ -1,16 +0,0 @@
1
- name: Check file size
2
- on:
3
- pull_request:
4
- branches: [main]
5
-
6
- # to run this workflow manually from the Actions tab
7
- workflow_dispatch:
8
-
9
- jobs:
10
- sync-to-hub:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - name: Check large files
14
- uses: ActionsDesk/lfs-warning@v2.0
15
- with:
16
- filesizelimit: 10485760 # this is 10MB
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
API.md DELETED
@@ -1,729 +0,0 @@
1
- # πŸ“– Unified Embedding API Documentation
2
-
3
- Complete API reference for the Unified Embedding API v3.0.0.
4
-
5
- **Features:** Dense Embeddings, Sparse Embeddings, and Document Reranking
6
-
7
- ---
8
-
9
- ## 🌐 Base URL
10
-
11
- ```
12
- https://fahmiaziz-api-embedding.hf.space
13
- ```
14
-
15
- For local development:
16
- ```
17
- http://localhost:7860
18
- ```
19
-
20
- ---
21
-
22
- ## πŸ”‘ Authentication
23
-
24
- **Currently no authentication required.**
25
-
26
- ---
27
-
28
- ## πŸ“Š Endpoints Overview
29
-
30
- | Endpoint | Method | Description |
31
- |----------|--------|-------------|
32
- | `/api/v1/embeddings/embed` | POST | Generate document embeddings |
33
- | `/api/v1/embeddings/query` | POST | Generate query embeddings |
34
- | `/api/v1/rerank` | POST | Rerank documents by relevance |
35
- | `/api/v1/models` | GET | List available models |
36
- | `/api/v1/models/{model_id}` | GET | Get model information |
37
- | `/health` | GET | Health check |
38
- | `/` | GET | API information |
39
-
40
- ---
41
-
42
- ## πŸš€ Embedding Endpoints
43
-
44
- ### 1. Generate Document Embeddings
45
-
46
- **`POST /api/v1/embeddings/embed`**
47
-
48
- Generate embeddings for document texts. Supports both single and batch processing.
49
-
50
- #### Request Body
51
-
52
- ```json
53
- {
54
- "texts": ["string"], // Required: List of texts (1-100 items)
55
- "model_id": "string", // Required: Model identifier
56
- "prompt": "string", // Optional: Instruction prompt
57
- "options": { // Optional: Embedding parameters
58
- "normalize_embeddings": true,
59
- "batch_size": 32,
60
- "max_length": 512,
61
- "show_progress_bar": false
62
- }
63
- }
64
- ```
65
-
66
- #### Parameters
67
-
68
- | Field | Type | Required | Description |
69
- |-------|------|----------|-------------|
70
- | `texts` | array[string] | βœ… Yes | List of texts to embed (min: 1, max: 100) |
71
- | `model_id` | string | βœ… Yes | Model identifier (e.g., "qwen3-0.6b") |
72
- | `prompt` | string | ❌ No | Instruction prompt for the model |
73
- | `options` | object | ❌ No | Additional embedding parameters |
74
-
75
- #### Options Parameters
76
-
77
- | Field | Type | Default | Description |
78
- |-------|------|---------|-------------|
79
- | `normalize_embeddings` | boolean | false | L2 normalize output embeddings |
80
- | `batch_size` | integer | 32 | Processing batch size (1-256) |
81
- | `max_length` | integer | 512 | Maximum sequence length (1-8192) |
82
- | `show_progress_bar` | boolean | false | Display progress during encoding |
83
- | `precision` | string | float32 | Precision ("float32", "int8", "binary") |
84
-
85
- #### Response - Single Text (Dense)
86
-
87
- ```json
88
- {
89
- "embedding": [0.123, -0.456, 0.789, ...],
90
- "dimension": 768,
91
- "model_id": "qwen3-0.6b",
92
- "processing_time": 0.0523
93
- }
94
- ```
95
-
96
- #### Response - Batch (Dense)
97
-
98
- ```json
99
- {
100
- "embeddings": [
101
- [0.123, -0.456, ...],
102
- [0.234, 0.567, ...],
103
- [0.345, -0.678, ...]
104
- ],
105
- "dimension": 768,
106
- "count": 3,
107
- "model_id": "qwen3-0.6b",
108
- "processing_time": 0.1245
109
- }
110
- ```
111
-
112
- #### Response - Single Text (Sparse)
113
-
114
- ```json
115
- {
116
- "sparse_embedding": {
117
- "text": "Hello world",
118
- "indices": [10, 25, 42, 100],
119
- "values": [0.85, 0.62, 0.91, 0.73]
120
- },
121
- "model_id": "splade-pp-v2",
122
- "processing_time": 0.0421
123
- }
124
- ```
125
-
126
- #### Response - Batch (Sparse)
127
-
128
- ```json
129
- {
130
- "embeddings": [
131
- {
132
- "text": "First doc",
133
- "indices": [10, 25, 42],
134
- "values": [0.85, 0.62, 0.91]
135
- },
136
- {
137
- "text": "Second doc",
138
- "indices": [15, 30, 50],
139
- "values": [0.73, 0.88, 0.65]
140
- }
141
- ],
142
- "count": 2,
143
- "model_id": "splade-pp-v2",
144
- "processing_time": 0.0892
145
- }
146
- ```
147
-
148
- #### Examples
149
-
150
- **Single Text (Dense Model):**
151
- ```bash
152
- curl -X 'POST' \
153
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings/embed' \
154
- -H 'accept: application/json' \
155
- -H 'Content-Type: application/json' \
156
- -d '{
157
- "texts": ["What is artificial intelligence?"],
158
- "model_id": "qwen3-0.6b"
159
- }'
160
- ```
161
-
162
- **Single Text (Sparse Model):**
163
- ```bash
164
- curl -X 'POST' \
165
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings/embed' \
166
- -H 'accept: application/json' \
167
- -H 'Content-Type: application/json' \
168
- -d '{
169
- "texts": ["Hello world"],
170
- "model_id": "splade-pp-v2"
171
- }'
172
- ```
173
-
174
- **Batch (with Options):**
175
- ```bash
176
- curl -X 'POST' \
177
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings/embed' \
178
- -H 'accept: application/json' \
179
- -H 'Content-Type: application/json' \
180
- -d '{
181
- "texts": [
182
- "First document to embed",
183
- "Second document to embed",
184
- "Third document to embed"
185
- ],
186
- "model_id": "qwen3-0.6b",
187
- "options": {
188
- "normalize_embeddings": true,
189
- "batch_size": 32
190
- }
191
- }'
192
- ```
193
-
194
- **Python Example:**
195
- ```python
196
- import requests
197
-
198
- url = "https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings/embed"
199
-
200
- payload = {
201
- "texts": ["Hello world"],
202
- "model_id": "qwen3-0.6b"
203
- }
204
-
205
- response = requests.post(url, json=payload)
206
- data = response.json()
207
-
208
- print(f"Embedding dimension: {data['dimension']}")
209
- print(f"Processing time: {data['processing_time']:.3f}s")
210
- ```
211
-
212
- ---
213
-
214
- ### 2. Generate Query Embeddings
215
-
216
- **`POST /api/v1/embeddings/query`**
217
-
218
- Generate embeddings optimized for search queries. Some models differentiate between query and document embeddings.
219
-
220
- #### Request Body
221
-
222
- Same as `/embed` endpoint.
223
-
224
- ```json
225
- {
226
- "texts": ["string"],
227
- "model_id": "string",
228
- "prompt": "string",
229
- "options": {}
230
- }
231
- ```
232
-
233
- #### Response
234
-
235
- Same format as `/embed` endpoint.
236
-
237
- #### Examples
238
-
239
- **Single Query:**
240
- ```bash
241
- curl -X 'POST' \
242
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings/query' \
243
- -H 'accept: application/json' \
244
- -H 'Content-Type: application/json' \
245
- -d '{
246
- "texts": ["What is machine learning?"],
247
- "model_id": "qwen3-0.6b",
248
- "prompt": "Represent this query for retrieval",
249
- "options": {
250
- "normalize_embeddings": true
251
- }
252
- }'
253
- ```
254
-
255
- **Batch Queries:**
256
- ```bash
257
- curl -X 'POST' \
258
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings/query' \
259
- -H 'accept: application/json' \
260
- -H 'Content-Type: application/json' \
261
- -d '{
262
- "texts": [
263
- "First query",
264
- "Second query",
265
- "Third query"
266
- ],
267
- "model_id": "qwen3-0.6b"
268
- }'
269
- ```
270
-
271
- **Python Example:**
272
- ```python
273
- import requests
274
-
275
- url = "https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings/query"
276
-
277
- payload = {
278
- "texts": ["What is AI?"],
279
- "model_id": "qwen3-0.6b",
280
- "options": {
281
- "normalize_embeddings": True
282
- }
283
- }
284
-
285
- response = requests.post(url, json=payload)
286
- embedding = response.json()["embedding"]
287
- ```
288
-
289
- ---
290
-
291
- ### 3. Rerank Documents
292
-
293
- **`POST /api/v1/rerank`**
294
-
295
- Rerank documents based on their relevance to a query using CrossEncoder models.
296
-
297
- #### Request Body
298
-
299
- ```json
300
- {
301
- "query": "string", // Required: Search query
302
- "documents": ["string"], // Required: List of documents (min: 1)
303
- "model_id": "string", // Required: Reranking model identifier
304
- "top_k": integer, // Required: Number of top results to return
305
- }
306
- ```
307
-
308
- #### Parameters
309
-
310
- | Field | Type | Required | Description |
311
- |-------|------|----------|-------------|
312
- | `query` | string | βœ… Yes | Search query text |
313
- | `documents` | array[string] | βœ… Yes | List of documents to rerank (min: 1) |
314
- | `model_id` | string | βœ… Yes | Reranking model identifier |
315
- | `top_k` | integer | βœ… Yes | Maximum number of results to return |
316
-
317
- #### Response
318
-
319
- ```json
320
- {
321
- "model_id": "jina-reranker-v3",
322
- "processing_time": 0.56,
323
- "query": "Python for data science",
324
- "results": [
325
- {
326
- "index": 0,
327
- "score": 0.95,
328
- "text": "Python is excellent for data science"
329
- },
330
- {
331
- "index": 2,
332
- "score": 0.73,
333
- "text": "R is also used in data science"
334
- }
335
- ]
336
- }
337
- ```
338
-
339
- #### Response Fields
340
-
341
- | Field | Type | Description |
342
- |-------|------|-------------|
343
- | `model_id` | string | Model identifier used |
344
- | `processing_time` | float | Processing time in seconds |
345
- | `query` | string | Original search query |
346
- | `results` | array | Reranked documents with scores |
347
- | `results[].index` | integer | Original index in input documents |
348
- | `results[].score` | float | Relevance score (0-1, normalized) |
349
- | `results[].text` | string | Document text |
350
-
351
- #### Examples
352
-
353
- **Basic Reranking:**
354
- ```bash
355
- curl -X 'POST' \
356
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/rerank' \
357
- -H 'Content-Type: application/json' \
358
- -d '{
359
- "query": "Python for data science",
360
- "documents": [
361
- "Python is great for data science",
362
- "Java is used for enterprise applications",
363
- "R is also used in data science",
364
- "JavaScript is for web development"
365
- ],
366
- "model_id": "jina-reranker-v3",
367
- "top_k": 2
368
- }'
369
- ```
370
-
371
-
372
- **Python Example:**
373
- ```python
374
- import requests
375
-
376
- url = "https://fahmiaziz-api-embedding.hf.space/api/v1/rerank"
377
-
378
- payload = {
379
- "query": "best programming language for beginners",
380
- "documents": [
381
- "Python is beginner-friendly with simple syntax",
382
- "C++ is powerful but complex for beginners",
383
- "JavaScript is essential for web development",
384
- "Rust offers memory safety but steep learning curve"
385
- ],
386
- "model_id": "jina-reranker-v3",
387
- "top_k": 2
388
- }
389
-
390
- response = requests.post(url, json=payload)
391
- data = response.json()
392
-
393
- print(f"Top result: {data['results'][0]['text']}")
394
- print(f"Score: {data['results'][0]['score']:.3f}")
395
- ```
396
-
397
- **JavaScript Example:**
398
- ```javascript
399
- const url = "https://fahmiaziz-api-embedding.hf.space/api/v1/rerank";
400
-
401
- const response = await fetch(url, {
402
- method: "POST",
403
- headers: { "Content-Type": "application/json" },
404
- body: JSON.stringify({
405
- query: "AI applications",
406
- documents: [
407
- "Computer vision for image recognition",
408
- "Recipe for chocolate cake",
409
- "Natural language processing for chatbots",
410
- "Travel guide to Paris"
411
- ],
412
- model_id: "jina-reranker-v3",
413
- top_k: 2
414
- })
415
- });
416
-
417
- const { results } = await response.json();
418
- console.log("Top results:", results);
419
- ```
420
-
421
- ---
422
-
423
- ## πŸ€– Model Management
424
-
425
- ### 3. List Available Models
426
-
427
- **`GET /api/v1/models`**
428
-
429
- Get a list of all available embedding models.
430
-
431
- #### Response
432
-
433
- ```json
434
- {
435
- "models": [
436
- {
437
- "id": "qwen3-0.6b",
438
- "name": "Qwen/Qwen3-Embedding-0.6B",
439
- "type": "embeddings",
440
- "loaded": true,
441
- "repository": "https://huggingface.co/Qwen/Qwen3-Embedding-0.6B"
442
- },
443
- {
444
- "id": "splade-pp-v2",
445
- "name": "prithivida/Splade_PP_en_v2",
446
- "type": "sparse-embeddings",
447
- "loaded": true,
448
- "repository": "https://huggingface.co/prithivida/Splade_PP_en_v2"
449
- }
450
- ],
451
- "total": 2
452
- }
453
- ```
454
-
455
- #### Example
456
-
457
- ```bash
458
- curl -X 'GET' \
459
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/models' \
460
- -H 'accept: application/json'
461
- ```
462
-
463
- ---
464
-
465
- ### 4. Get Model Information
466
-
467
- **`GET /api/v1/models/{model_id}`**
468
-
469
- Get detailed information about a specific model.
470
-
471
- #### Parameters
472
-
473
- | Parameter | Type | Required | Description |
474
- |-----------|------|----------|-------------|
475
- | `model_id` | string | βœ… Yes | Model identifier |
476
-
477
- #### Response
478
-
479
- ```json
480
- {
481
- "id": "qwen3-0.6b",
482
- "name": "Qwen/Qwen3-Embedding-0.6B",
483
- "type": "embeddings",
484
- "loaded": true,
485
- "repository": "https://huggingface.co/Qwen/Qwen3-Embedding-0.6B"
486
- }
487
- ```
488
-
489
- #### Example
490
-
491
- ```bash
492
- curl -X 'GET' \
493
- 'https://fahmiaziz-api-embedding.hf.space/api/v1/models/qwen3-0.6b' \
494
- -H 'accept: application/json'
495
- ```
496
-
497
- ---
498
-
499
- ## πŸ₯ System Endpoints
500
-
501
- ### 5. Health Check
502
-
503
- **`GET /health`**
504
-
505
- Check API health status.
506
-
507
- #### Response
508
-
509
- ```json
510
- {
511
- "status": "ok",
512
- "total_models": 2,
513
- "loaded_models": 2,
514
- "startup_complete": true
515
- }
516
- ```
517
-
518
- #### Example
519
-
520
- ```bash
521
- curl -X 'GET' \
522
- 'https://fahmiaziz-api-embedding.hf.space/health' \
523
- -H 'accept: application/json'
524
- ```
525
-
526
- ---
527
-
528
- ### 6. API Information
529
-
530
- **`GET /`**
531
-
532
- Get basic API information.
533
-
534
- #### Response
535
-
536
- ```json
537
- {
538
- "message": "Unified Embedding API - Dense & Sparse Embeddings",
539
- "version": "3.0.0",
540
- "docs_url": "/docs"
541
- }
542
- ```
543
-
544
- ---
545
-
546
- ## ❌ Error Responses
547
-
548
- All errors follow this format:
549
-
550
- ```json
551
- {
552
- "detail": "Error message description"
553
- }
554
- ```
555
-
556
- ### HTTP Status Codes
557
-
558
- | Code | Description |
559
- |------|-------------|
560
- | 200 | Success |
561
- | 400 | Bad Request - Invalid input |
562
- | 404 | Not Found - Model not found |
563
- | 422 | Unprocessable Entity - Validation error |
564
- | 500 | Internal Server Error |
565
- | 503 | Service Unavailable - Server not ready |
566
-
567
- ### Common Errors
568
-
569
- **Model Not Found (404):**
570
- ```json
571
- {
572
- "detail": "Model 'unknown-model' not found in configuration"
573
- }
574
- ```
575
-
576
- **Validation Error (422):**
577
- ```json
578
- {
579
- "detail": [
580
- {
581
- "loc": ["body", "texts"],
582
- "msg": "texts list cannot be empty",
583
- "type": "value_error"
584
- }
585
- ]
586
- }
587
- ```
588
-
589
- **Batch Too Large (422):**
590
- ```json
591
- {
592
- "detail": "Batch size (150) exceeds maximum (100)"
593
- }
594
- ```
595
-
596
- ---
597
-
598
- ## πŸ“¦ Available Models
599
-
600
- ### Dense Embedding Models
601
-
602
- | Model ID | Name | Dimension | Description |
603
- |----------|------|-----------|-------------|
604
- | `qwen3-0.6b` | Qwen/Qwen3-Embedding-0.6B | 768 | Efficient multilingual embeddings |
605
-
606
- ### Sparse Embedding Models
607
-
608
- | Model ID | Name | Type | Description |
609
- |----------|------|------|-------------|
610
- | `splade-pp-v2` | prithivida/Splade_PP_en_v2 | Sparse | SPLADE++ English v2 |
611
-
612
- ### Reranking Models
613
-
614
- | Model ID | Name | Type | Description |
615
- |----------|------|------|-------------|
616
- | `jina-reranker-v3` | jinaai/jina-reranker-v3-base-en | CrossEncoder | High-quality reranking (English) |
617
- | `bge-v2-m3` | BAAI/bge-reranker-v2-m3 | CrossEncoder | Multilingual reranking |
618
-
619
- ---
620
-
621
- ## πŸ”§ Rate Limits
622
-
623
- **Current Limits:**
624
- - Max text length: 8,192 characters
625
- - Max batch size: 100 texts per request
626
- - No rate limiting (subject to server resources)
627
-
628
- ---
629
-
630
- ## πŸ’‘ Best Practices
631
-
632
- ### 1. Batch Processing
633
- Always batch multiple texts together for better performance:
634
- ```python
635
- # ❌ Bad - Multiple requests
636
- for text in texts:
637
- response = requests.post(url, json={"texts": [text], ...})
638
-
639
- # βœ… Good - Single batch request
640
- response = requests.post(url, json={"texts": texts, ...})
641
- ```
642
-
643
- ### 2. Normalize Embeddings for Similarity
644
- For cosine similarity, always normalize:
645
- ```python
646
- payload = {
647
- "texts": ["text"],
648
- "model_id": "qwen3-0.6b",
649
- "options": {"normalize_embeddings": True}
650
- }
651
- ```
652
-
653
- ### 3. Model Selection
654
- - **Dense models** (qwen3-0.6b): Best for semantic similarity
655
- - **Sparse models** (splade-pp-v2): Best for keyword matching + semantic
656
- - **Rerank models** (jina-reranker-v3): Best for re-scoring top candidates
657
-
658
- ### 4. Two-Stage Retrieval (Recommended for RAG)
659
- ```python
660
- # Stage 1: Fast retrieval with embeddings (top 100)
661
- query_embedding = embed_query(query)
662
- candidates = vector_search(query_embedding, top_k=100)
663
-
664
- # Stage 2: Precise reranking (top 10)
665
- reranked = rerank(
666
- query=query,
667
- documents=[c["text"] for c in candidates],
668
- model_id="jina-reranker-v3",
669
- top_k=10
670
- )
671
- ```
672
-
673
- ### 5. Error Handling
674
- Always handle errors gracefully:
675
- ```python
676
- try:
677
- response = requests.post(url, json=payload)
678
- response.raise_for_status()
679
- data = response.json()
680
- except requests.exceptions.HTTPError as e:
681
- print(f"HTTP error: {e}")
682
- except requests.exceptions.RequestException as e:
683
- print(f"Request failed: {e}")
684
- ```
685
-
686
- ---
687
-
688
- ## πŸ› Troubleshooting
689
-
690
- ### Empty Response
691
- - Check `texts` field is not empty
692
- - Validate `model_id` exists
693
-
694
- ### Slow Performance
695
- - Use batch requests instead of multiple single requests
696
- - Reduce `batch_size` in options if memory issues
697
- - Check model is preloaded (first request is slower)
698
-
699
- ### Connection Errors
700
- - Verify base URL is correct
701
- - Check network connectivity
702
- - Ensure server is running (`/health` endpoint)
703
-
704
- ---
705
-
706
- ## πŸ“ž Support
707
-
708
- - **Documentation**: [GitHub README](https://github.com/fahmiaziz/unified-embedding-api)
709
- - **Issues**: [GitHub Issues](https://github.com/fahmiaziz/unified-embedding-api/issues)
710
- - **Hugging Face Space**: [fahmiaziz/api-embedding](https://huggingface.co/spaces/fahmiaziz/api-embedding)
711
-
712
- ---
713
-
714
- ## πŸ”„ Changelog
715
-
716
- ### v3.0.0 (Current)
717
- - ✨ Added reranking endpoint (`/api/v1/rerank`)
718
- - ✨ Support for CrossEncoder models
719
- - ✨ Unified batch-only response format
720
- - ✨ Flexible kwargs support
721
- - ✨ In-memory caching
722
- - ✨ Improved error handling
723
- - ✨ Comprehensive documentation
724
- - πŸ› Fixed type hint errors in RerankModel
725
- - πŸ› Fixed duplicate parameter errors in rerank endpoint
726
-
727
- ---
728
-
729
- **Last Updated**: 2025-11-02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -7,8 +7,6 @@ sdk: docker
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
11
-
12
  # 🧠 Unified Embedding API
13
 
14
  > 🧩 Unified API for all your Embedding, Sparse & Reranking Models β€” plug and play with any model from Hugging Face or your own fine-tuned versions.
@@ -19,7 +17,7 @@ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-
19
 
20
  **Unified Embedding API** is a modular and open-source **RAG-ready API** built for developers who want a simple, unified way to access **dense**, **sparse**, and **reranking** models.
21
 
22
- It’s designed for **vector search**, **semantic retrieval**, and **AI-powered pipelines** β€” all controlled from a single `config.yaml` file.
23
 
24
  ⚠️ **Note:** This is a development API.
25
  For production deployment, host it on cloud platforms such as **Hugging Face TEI**, **AWS**, **GCP**, or any cloud provider of your choice.
@@ -28,13 +26,13 @@ For production deployment, host it on cloud platforms such as **Hugging Face TEI
28
 
29
  ## 🧩 Features
30
 
31
- - 🧠 **Unified Interface** β€” One API to handle dense, sparse, and reranking models.
32
- - ⚑ **Batch Processing** β€” Automatic single/batch.
33
  - πŸ”§ **Flexible Parameters** β€” Full control via kwargs and options
34
- - πŸ” **Vector DB Ready** β€” Easily integrates with FAISS, Chroma, Qdrant, Milvus, etc.
35
- - πŸ“ˆ **RAG Support** β€” Perfect base for Retrieval-Augmented Generation systems.
36
- - ⚑ **Fast & Lightweight** β€” Powered by FastAPI and optimized with async processing.
37
- - 🧰 **Extendable** β€” Switch models instantly via `config.yaml` and add your own models or pipelines effortlessly.
38
 
39
  ---
40
 
@@ -48,8 +46,8 @@ unified-embedding-api/
48
  β”‚ β”‚ └── routes/
49
  β”‚ β”‚ β”œβ”€β”€ embeddings.py # endpoint sparse & dense
50
  β”‚ β”‚ β”œβ”€β”€ models.py
51
- β”‚ β”‚ |── health.py
52
- β”‚ β”‚ └── rerank.py # endpoint reranking
53
  β”‚ β”œβ”€β”€ core/
54
  β”‚ β”‚ β”œβ”€β”€ base.py
55
  β”‚ β”‚ β”œβ”€β”€ config.py
@@ -57,16 +55,16 @@ unified-embedding-api/
57
  β”‚ β”‚ └── manager.py
58
  β”‚ β”œβ”€β”€ models/
59
  β”‚ β”‚ β”œβ”€β”€ embeddings/
60
- β”‚ β”‚ β”‚ β”œβ”€β”€ dense.py # dense model
61
- β”‚ β”‚ β”‚ └── sparse.py # sparse model
62
- β”‚ β”‚ β”‚ └── rank.py # reranking model
63
  β”‚ β”‚ └── schemas/
64
  β”‚ β”‚ β”œβ”€β”€ common.py
65
  β”‚ β”‚ β”œβ”€β”€ requests.py
66
  β”‚ β”‚ └── responses.py
67
  β”‚ β”œβ”€β”€ config/
68
  β”‚ β”‚ β”œβ”€β”€ settings.py
69
- β”‚ β”‚ └── models.yaml # add/change models here
70
  β”‚ └── utils/
71
  β”‚ β”œβ”€β”€ logger.py
72
  β”‚ └── validators.py
@@ -77,7 +75,9 @@ unified-embedding-api/
77
  β”œβ”€β”€ Dockerfile
78
  └── README.md
79
  ```
 
80
  ---
 
81
  ## 🧩 Model Selection
82
 
83
  Default configuration is optimized for **CPU 2vCPU / 16GB RAM**. See [MTEB Leaderboard](https://huggingface.co/spaces/mteb/leaderboard) for model recommendations and memory usage reference.
@@ -105,7 +105,7 @@ Deploy your **Custom Embedding API** on **Hugging Face Spaces** β€” free, fast,
105
  πŸ‘‰ [fahmiaziz/api-embedding](https://huggingface.co/spaces/fahmiaziz/api-embedding)
106
  Click **β‹―** (three dots) β†’ **Duplicate this Space**
107
 
108
- 2. **Add HF_TOKEN environment variable** Make sure your space is public
109
 
110
  3. **Clone your Space locally:**
111
  Click **β‹―** β†’ **Clone repository**
@@ -129,14 +129,14 @@ Deploy your **Custom Embedding API** on **Hugging Face Spaces** β€” free, fast,
129
  git push
130
  ```
131
 
132
- 6. **Access your API:**
133
- Click **β‹―** β†’ **Embed this Space** -> copy **Direct URL**
134
  ```
135
  https://YOUR_USERNAME-api-embedding.hf.space
136
  https://YOUR_USERNAME-api-embedding.hf.space/docs # Interactive docs
137
  ```
138
 
139
- That’s it! You now have a live embedding API endpoint powered by your models.
140
 
141
  ### **2️⃣ Run Locally (NOT RECOMMENDED)**
142
 
@@ -169,104 +169,86 @@ docker build -t embedding-api .
169
  docker run -p 7860:7860 embedding-api
170
  ```
171
 
 
 
172
  ## πŸ“– Usage Examples
173
 
174
- ### **Python**
175
 
176
  ```python
177
  import requests
178
 
179
- url = "http://localhost:7860/api/v1/embeddings/embed"
180
 
181
  # Single embedding
182
- response = requests.post(url, json={
183
- "texts": ["What is artificial intelligence?"],
184
- "model_id": "qwen3-0.6b"
185
  })
186
- print(response.json())
187
-
188
- # Batch embeddings
189
- response = requests.post(url, json={
190
- "texts": [
191
- "First document",
192
- "Second document",
193
- "Third document"
194
- ],
195
- "model_id": "qwen3-0.6b",
196
  "options": {
197
  "normalize_embeddings": True
198
  }
199
  })
200
- embeddings = response.json()["embeddings"]
201
  ```
202
 
203
  ### **cURL**
204
 
205
  ```bash
206
- # Single embedding (Dense)
207
- curl -X POST "http://localhost:7860/api/v1/embeddings/embed" \
208
  -H "Content-Type: application/json" \
209
  -d '{
210
- "texts": ["Hello world"],
211
- "prompt": "add instructions here",
212
- "model_id": "qwen3-0.6b"
213
  }'
214
 
215
- # Batch embeddings (Sparse)
216
- curl -X POST "http://localhost:7860/api/v1/embeddings/embed" \
217
  -H "Content-Type: application/json" \
218
  -d '{
219
- "texts": ["First doc", "Second doc", "Third doc"],
220
- "model_id": "splade-pp-v2"
221
  }'
222
 
223
  # Reranking
224
- curl -X POST "http://localhost:7860/api/v1/rerank" \
225
  -H "Content-Type: application/json" \
226
  -d '{
227
- "documents": [
228
- "Python is a popular language for data science due to its extensive libraries.",
229
- "R is widely used in statistical computing and data analysis.",
230
- "Java is a versatile language used in various applications, including data science.",
231
- "SQL is essential for managing and querying relational databases.",
232
- "Julia is a high-performance language gaining popularity for numerical computing and data science."
233
- ],
234
- "model_id": "bge-v2-m3",
235
- "query": "Python best programming languages for data science",
236
- "top_k": 3
237
- }'
238
-
239
- # Query embedding with options
240
- curl -X POST "http://localhost:7860/api/v1/embeddings/query" \
241
- -H "Content-Type: application/json" \
242
- -d '{
243
- "texts": ["What is machine learning?"],
244
- "model_id": "qwen3-0.6b",
245
- "options": {
246
- "normalize_embeddings": true,
247
- "batch_size": 32
248
- }
249
  }'
250
  ```
251
 
252
  ### **JavaScript/TypeScript**
253
 
254
  ```typescript
255
- const url = "http://localhost:7860/api/v1/embeddings/embed";
256
 
257
- const response = await fetch(url, {
 
258
  method: "POST",
259
- headers: {
260
- "Content-Type": "application/json",
261
- },
262
  body: JSON.stringify({
263
  texts: ["Hello world"],
264
  model_id: "qwen3-0.6b",
265
  }),
266
  });
267
 
268
- const data = await response.json();
269
- console.log(data.embedding);
270
  ```
271
 
272
  ---
@@ -275,17 +257,91 @@ console.log(data.embedding);
275
 
276
  | Endpoint | Method | Description |
277
  |----------|--------|-------------|
278
- | `/api/v1/embeddings/embed` | POST | Generate document embeddings (single/batch) |
279
- | `/api/v1/embeddings/query` | POST | Generate query embeddings (single/batch) |
280
- | `/api/v1/rerank` | POST | Rerank documents based on a query |
281
  | `/api/v1/models` | GET | List available models |
282
  | `/api/v1/models/{model_id}` | GET | Get model information |
283
  | `/health` | GET | Health check |
284
  | `/` | GET | API information |
285
  | `/docs` | GET | Interactive API documentation |
286
 
 
 
 
 
 
287
 
288
- ### 🀝 Contributing
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
 
290
  Contributions are welcome! Please:
291
 
@@ -295,15 +351,6 @@ Contributions are welcome! Please:
295
  4. Push to the branch (`git push origin feature/amazing-feature`)
296
  5. Open a Pull Request
297
 
298
- **Development Setup:**
299
-
300
- ```bash
301
- git clone https://github.com/fahmiaziz/unified-embedding-api.git
302
- cd unified-embedding-api
303
- pip install -r requirements-dev.txt
304
- pre-commit install # (optional)
305
- ```
306
-
307
  ---
308
 
309
  ## πŸ“š Resources
@@ -311,12 +358,12 @@ pre-commit install # (optional)
311
  - [API Documentation](API.md)
312
  - [Sentence Transformers](https://www.sbert.net/)
313
  - [FastAPI Docs](https://fastapi.tiangolo.com/)
 
314
  - [MTEB Leaderboard](https://huggingface.co/spaces/mteb/leaderboard)
315
  - [Hugging Face Spaces](https://huggingface.co/docs/hub/spaces)
316
- - [Deploy Applications on Hugging Face Spaces (Official Guide)](https://huggingface.co/blog/HemanthSai7/deploy-applications-on-huggingface-spaces)
317
- - [How-to-Sync-Hugging-Face-Spaces-with-a-GitHub-Repository by Ruslanmv](https://github.com/ruslanmv/How-to-Sync-Hugging-Face-Spaces-with-a-GitHub-Repository?tab=readme-ov-file)
318
- - [Duplicate & Clone space to local machine](https://huggingface.co/docs/hub/spaces-overview#duplicating-a-space)
319
- ---
320
 
321
  ---
322
 
@@ -331,27 +378,23 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
331
  - **Sentence Transformers** for the embedding models
332
  - **FastAPI** for the excellent web framework
333
  - **Hugging Face** for model hosting and Spaces
 
334
  - **Open Source Community** for inspiration and support
335
 
336
  ---
337
 
338
  ## πŸ“ž Support
339
 
340
- - **Issues:** [GitHub Issues](https://github.com/fahmiaziz/unified-embedding-api/issues)
341
- - **Discussions:** [GitHub Discussions](https://github.com/fahmiaziz/unified-embedding-api/discussions)
342
  - **Hugging Face Space:** [fahmiaziz/api-embedding](https://huggingface.co/spaces/fahmiaziz/api-embedding)
343
 
344
  ---
345
 
346
- > ✨ β€œUnify your embeddings. Simplify your AI stack.”
347
-
348
  <div align="center">
349
 
350
- **⭐ Star this repo if you find it useful!**
351
-
352
  Made with ❀️ by the Open-Source Community
353
 
354
- </div>
355
-
356
-
357
 
 
 
7
  pinned: false
8
  ---
9
 
 
 
10
  # 🧠 Unified Embedding API
11
 
12
  > 🧩 Unified API for all your Embedding, Sparse & Reranking Models β€” plug and play with any model from Hugging Face or your own fine-tuned versions.
 
17
 
18
  **Unified Embedding API** is a modular and open-source **RAG-ready API** built for developers who want a simple, unified way to access **dense**, **sparse**, and **reranking** models.
19
 
20
+ It's designed for **vector search**, **semantic retrieval**, and **AI-powered pipelines** β€” all controlled from a single `config.yaml` file.
21
 
22
  ⚠️ **Note:** This is a development API.
23
  For production deployment, host it on cloud platforms such as **Hugging Face TEI**, **AWS**, **GCP**, or any cloud provider of your choice.
 
26
 
27
  ## 🧩 Features
28
 
29
+ - 🧠 **Unified Interface** β€” One API to handle dense, sparse, and reranking models
30
+ - ⚑ **Batch Processing** β€” Automatic single/batch detection
31
  - πŸ”§ **Flexible Parameters** β€” Full control via kwargs and options
32
+ - πŸ”Œ **OpenAI Compatible** β€” Works with OpenAI client libraries
33
+ - πŸ“ˆ **RAG Support** β€” Perfect base for Retrieval-Augmented Generation systems
34
+ - ⚑ **Fast & Lightweight** β€” Powered by FastAPI and optimized with async processing
35
+ - 🧰 **Extendable** β€” Switch models instantly via `config.yaml` and add your own models effortlessly
36
 
37
  ---
38
 
 
46
  β”‚ β”‚ └── routes/
47
  β”‚ β”‚ β”œβ”€β”€ embeddings.py # endpoint sparse & dense
48
  β”‚ β”‚ β”œβ”€β”€ models.py
49
+ β”‚ β”‚ β”œβ”€β”€ health.py
50
+ β”‚ β”‚ └── rerank.py # endpoint reranking
51
  β”‚ β”œβ”€β”€ core/
52
  β”‚ β”‚ β”œβ”€β”€ base.py
53
  β”‚ β”‚ β”œβ”€β”€ config.py
 
55
  β”‚ β”‚ └── manager.py
56
  β”‚ β”œβ”€β”€ models/
57
  β”‚ β”‚ β”œβ”€β”€ embeddings/
58
+ β”‚ β”‚ β”‚ β”œβ”€β”€ dense.py # dense model
59
+ β”‚ β”‚ β”‚ β”œβ”€β”€ sparse.py # sparse model
60
+ β”‚ β”‚ β”‚ └── rank.py # reranking model
61
  β”‚ β”‚ └── schemas/
62
  β”‚ β”‚ β”œβ”€β”€ common.py
63
  β”‚ β”‚ β”œβ”€β”€ requests.py
64
  β”‚ β”‚ └── responses.py
65
  β”‚ β”œβ”€β”€ config/
66
  β”‚ β”‚ β”œβ”€β”€ settings.py
67
+ β”‚ β”‚ └── models.yaml # add/change models here
68
  β”‚ └── utils/
69
  β”‚ β”œβ”€β”€ logger.py
70
  β”‚ └── validators.py
 
75
  β”œβ”€β”€ Dockerfile
76
  └── README.md
77
  ```
78
+
79
  ---
80
+
81
  ## 🧩 Model Selection
82
 
83
  Default configuration is optimized for **CPU 2vCPU / 16GB RAM**. See [MTEB Leaderboard](https://huggingface.co/spaces/mteb/leaderboard) for model recommendations and memory usage reference.
 
105
  πŸ‘‰ [fahmiaziz/api-embedding](https://huggingface.co/spaces/fahmiaziz/api-embedding)
106
  Click **β‹―** (three dots) β†’ **Duplicate this Space**
107
 
108
+ 2. **Add HF_TOKEN environment variable**. Make sure your space is public
109
 
110
  3. **Clone your Space locally:**
111
  Click **β‹―** β†’ **Clone repository**
 
129
  git push
130
  ```
131
 
132
+ 6. **Access your API:**
133
+ Click **β‹―** β†’ **Embed this Space** β†’ copy **Direct URL**
134
  ```
135
  https://YOUR_USERNAME-api-embedding.hf.space
136
  https://YOUR_USERNAME-api-embedding.hf.space/docs # Interactive docs
137
  ```
138
 
139
+ That's it! You now have a live embedding API endpoint powered by your models.
140
 
141
  ### **2️⃣ Run Locally (NOT RECOMMENDED)**
142
 
 
169
  docker run -p 7860:7860 embedding-api
170
  ```
171
 
172
+ ---
173
+
174
  ## πŸ“– Usage Examples
175
 
176
+ ### **Python with Native API**
177
 
178
  ```python
179
  import requests
180
 
181
+ base_url = "https://fahmiaziz-api-embedding.hf.space/api/v1"
182
 
183
  # Single embedding
184
+ response = requests.post(f"{base_url}/embeddings", json={
185
+ "input": "What is artificial intelligence?",
186
+ "model": "qwen3-0.6b"
187
  })
188
+ embeddings = response.json()["data"]
189
+
190
+ # Batch embeddings with options
191
+ response = requests.post(f"{base_url}/embeddings", json={
192
+ "input": ["First document", "Second document", "Third document"],
193
+ "model": "qwen3-0.6b",
 
 
 
 
194
  "options": {
195
  "normalize_embeddings": True
196
  }
197
  })
198
+ batch_embeddings = response.json()["data"]
199
  ```
200
 
201
  ### **cURL**
202
 
203
  ```bash
204
+ # Dense embeddings
205
+ curl -X POST "https://fahmiaziz-api-embedding.hf.space/api/v1/embeddings" \
206
  -H "Content-Type: application/json" \
207
  -d '{
208
+ "input": ["Hello world"],
209
+ "model": "qwen3-0.6b"
 
210
  }'
211
 
212
+ # Sparse embeddings
213
+ curl -X POST "https://fahmiaziz-api-embedding.hf.space/api/v1/embed_sparse" \
214
  -H "Content-Type: application/json" \
215
  -d '{
216
+ "input": ["First doc", "Second doc", "Third doc"],
217
+ "model": "splade-pp-v2"
218
  }'
219
 
220
  # Reranking
221
+ curl -X POST "https://fahmiaziz-api-embedding.hf.space/api/v1/rerank" \
222
  -H "Content-Type: application/json" \
223
  -d '{
224
+ "query": "Python for data science",
225
+ "documents": [
226
+ "Python is great for data science",
227
+ "Java is used for enterprise apps",
228
+ "R is for statistical analysis"
229
+ ],
230
+ "model": "bge-v2-m3",
231
+ "top_k": 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  }'
233
  ```
234
 
235
  ### **JavaScript/TypeScript**
236
 
237
  ```typescript
238
+ const baseUrl = "https://fahmiaziz-api-embedding.hf.space/api/v1";
239
 
240
+ // Using fetch
241
+ const response = await fetch(`${baseUrl}/embeddings`, {
242
  method: "POST",
243
+ headers: { "Content-Type": "application/json" },
 
 
244
  body: JSON.stringify({
245
  texts: ["Hello world"],
246
  model_id: "qwen3-0.6b",
247
  }),
248
  });
249
 
250
+ const { embeddings } = await response.json();
251
+ console.log(embeddings);
252
  ```
253
 
254
  ---
 
257
 
258
  | Endpoint | Method | Description |
259
  |----------|--------|-------------|
260
+ | `/api/v1/embeddings` | POST | Generate embeddings (OpenAI compatible) |
261
+ | `/api/v1/embed_sparse` | POST | Generate sparse embeddings |
262
+ | `/api/v1/rerank` | POST | Rerank documents by relevance |
263
  | `/api/v1/models` | GET | List available models |
264
  | `/api/v1/models/{model_id}` | GET | Get model information |
265
  | `/health` | GET | Health check |
266
  | `/` | GET | API information |
267
  | `/docs` | GET | Interactive API documentation |
268
 
269
+ ---
270
+
271
+ ## πŸ”Œ OpenAI Client Compatibility
272
+
273
+ This API is **fully compatible** with OpenAI's client libraries, making it a drop-in replacement for OpenAI's embedding API.
274
 
275
+ ### **Why use OpenAI client?**
276
+
277
+ βœ… **Familiar API** β€” Same interface as OpenAI
278
+ βœ… **Type Safety** β€” Full type hints and IDE support
279
+ βœ… **Error Handling** β€” Built-in retry logic and error handling
280
+ βœ… **Async Support** β€” Native async/await support
281
+ βœ… **Easy Migration** β€” Switch between OpenAI and self-hosted seamlessly
282
+
283
+ ### **Supported Features**
284
+
285
+ | Feature | Supported | Notes |
286
+ |---------|-----------|-------|
287
+ | `embeddings.create()` | βœ… Yes | Single and batch inputs |
288
+ | `input` as string | βœ… Yes | Auto-converted to list |
289
+ | `input` as list | βœ… Yes | Batch processing |
290
+ | `model` parameter | βœ… Yes | Use your model IDs |
291
+ | `encoding_format` | ⚠️ Partial | Always returns `float` |
292
+
293
+ ### **Example with OpenAI Client (Compatible!)**
294
+
295
+ ```python
296
+ from openai import OpenAI
297
+
298
+ # Initialize client with your API endpoint
299
+ client = OpenAI(
300
+ base_url="https://fahmiaziz-api-embedding.hf.space/api/v1",
301
+ api_key="-" # API key not required, but must be present
302
+ )
303
+
304
+ # Generate embeddings
305
+ embedding = client.embeddings.create(
306
+ input="Hello",
307
+ model="qwen3-0.6b"
308
+ )
309
+
310
+ # Access results
311
+ for item in embedding.data:
312
+ print(f"Embedding: {item.embedding[:5]}...") # First 5 dimensions
313
+ print(f"Index: {item.index}")
314
+ ```
315
+
316
+ ### **Async OpenAI Client**
317
+
318
+ ```python
319
+ from openai import AsyncOpenAI
320
+
321
+ # Initialize async client
322
+ client = AsyncOpenAI(
323
+ base_url="https://fahmiaziz-api-embedding.hf.space/api/v1",
324
+ api_key="-"
325
+ )
326
+
327
+ # Generate embeddings asynchronously
328
+ async def get_embeddings():
329
+ try:
330
+ embedding = await client.embeddings.create(
331
+ input=["Hello", "World", "AI"],
332
+ model="qwen3-0.6b"
333
+ )
334
+ return embedding
335
+ except Exception as e:
336
+ print(f"Error: {e}")
337
+
338
+ # Use in async context
339
+ embeddings = await get_embeddings()
340
+ ```
341
+
342
+ ---
343
+
344
+ ## 🀝 Contributing
345
 
346
  Contributions are welcome! Please:
347
 
 
351
  4. Push to the branch (`git push origin feature/amazing-feature`)
352
  5. Open a Pull Request
353
 
 
 
 
 
 
 
 
 
 
354
  ---
355
 
356
  ## πŸ“š Resources
 
358
  - [API Documentation](API.md)
359
  - [Sentence Transformers](https://www.sbert.net/)
360
  - [FastAPI Docs](https://fastapi.tiangolo.com/)
361
+ - [OpenAI Python Client](https://github.com/openai/openai-python)
362
  - [MTEB Leaderboard](https://huggingface.co/spaces/mteb/leaderboard)
363
  - [Hugging Face Spaces](https://huggingface.co/docs/hub/spaces)
364
+ - [Deploy Applications on Hugging Face Spaces](https://huggingface.co/blog/HemanthSai7/deploy-applications-on-huggingface-spaces)
365
+ - [Sync HF Spaces with GitHub](https://github.com/ruslanmv/How-to-Sync-Hugging-Face-Spaces-with-a-GitHub-Repository)
366
+ - [Duplicate & Clone Spaces](https://huggingface.co/docs/hub/spaces-overview#duplicating-a-space)
 
367
 
368
  ---
369
 
 
378
  - **Sentence Transformers** for the embedding models
379
  - **FastAPI** for the excellent web framework
380
  - **Hugging Face** for model hosting and Spaces
381
+ - **OpenAI** for the client library design
382
  - **Open Source Community** for inspiration and support
383
 
384
  ---
385
 
386
  ## πŸ“ž Support
387
 
388
+ - **Issues:** [GitHub Issues](https://github.com/fahmiaziz98/unified-embedding-api/issues)
389
+ - **Discussions:** [GitHub Discussions](https://github.com/fahmiaziz98/unified-embedding-api/discussions)
390
  - **Hugging Face Space:** [fahmiaziz/api-embedding](https://huggingface.co/spaces/fahmiaziz/api-embedding)
391
 
392
  ---
393
 
 
 
394
  <div align="center">
395
 
 
 
396
  Made with ❀️ by the Open-Source Community
397
 
398
+ > ✨ "Unify your embeddings. Simplify your AI stack."
 
 
399
 
400
+ </div>