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

feat: set up gen ai inference attributes for foundational text models… #1

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

liustve
Copy link
Owner

@liustve liustve commented Nov 1, 2024

… (aws-observability#111)

Description of changes:
Adding auto-instrumentation support for GenAI inference parameters.

The following foundational text models are supported:

  • AI21 Jamba
  • Amazon Titan
  • Anthropic Claude
  • Cohere Command
  • Meta Llama
  • Mistral AI

Full list can be found
here. Note, we do not support Stability AI models at this time since they are focused on text to image.

New inference parameter attributes added according to OpenTelemetry Semantic Conventions for GenAI
attributes
:

  • gen_ai.request.max_tokens
  • gen_ai.request.temperature
  • gen_ai.request.top_p
  • gen_ai.response.finish_reasons
  • gen_ai.usage.input_tokens
  • gen_ai.usage.output_tokens

Test Plan:
Set up sample app to make Bedrock Runtime InvokeModel API calls to the supported foundational models and verified the auto-instrumentation attributes.

ai21-jamba

amazon-titan

anthropic-claude

cohere-command

meta-llama

mistral-ai

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…#111)

*Description of changes:*
Adding auto-instrumentation support for GenAI inference parameters. 

The following foundational text models are supported:
- AI21 Jamba
- Amazon Titan
- Anthropic Claude
- Cohere Command
- Meta Llama
- Mistral AI

Full list can be found
[here](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
Note, we do not support Stability AI models at this time since they are
focused on text to image.

New inference parameter attributes added according to OpenTelemetry
Semantic Conventions for [GenAI
attributes](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md#genai-attributes):
- `gen_ai.request.max_tokens`
- `gen_ai.request.temperature`
- `gen_ai.request.top_p`
- `gen_ai.response.finish_reasons`
- `gen_ai.usage.input_tokens`
- `gen_ai.usage.output_tokens`

*Test Plan:*
Set up sample app to make Bedrock Runtime `InvokeModel` API calls to the
supported foundational models and verified the auto-instrumentation
attributes.


![ai21-jamba](https://github.com/user-attachments/assets/83ef736c-5a49-41ce-951d-cc1d04ed92a8)

![amazon-titan](https://github.com/user-attachments/assets/bcd7d6b0-207f-43e6-aae8-13d99532be53)

![anthropic-claude](https://github.com/user-attachments/assets/747409e5-5cb6-489a-81c5-1d8299cee5c5)

![cohere-command](https://github.com/user-attachments/assets/b2f726d4-e053-4762-9d96-f187c549fe90)

![meta-llama](https://github.com/user-attachments/assets/5b982aa1-6ef4-4c65-a58a-d2c24cb57777)

![mistral-ai](https://github.com/user-attachments/assets/9a01df6f-27b6-43b3-94cf-6731686e495e)



By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
@liustve liustve merged commit 7e70a46 into liustve:main Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants