Writer Palmyra X5 And X4 Foundation Models Are Now Available In Amazon Bedrock

One thing we’ve witnessed in recent months is the expansion of context windows in foundation models (FMs), with many now handling sequence lengths that would have been unimaginable just a year ago. However, building AI-powered applications that can process vast amounts of information while maintaining the reliability and security standards required for enterprise use remains challenging.
For these reasons, we’re excited to announce that Writer Palmyra X5 and X4 models are available today in Amazon Bedrock as a fully managed, serverless offering. AWS is the first major cloud provider to deliver fully managed models from Writer. Palmyra X5 is a new model launched today by Writer. Palmyra X4 was previously available in Amazon Bedrock Marketplace.
Writer Palmyra models offer robust reasoning capabilities that support complex agent-based workflows while maintaining enterprise security standards and reliability. Palmyra X5 features a one million token context window, and Palmyra X4 supports a 128K token context window. With these extensive context windows, these models remove some of the traditional constraints for app and agent development, enabling deeper analysis and more comprehensive task completion.
With this launch, Amazon Bedrock continues to bring access to the most advanced models and the tools you need to build generative AI applications with security, privacy, and responsible AI.
As a pioneer in FM development, Writer trains and fine-tunes its industry leading models on Amazon SageMaker HyperPod. With its optimized distributed training environment, Writer reduces training time and brings its models to market faster.
Palmyra X5 and X4 use cases
Writer Palmyra X5 and X4 are designed specifically for enterprise use cases, combining powerful capabilities with stringent security measures, including System and Organization Controls (SOC) 2, Payment Card Industry Data Security Standard (PCI DSS), and Health Insurance Portability and Accountability Act (HIPAA) compliance certifications.
Palmyra X5 and X4 models excel in various enterprise use cases across multiple industries:
Financial services – Palmyra models power solutions across investment banking and asset and wealth management, including deal transaction support, 10-Q, 10-K and earnings transcript highlights, fund and market research, and personalized client outreach at scale.
Healthcare and life science – Payors and providers use Palmyra models to build solutions for member acquisition and onboarding, appeals and grievances, case and utilization management, and employer request for proposal (RFP) response. Pharmaceutical companies use these models for commercial applications, medical affairs, R&D, and clinical trials.
Retail and consumer goods – Palmyra models enable AI solutions for product description creation and variation, performance analysis, SEO updates, brand and compliance reviews, automated campaign workflows, and RFP analysis and response.
Technology – Companies across the technology sector implement Palmyra models for personalized and account-based marketing, content creation, campaign workflow automation, account preparation and research, knowledge support, job briefs and candidate reports, and RFP responses.
Palmyra models support a comprehensive suite of enterprise-grade capabilities, including:
Adaptive thinking – Hybrid models combining advanced reasoning with enterprise-grade reliability, excelling at complex problem-solving and sophisticated decision-making processes.
Multistep tool-calling – Support for advanced tool-calling capabilities that can be used in complex multistep workflows and agentic actions, including interaction with enterprise systems to perform tasks like updating systems, executing transactions, sending emails, and triggering workflows.
Enterprise-grade reliability – Consistent, accurate results while maintaining strict quality standards required for enterprise use, with models specifically trained on business content to align outputs with professional standards.
Using Palmyra X5 and X4 in Amazon Bedrock
As for all new serverless models in Amazon Bedrock, I need to request access first. In the Amazon Bedrock console, I choose Model access from the navigation pane to enable access to Palmyra X5 and Palmyra X4 models.
When I have access to the models, I can start building applications with any AWS SDKs using the Amazon Bedrock Converse API. The models use cross-Region inference with these inference profiles:
- For Palmyra X5:
us.writer.palmyra-x5-v1:0
- For Palmyra X4:
us.writer.palmyra-x4-v1:0
Here’s a sample implementation with the AWS SDK for Python (Boto3). In this scenario, there is a new version of an existing product. I need to prepare a detailed comparison of what’s new. I have the old and new product manuals. I use the large input context of Palmyra X5 to read and compare the two versions of the manual and prepare a first draft of the comparison document.
import sys
import os
import boto3
import re
AWS_REGION = "us-west-2"
MODEL_ID = "us.writer.palmyra-x5-v1:0"
DEFAULT_OUTPUT_FILE = "product_comparison.md"
def create_bedrock_runtime_client(region: str = AWS_REGION):
"""Create and return a Bedrock client."""
return boto3.client('bedrock-runtime', region_name=region)
def get_file_extension(filename: str) -> str:
"""Get the file extension."""
return os.path.splitext(filename)[1].lower()[1:] or 'txt'
def sanitize_document_name(filename: str) -> str:
"""Sanitize document name."""
# Remove extension and get base name
name = os.path.splitext(filename)[0]
# Replace invalid characters with space
name = re.sub(r'[^a-zA-Z0-9\s\-\(\)\[\]]', ' ', name)
# Replace multiple spaces with single space
name = re.sub(r'\s+', ' ', name)
# Strip leading/trailing spaces
return name.strip()
def read_file(file_path: str) -> bytes:
"""Read a file in binary mode."""
try:
with open(file_path, 'rb') as file:
return file.read()
except Exception as e:
raise Exception(f"Error reading file {file_path}: {str(e)}")
def generate_comparison(client, document1: bytes, document2: bytes, filename1: str, filename2: str) -> str:
"""Generate a markdown comparison of two product manuals."""
print(f"Generating comparison for {filename1} and {filename2}")
try:
response = client.converse(
modelId=MODEL_ID,
messages=[
{
"role": "user",
"content": [
{
"text": "Please compare these two product manuals and create a detailed comparison in markdown format. Focus on comparing key features, specifications, and highlight the main differences between the products."
},
{
"document": {
"format": get_file_extension(filename1),
"name": sanitize_document_name(filename1),
"source": {
"bytes": document1
}
}
},
{
"document": {
"format": get_file_extension(filename2),
"name": sanitize_document_name(filename2),
"source": {
"bytes": document2
}
}
}
]
}
]
)
return response['output']['message']['content'][0]['text']
except Exception as e:
raise Exception(f"Error generating comparison: {str(e)}")
def main():
if len(sys.argv) < 3 or len(sys.argv) > 4:
cmd = sys.argv[0]
print(f"Usage: {cmd} <manual1_path> <manual2_path> [output_file]")
sys.exit(1)
manual1_path = sys.argv[1]
manual2_path = sys.argv[2]
output_file = sys.argv[3] if len(sys.argv) == 4 else DEFAULT_OUTPUT_FILE
paths = [manual1_path, manual2_path]
# Check each file's existence
for path in paths:
if not os.path.exists(path):
print(f"Error: File does not exist: {path}")
sys.exit(1)
try:
# Create Bedrock client
bedrock_runtime = create_bedrock_runtime_client()
# Read both manuals
print("Reading documents...")
manual1_content = read_file(manual1_path)
manual2_content = read_file(manual2_path)
# Generate comparison directly from the documents
print("Generating comparison...")
comparison = generate_comparison(
bedrock_runtime,
manual1_content,
manual2_content,
os.path.basename(manual1_path),
os.path.basename(manual2_path)
)
# Save comparison to file
with open(output_file, 'w') as f:
f.write(comparison)
print(f"Comparison generated successfully! Saved to {output_file}")
except Exception as e:
print(f"Error: {str(e)}")
sys.exit(1)
if __name__ == "__main__":
main()
To learn how to use Amazon Bedrock with AWS SDKs, browse the code samples in the Amazon Bedrock User Guide.
Things to know
Writer Palmyra X5 and X4 models are available in Amazon Bedrock today in the US West (Oregon) AWS Region with cross-Region inference. For the most up-to-date information on model support by Region, refer to the Amazon Bedrock documentation. For information on pricing, visit Amazon Bedrock pricing.
These models support English, Spanish, French, German, Chinese, and multiple other languages, making them suitable for global enterprise applications.
Using the expansive context capabilities of these models, developers can build more sophisticated applications and agents that can process extensive documents, perform complex multistep reasoning, and handle sophisticated agentic workflows.
To start using Writer Palmyra X5 and X4 models today, visit the Writer model section in the Amazon Bedrock User Guide. You can also explore how our Builder communities are using Amazon Bedrock in their solutions in the generative AI section of our community.aws site.
Let us know what you build with these powerful new capabilities!
— Danilo
How is the News Blog doing? Take this 1 minute survey!
(This survey is hosted by an external company. AWS handles your information as described in the AWS Privacy Notice. AWS will own the data gathered via this survey and will not share the information collected with survey respondents.)