From f138fec16b4945e1104382376a6a4d62dfdafaea Mon Sep 17 00:00:00 2001 From: Max Krueger <48253889+mkrueger12@users.noreply.github.com> Date: Tue, 6 Feb 2024 19:40:37 -0700 Subject: [PATCH 1/3] Create 0007-embedding-api --- proposals/0007-embedding-api | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 proposals/0007-embedding-api diff --git a/proposals/0007-embedding-api b/proposals/0007-embedding-api new file mode 100644 index 0000000..451bb7b --- /dev/null +++ b/proposals/0007-embedding-api @@ -0,0 +1,50 @@ +--- +GEP: 0007 +Title: Unified Embedding API +Discussion: +Implementation: +--- + +# Unified Embedding API + +## Abstract + +This GEP discusses the unified embeddings api and its interactions with embedding model providers. + +## Motivation + +Many LLM applications have a semantic search feature within their architecture. To support these applications on Glide, a unified embedding api is necessary. +This will allow applications to embed chat requests as part of a retrieval augmented generation (RAG) application flow. + +### Requirements + +- R1: Handles all provider specific logic +- R2: Easily maintained +- R3: API schemas must unify common request params (e.g. dimensions) +- R4: API routes must unify common embedding endpoints/API + +## Design + +```yaml +routes: + chat: /v1/language/{pool-id}/chat/ + transcribers: /v1/speech/transcribers/{pool-id}/ + speech-synthesizer: /v1/speech/synthesizers/{pool-id}/ + multi-modal: /v1/multi/{pool-id}/multimodal/ + embedding: /v1/embeddings/{pool-id}/embed/ +``` + +#### User Request Schema for Embedding Route + +TBU + +#### Response Schema for Embedding Route +TBU + +## Alternatives Considered + +[TBU, what other solutions were considered and why they were rejected] + +## Future Work + +- Could we abstract away the entire RAG architecture? A single endpoint that takes a chat message -> embeds -> text semantic search -> LLM -> response From 04217255704fac6c80833f15d9d977d7fab4e500 Mon Sep 17 00:00:00 2001 From: Max Krueger <48253889+mkrueger12@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:24:30 -0700 Subject: [PATCH 2/3] Rename 0007-embedding-api to 0007-embedding-api.md --- proposals/{0007-embedding-api => 0007-embedding-api.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename proposals/{0007-embedding-api => 0007-embedding-api.md} (100%) diff --git a/proposals/0007-embedding-api b/proposals/0007-embedding-api.md similarity index 100% rename from proposals/0007-embedding-api rename to proposals/0007-embedding-api.md From 028caa6c6660353d38dcda61f844cdb6934b4422 Mon Sep 17 00:00:00 2001 From: Max Krueger <48253889+mkrueger12@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:49:31 -0700 Subject: [PATCH 3/3] Update 0007-embedding-api.md --- proposals/0007-embedding-api.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/proposals/0007-embedding-api.md b/proposals/0007-embedding-api.md index 451bb7b..50a42dc 100644 --- a/proposals/0007-embedding-api.md +++ b/proposals/0007-embedding-api.md @@ -36,10 +36,32 @@ routes: #### User Request Schema for Embedding Route -TBU +```yaml +{ + "message": "Where was it played?", + "dimensions": 1536 +} +``` #### Response Schema for Embedding Route -TBU +```yaml +{ + "provider": "cohere", + "model": "embed-multilingual-v3.0", + "provider_response": { + "embedding": [ + 0.0023064255, + -0.009327292, + .... + -0.0028842222, + ], + "token_count": { + "prompt_tokens": 9, + "total_tokens": 9 + } + } +} +``` ## Alternatives Considered