diff --git a/README.md b/README.md index cb2b2e7..ae34be9 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ AI models a new attack vector for hackers. They can use AI models to generate ma ## Solution OpenShield a transparent proxy that sits between your AI model and the client. It provides rate limiting, content filtering, and keyword filtering for AI models. +![Input flow](https://github.com/openshieldai/openshield/docs/assets/input.svg) + +![Output flow](https://github.com/openshieldai/openshield/docs/assets/output.svg) + You can chain multiple AI models together to create a pipeline before hitting the foundation model. ## Features diff --git a/docs/assets/input.svg b/docs/assets/input.svg new file mode 100644 index 0000000..568e38c --- /dev/null +++ b/docs/assets/input.svg @@ -0,0 +1,136 @@ + + + + + + + + +Applicationintegrated with LLM/OpenAI{ "user": "email", "prompt": "here is an attack vector"}PII validation modelPrompt validation modelLangugageDetectionUsage loggingAudit loggingLLM modelHosted on OpenAI,self-hosted oron other third party serviceUserManagementRateLimitCache API Call Authentication/Authorization RateLimit Cache If not cached Loggging input prompt Logging model token usage PII Cleaning Prompt Injection Validated prompt + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/assets/output.svg b/docs/assets/output.svg new file mode 100644 index 0000000..edb0b4f --- /dev/null +++ b/docs/assets/output.svg @@ -0,0 +1,130 @@ + + + + + + + + +Applicationintegrated with LLM/OpenAI{ "user": "email", "prompt": "here is an attack vector"}PII validation modelPrompt validation modelLangugageDetectionUsage loggingAudit loggingLLM modelHosted on OpenAI,self-hosted oron other third party service Validated prompt Prompt Injection PII Cleaning Validated prompt Loggging prompt result Logging model token usage API Call + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/integrations/huggingface/index.js b/integrations/huggingface/index.js deleted file mode 100644 index 206e926..0000000 --- a/integrations/huggingface/index.js +++ /dev/null @@ -1,6 +0,0 @@ - -function huggingface () { - return '{"model":"gpt-4","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"What is the meaning of life?"}]}' -} - -export default huggingface; \ No newline at end of file diff --git a/integrations/openmeter/package.json b/integrations/openmeter/package.json deleted file mode 100644 index f92b877..0000000 --- a/integrations/openmeter/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "integration-openmeter", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/openshieldai/openshield.git" - }, - "private": true, - "dependencies": { - "@supabase/realtime-js": "^2.9.5" - } -} diff --git a/integrations/openmeter/src/index.ts b/integrations/openmeter/src/index.ts deleted file mode 100644 index 76ea935..0000000 --- a/integrations/openmeter/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { RealtimeClient } from '@supabase/realtime-js'; - -const client = new RealtimeClient(REALTIME_URL, { - params: { - apikey: API_KEY - }, -}) - -const channel = client.channel('test-channel', {}) - -channel.subscribe((status, err) => { - if (status === 'SUBSCRIBED') { - console.log('Connected!') - } - - if (status === 'CHANNEL_ERROR') { - console.log(`There was an error subscribing to channel: ${err.message}`) - } - - if (status === 'TIMED_OUT') { - console.log('Realtime server did not respond in time.') - } - - if (status === 'CLOSED') { - console.log('Realtime channel was unexpectedly closed.') - } -}) \ No newline at end of file diff --git a/server/server.go b/server/server.go index 5679ca1..b0a6e6d 100644 --- a/server/server.go +++ b/server/server.go @@ -3,14 +3,15 @@ package server import ( "context" "fmt" - "github.com/gofiber/fiber/v2/middleware/limiter" - "github.com/openshieldai/openshield/lib/openai" - "golang.org/x/sync/errgroup" "os" "os/signal" "syscall" "time" + "github.com/gofiber/fiber/v2/middleware/limiter" + "github.com/openshieldai/openshield/lib/openai" + "golang.org/x/sync/errgroup" + "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/logger" "github.com/gofiber/fiber/v2/middleware/requestid"