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

Open
4 of 8 tasks
lmolkova opened this issue Mar 12, 2024 · 0 comments
Open
4 of 8 tasks

LLM: initial semconv definition #810

lmolkova opened this issue Mar 12, 2024 · 0 comments

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
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants