Skip to content

Instantly share code, notes, and snippets.

@praise2112
Last active October 16, 2025 14:16
Show Gist options
  • Select an option

  • Save praise2112/47a192707040c70967e23fb71a993f76 to your computer and use it in GitHub Desktop.

Select an option

Save praise2112/47a192707040c70967e23fb71a993f76 to your computer and use it in GitHub Desktop.
from litellm import completion
# REQUIRES: AWS_BEARER_TOKEN_BEDROCK ENV varaible
# List of Modela and their names here: https://eu-west-3.console.aws.amazon.com/bedrock/home?region=eu-west-3#/model-catalog
# The global. prefix for the model name is required
def main():
response = completion(
model="bedrock/global.anthropic.claude-sonnet-4-5-20250929-v1:0",
messages=[
{
"role": "user",
"content": "Explain the theory of relativity in simple terms.",
}
],
max_tokens=100,
)
print(response)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment