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

Adding operation name to LLM spans #995

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

sudivate
Copy link

@sudivate sudivate commented May 1, 2024

Fixes #

Changes

Adding operation name to LLM spans

Note: if the PR is touching an area that is not listed in the existing areas, or the area does not have sufficient domain experts coverage, the PR might be tagged as experts needed and move slowly until experts are identified.

Merge requirement checklist

Signed-off-by: sudivate <sudivate@microsoft.com>
Signed-off-by: sudivate <sudivate@microsoft.com>
… into sudivate/consistent-span-names

Signed-off-by: sudivate <sudivate@microsoft.com>
Signed-off-by: sudivate <sudivate@microsoft.com>
Copy link

linux-foundation-easycla bot commented May 1, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Signed-off-by: sudivate <sudivate@microsoft.com>
Signed-off-by: sudivate <sudivate@microsoft.com>
Signed-off-by: sudivate <sudivate@microsoft.com>
Signed-off-by: sudivate <sudivate@microsoft.com>
@sudivate sudivate marked this pull request as ready for review May 3, 2024 20:35
@sudivate sudivate requested review from a team as code owners May 3, 2024 20:35
model/registry/gen-ai.yaml Outdated Show resolved Hide resolved
stability: experimental
type: string
brief: The name of the LLM operation request being made.
examples: ['chat.completions', 'embeddings', 'speech.generations', 'audio.transcriptions', 'audio.translations', 'image.generations']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
examples: ['chat.completions', 'embeddings', 'speech.generations', 'audio.transcriptions', 'audio.translations', 'image.generations']
examples: ['chat', 'embeddings', 'speech.generations', 'audio.transcriptions', 'audio.translations', 'image.generations']

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if we convert it into a enum, it would be both - chat and completions (legacy)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, ideally it should be completions and chat.completions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find chat.completions to be highly confusing with completions. I'd stick with chat and completions

@lmolkova lmolkova changed the title [CHORE] Adding operation name to LLM spans Adding operation name to LLM spans May 9, 2024
Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments. Please also add the changelog record.
Thank you!

model/trace/gen-ai.yaml Outdated Show resolved Hide resolved
docs/gen-ai/llm-spans.md Outdated Show resolved Hide resolved
stability: experimental
type: string
brief: The name of the LLM operation request being made.
examples: ['chat.completions', 'embeddings', 'speech.generations', 'audio.transcriptions', 'audio.translations', 'image.generations']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if we convert it into a enum, it would be both - chat and completions (legacy)?

Signed-off-by: sudivate <sudivate@microsoft.com>
docs/gen-ai/llm-spans.md Outdated Show resolved Hide resolved
Signed-off-by: sudivate <sudivate@microsoft.com>
Signed-off-by: sudivate <sudivate@microsoft.com>
Signed-off-by: sudivate <sudivate@microsoft.com>
Copy link

@karthikscale3 karthikscale3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. Thanks


| Value | Description | Stability |
| ---------------------- | -------------------- | ---------------------------------------------------------------- |
| `completions` | Completions | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Howa about adding tokenize as well?

tokenize(prompt, return_tokens=False)[source]
The text tokenize operation allows you to check the conversion of provided input to tokens for a given model. It splits text into words or sub-words, which then are converted to ids through a look-up table (vocabulary). Tokenization allows the model to have a reasonable vocabulary size.

@nirga
Copy link
Contributor

nirga commented May 22, 2024

We can potentially continue the discussion here after #955 is merged

Copy link

github-actions bot commented Jun 7, 2024

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Discussions
Development

Successfully merging this pull request may close these issues.

None yet

7 participants