ChiloAi commited on
Commit
f9b683d
Β·
verified Β·
1 Parent(s): 3de9ba6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -30
README.md CHANGED
@@ -1,30 +1,30 @@
1
- ---
2
- title: Confidential Prompt FastAPI
3
- emoji: πŸ”’
4
- colorFrom: blue
5
- colorTo: indigo
6
- sdk: docker
7
- ---
8
-
9
- # FastAPI with Confidential Prompt
10
-
11
- This FastAPI application allows external systems to trigger the conversational logic of an AI agent without ever revealing the sensitive prompt. It is designed to be deployed on a private Hugging Face Space using Docker.
12
-
13
- ## Features
14
- - **Secure Prompt Storage**: The structured prompt is stored in the server-side environment.
15
-
16
- - **Anonymous API Key Generation**: The `/signup` endpoint generates a new random API key (UUID4) without requiring any personal information (no email, name, or phone number needed). The key is saved in a local SQLite database.
17
-
18
- - **Protected `/instructions` Endpoint**: The `/instructions` endpoint requires a valid API key (provided in the HTTP `Authorization` header). If the key is valid, the API returns a neutral confirmation message (`{"message": "Instructions processed"}`) without ever disclosing the prompt's content.
19
-
20
- - **No External LLM Integration**: The application does not integrate with any external language models. All conversational logic remains internal to the server, ensuring complete confidentiality of the prompt.
21
-
22
- ## Installation and Deployment
23
- 1. **Environment Variable**: Set the `CHILO_JSON` environment variable before starting the application, storing the structured prompt (in JSON format). On Hugging Face Spaces, add this variable as a secret to keep it private.
24
- 2. **Database**: The application uses an SQLite database named `api_keys.db` to store API keys. On Hugging Face Spaces, enable persistent storage to preserve this database (`/data/api_keys.db`) across restarts. Without persistent storage, the database will be recreated on each restart, and previously generated keys will be lost.
25
- 3. **Launch**: The provided `Dockerfile` starts the FastAPI server via Uvicorn on port 7860 (the default port for Spaces). Once deployed, the API will be accessible at your Space's URL (or locally at `http://localhost:7860`).
26
-
27
- ## API Usage
28
- - **POST** `/signup` – Generates a new API key and returns it in JSON format. For example:
29
- ```json
30
- {"api_key": "123e4567-e89b-12d3-a456-426614174000"}
 
1
+ ---
2
+ title: Chilo Ai
3
+ emoji: πŸ”’
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: docker
7
+ ---
8
+
9
+
10
+ # πŸ”’ Confidential Prompt API
11
+
12
+ This project provides a secure FastAPI interface for calling powerful instruction-based prompts **without exposing the source JSON**.
13
+
14
+ ## πŸš€ What it does
15
+
16
+ - Allows users to **generate an API key** (`/signup`)
17
+ - Securely **process confidential instructions** (`/instructions`) using their key
18
+ - Protects your proprietary logic with no direct prompt exposure
19
+
20
+ ## πŸ” Security Design
21
+
22
+ - Prompt is loaded from a secure `.json` file using a Hugging Face secret variable
23
+ - Keys are stored securely in a private SQLite database
24
+ - Unauthorized requests return `401 Unauthorized`
25
+
26
+ ## πŸ“£ How to Use
27
+
28
+ 1. **Generate a Key**:
29
+ ```bash
30
+ curl -X POST https://<your-space-name>.hf.space/signup