Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature design: Support detections on Chat API #167

Closed
1 task done
gkumbhat opened this issue Aug 19, 2024 · 1 comment · Fixed by #209
Closed
1 task done

Feature design: Support detections on Chat API #167

gkumbhat opened this issue Aug 19, 2024 · 1 comment · Fixed by #209
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@gkumbhat
Copy link
Collaborator

gkumbhat commented Aug 19, 2024

Use-case

End-to-end guardrails experience exposed on openAI chat API. This means, a user can use similar API as openAI chat and provide a list of detectors they want to run. Behind the scene, orchestrator will automatically run the detector at appropriate time in the lifecycle of the request (based on type of detector).

Description

To enable running detections on chat completion API, we need to design how the request and response look like for this API.

Some constrains and requirements we have talked about for designing this includes:

  1. API should support full openai API, thus providing chat completion:
    1. The parts of request that are in openai API, for example, parameters and messages should remain as is
    2. The parts of response from openai API, for example choices, usage etc, should remain as is.
  2. We want to provider ability to specify different kinds of detectors together, example, HAP, PII.
  3. Users should be able to provide list of detectors they want to execute on input and output separately.
  4. We understand user would likely need to have a bit of background to use some detectors of different types, where the answer is not quite intuitive at first, like use of generated type detectors along with HAP / PII, where response objects look different.
  5. Since some of these detectors may support optional parameters, we need each of the detector that the user is requesting to be an object, where one can pass parameters.

Acceptance Criteria

@gkumbhat gkumbhat added the enhancement New feature or request label Aug 19, 2024
@evaline-ju evaline-ju added the documentation Improvements or additions to documentation label Aug 19, 2024
@declark1
Copy link
Collaborator

declark1 commented Aug 19, 2024

For reference, OpenAI Chat/Completions API implementation for TGIS router on the following branch (not merged): https://github.com/IBM/text-generation-router/tree/openai-api
https://github.com/IBM/text-generation-router/tree/openai-api/fmaas-router/src/openai

@evaline-ju evaline-ju changed the title Feature: Support Chat API Feature design: Support Chat API Aug 19, 2024
@evaline-ju evaline-ju changed the title Feature design: Support Chat API Feature design: Support detections on Chat API Sep 13, 2024
@evaline-ju evaline-ju self-assigned this Sep 16, 2024
@evaline-ju evaline-ju linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants