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

LLM: initial semconv definition #810

Closed
7 of 8 tasks
lmolkova opened this issue Mar 12, 2024 · 1 comment
Closed
7 of 8 tasks

LLM: initial semconv definition #810

lmolkova opened this issue Mar 12, 2024 · 1 comment

Comments

@lmolkova
Copy link
Contributor

lmolkova commented Mar 12, 2024

Define initial semantic conventions that establishes a foundation with essential attributes, including a vendor-specific example, and basic event definitions:

  • pick a namespace: gen_ai (genai?)
  • define basic request and response attributes.
    • gen_ai.system - Name of the LLM foundation model system or vendor
    • gen_ai.request.max_tokens - Max number of tokens the LLM to generate per request
    • gen_ai.request.model - Name of the LLM model used for the request
    • gen_ai.request.temperature - Temperature setting for the LLM request
    • gen_ai.request.top_p - Top_p sampling setting for the LLM request
    • gen_ai.response.model - Name of the LLM model used for the response
    • gen_ai.response.finish_reason - Reason why the LLM stopped generating tokens
    • gen_ai.response.id - Unique identifier for the response
  • define usage attributes
    • requirement levels, if they belong on spans or events
    • gen_ai.usage.completion_tokens - Number of tokens used in the LLM response
    • gen_ai.usage.prompt_tokens - Number of tokens used in the LLM prompt
      gen_ai.usage.total_tokens - Total number of tokens used in both prompt and response
  • include at least one vendor example (openai) - @drewby - Add system specific conventions for OpenAI #1385
    • gen_ai.openai.request.logit_bias - The logit_bias used in the request
    • gen_ai.openai.request.presence_penalty - The presence_penalty used in the request
    • gen_ai.openai.request.seed - Seed used in request to improve determinism.
    • gen_ai.openai.request.response_format - Format of the LLM's response, e.g., text or JSON
    • gen_ai.openai.response.created - UNIX timestamp of when the response was created
  • event definitions - @lmolkova - Introduce per-message structured GenAI events instead of prompt/completion span events #980
    • sensitivity, requirement level, attributes
    • gen_ai.content.prompt - Captures the full prompt string sent to an LLM
    • gen_ai.content.completion - Captures the full response string from an LLM
  • general attributes - @lmolkova - Add common attributes to gen-ai spans: server.address, server.port and error.type #1297
    • server.address - Address of the server hosting the LLM
    • server.port - Port number used by the server
    • error.type
  • metrics
  • streaming - GenAI (LLM): how to capture streaming #1170
@lmolkova lmolkova converted this from a draft issue Mar 12, 2024
@lmolkova lmolkova changed the title Initial PR with essential attributes, including a vendor-specific example, and basic event definitions LLM: initial semconv definition Mar 12, 2024
@lmolkova
Copy link
Contributor Author

Closing as almost everything is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants