Amaranath commited on
Commit
1ffc79d
Β·
verified Β·
1 Parent(s): 6f8086c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -7
README.md CHANGED
@@ -1,11 +1,64 @@
1
  ---
2
- title: Ollama Llama32 1b
3
- emoji: πŸ“Š
4
- colorFrom: gray
5
- colorTo: yellow
6
  sdk: docker
7
- pinned: false
8
- short_description: Ollama server with small models
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Authenticated Ollama API with Admin Panel
3
+ emoji: πŸ”
4
+ colorFrom: blue
5
+ colorTo: green
6
  sdk: docker
7
+ app_port: 7860
 
8
  ---
9
 
10
+ # πŸ” Authenticated Ollama API Server with Admin Panel
11
+
12
+ A secure FastAPI wrapper around Ollama with **dual authentication** - regular API keys for model operations and admin keys for key management.
13
+
14
+ ## πŸš€ Features
15
+
16
+ - **πŸ”’ Dual Authentication System** - Separate API and Admin keys
17
+ - **πŸ¦™ Llama 3.2 1B Model** - Pre-loaded and ready to use
18
+ - **πŸ”§ Admin Key Management** - Secure key retrieval and rotation
19
+ - **πŸ“‘ Complete REST API** - All Ollama endpoints wrapped
20
+ - **πŸ“– Interactive Docs** - Built-in Swagger UI
21
+ - **πŸ” Health Monitoring** - Comprehensive service status
22
+ - **πŸ“‹ Admin Logs** - Access logs and usage statistics
23
+
24
+ ## πŸ”‘ Two-Level Authentication
25
+
26
+ ### **API Key** (Regular Users)
27
+ - Use for all model operations (generate, chat, pull, etc.)
28
+ - Retrieved from logs or admin endpoints
29
+
30
+ ### **Admin Key** (Administrators)
31
+ - Use for key management and administrative functions
32
+ - Required for sensitive operations
33
+
34
+ ## πŸ“‹ API Endpoints
35
+
36
+ ### **Public Endpoints (No Auth Required)**
37
+ - `GET /` - API information
38
+ - `GET /health` - Health check
39
+ - `GET /docs` - Interactive documentation
40
+
41
+ ### **API Key Endpoints (Require API Key)**
42
+ - `GET /api/tags` - List models
43
+ - `POST /api/generate` - Generate text
44
+ - `POST /api/chat` - Chat with model
45
+ - `POST /api/pull` - Pull new models
46
+ - `DELETE /api/delete` - Delete models
47
+ - `GET /auth/test` - Test API authentication
48
+
49
+ ### **Admin Endpoints (Require Admin Key)**
50
+ - `GET /admin/info` - Admin panel information
51
+ - `GET /admin/api-key` - πŸ”‘ Retrieve current API key
52
+ - `GET /admin/key-info` - Get key info (without exposing key)
53
+ - `POST /admin/rotate-key` - πŸ”„ Generate new API key
54
+ - `GET /admin/logs` - πŸ“‹ View server logs
55
+ - `GET /admin/stats` - πŸ“Š Usage statistics
56
+ - `GET /admin/test` - Test admin authentication
57
+
58
+ ## πŸ”‘ Getting Your Keys
59
+
60
+ ### **From Server Logs (Recommended)**
61
+ 1. Check your Space logs for the startup message showing both keys
62
+ 2. Look for the section with API Key and Admin Key
63
+
64
+ ### **Via Admin Endpoint (Alternative)**