Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

[Feature] Middleware Framework and First Middleware Integration #27

Open
yhbcode000 opened this issue Oct 9, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@yhbcode000
Copy link
Member

Middleware: What is it?

Middleware refers to software that provides common services and capabilities to applications outside of what's offered by the operating system. It acts as a bridge, enabling communication and data management for distributed applications. In this case, the middleware sits between the LLM (Large Language Model) layer and the user UI layer.

Why do we need middleware between the LLM layer and the user UI layer?

Middleware is essential here to ensure prompt anonymization and token management between user inputs and the LLM. It intercepts the prompt from the user, processes it to identify sensitive information, and replaces sensitive tokens with placeholder or alternate tokens. The middleware also handles the reverse mapping, allowing for seamless bi-directional conversion of anonymized content.

First Anonymization Middleware Layer

The input format for the middleware is simple:

{
  "prompt": "PROMPT TO AI"
}

cURL Example:

curl -X 'POST' \
  'address:8000/process_prompt' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "prompt": "string"
}'

Expected Output:

The middleware will return the original prompt with target tokens that need to be replaced, along with a list of possible replacement tokens.

Feature Requirement:

  • The middleware should keep a dictionary to map sensitive keys to replacement tokens.
  • This dictionary should allow for bi-directional conversion between the original sensitive content and its anonymized version.

Reference:

  • Check the group OneDrive for more information about the implementation.
@yhbcode000 yhbcode000 added the enhancement New feature or request label Oct 9, 2024
@yhbcode000 yhbcode000 added this to the v0.0.1 milestone Oct 9, 2024
@yhbcode000 yhbcode000 self-assigned this Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant