♊️ GemiNews 🗞️
(dev)
🏡
📰 Articles
🏷️ Tags
🧠 Queries
📈 Graphs
☁️ Stats
💁🏻 Assistant
💬
🎙️
Demo 1: Embeddings + Recommendation
Demo 2: Bella RAGa
Demo 3: NewRetriever
Demo 4: Assistant function calling
Editing article
Title
Summary
Content
<p>Google Cloud recently announced that <a href="https://www.anthropic.com/news/claude-3-family">Anthropic’s Claude 3 Models</a> will be available on Google Cloud (Sonnet and Haiku for now), and Opus will be added in coming weeks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GTJap7mGMYHggm-I-NUxnQ.png" /></figure><h3>What is Claude 3?</h3><p>Claude 3 comes with 3 state-of-the-art models: Opus, Sonnet and Haiku.</p><p><strong>Opus:</strong> Excels in complex tasks understanding new situations with impressive human-like ability. It pushes the boundaries of what AI can do.</p><p><strong>Sonnet:</strong> Balances performance and cost, well-suited for businesses needing fast and reliable performance.</p><p><strong>Haiku: </strong>Super fast and small, giving lightning quick answers to questions. This lets you create AI that feels like talking to a real person.</p><h3><strong>Comparison of the Claude 3 models with GPT and Gemini Models.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DhSMUYbSBL-rnZT0" /></figure><h3><strong>Cost Comparison between 3 Models:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XhCvOEiuCnbnyUlr" /></figure><h3><strong>How to get started?</strong></h3><ol><li>Go to Model Garden tab in Vertex AI for <a href="https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-sonnet">Sonnet</a> or <a href="https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-haiku">Haiku</a></li><li>Click on Enable, Fill the basic details about your Organization or just about your self.</li><li>Once Step 2 is done, wait for 2–3 minutes to get the model enabled.</li><li>You can now view the code for interacting with Claude 3 models. It has a lot of examples like Text input, Image input, Streaming responses, Calling via API, Calling via SDK.</li></ol><h3>Steps Interact with Claude 3 using SDK</h3><pre>!pip3 install anthropic[vertex]</pre><pre>MODEL = "claude-3-sonnet@20240229" #for Haiku claude-3-haiku@20240307<br>REGION = "us-central1"<br>PROJECT_ID = "[your-project-id]"<br><br>import vertexai<br>import json<br>vertexai.init(project=PROJECT_ID, location=REGION)</pre><h3>1. Text Input</h3><pre>from anthropic import AnthropicVertex<br><br>client = AnthropicVertex(region=REGION, project_id=PROJECT_ID)<br>message = client.messages.create(<br> max_tokens=1024,<br> messages=[<br> {<br> "role": "user",<br> "content": "Send me a recipe for Pizza.",<br> }<br> ],<br> model=MODEL,<br>)<br>data = json.loads(message.model_dump_json(indent=2))["content"][0]<br>print(data["text"])</pre><p><strong>Query: </strong>Send me a recipe for Pizza.</p><p><strong>Response:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*fqH4D2F-_EMrsXMk3MSvVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7E7aEVYYScPmxMKxEhbYQ.png" /></figure><h3>2. Single Image Input</h3><p><strong>Image Used:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lnsWMpIz61oidGEiqgktZg.jpeg" /><figcaption>Image 1</figcaption></figure><pre>import base64<br><br>import httpx<br>from anthropic import AnthropicVertex<br><br>client = AnthropicVertex(region=REGION, project_id=PROJECT_ID)<br><br>image1_url = "https://cache.getarchive.net/Prod/thumb/cdn12/L3Bob3RvLzIwMTYvMTIvMzEvdHJhZmZpYy1qYW0tdHJhZmZpYy1pbmRpYS10cmFuc3BvcnRhdGlvbi10cmFmZmljLTFlNDJiZi0xMDI0LmpwZw%3D%3D/1280/720/jpg"<br>image1_media_type = "image/jpeg"<br>image1_data = base64.b64encode(httpx.get(image1_url).content).decode("utf-8")<br><br><br>message = client.messages.create(<br> max_tokens=1024,<br> messages=[<br> {<br> "role": "user",<br> "content": [<br> {<br> "type": "image",<br> "source": {<br> "type": "base64",<br> "media_type": image1_media_type,<br> "data": image1_data,<br> },<br> },<br> {"type": "text", "text": "Describe the image and get the location and weather."},<br> ],<br> }<br> ],<br> model=MODEL,<br>)<br>data = json.loads(message.model_dump_json(indent=2))["content"][0]<br>print(data["text"])</pre><p><strong>Query: </strong>Describe the image and get the location and weather.</p><p><strong>Response:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*TkPjrrUhBYFkrKUlgH2y_Q.png" /></figure><h3>3. Multi Image Input:</h3><p><strong>Images Used:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E2Nc-I6HA6Qyvu1G" /><figcaption>Image 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YPtg3Jiw3HEx8I88" /><figcaption>Image 2</figcaption></figure><pre>import base64<br><br>import httpx<br>from anthropic import AnthropicVertex<br><br>client = AnthropicVertex(region=REGION, project_id=PROJECT_ID)<br><br>image1_url = "https://parkplus.io/_next/image?url=https%3A%2F%2Fstrapi-file-uploads.s3.ap-south-1.amazonaws.com%2Fopen_top_cars_2da902c4b3.jpg&w=1920&q=75"<br>image2_url = "https://images.pexels.com/photos/3817871/pexels-photo-3817871.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2"<br>image1_media_type = "image/jpeg"<br>image1_data = base64.b64encode(httpx.get(image1_url).content).decode("utf-8")<br>image2_data = base64.b64encode(httpx.get(image2_url).content).decode("utf-8")<br><br><br>message = client.messages.create(<br> max_tokens=1024,<br> messages=[<br> {<br> "role": "user",<br> "content": [<br> {<br> "type": "image",<br> "source": {<br> "type": "base64",<br> "media_type": image1_media_type,<br> "data": image1_data,<br> },<br> },<br> {<br> "type": "image",<br> "source": {<br> "type": "base64",<br> "media_type": image1_media_type,<br> "data": image2_data,<br> },<br> },<br> {"type": "text", "text": "What are the similarities and differences between these two images"},<br> ],<br> }<br> ],<br> model=MODEL,<br>)<br>data = json.loads(message.model_dump_json(indent=2))["content"][0]<br>print(data["text"])</pre><p><strong>Query: </strong>What are the similarities and differences between these two images</p><p><strong>Response:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*ZiFv1QIZDyJcQbCSXyVTaQ.png" /></figure><h3>Conclusion:</h3><p>Claude 3 has Capabilities like:</p><ol><li>Performing complex cognitive tasks.</li><li>Transcribing and analyzing static images.</li><li>Code generation</li><li>Translating between various languages in real-time.</li><li>Offers models with combination of speed and performance depending upon the use case.</li><li>It is Secure, Capable and Reliable.</li></ol><h3>If you liked this post, please Clap for it. Follow me if you want to read more such posts!</h3><h3>Twitter: <a href="https://twitter.com/IVaibhavMalpani">https://twitter.com/IVaibhavMalpani</a><br>LinkedIn: <a href="https://www.linkedin.com/in/ivaibhavmalpani/">https://www.linkedin.com/in/ivaibhavmalpani/</a></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20c65b308f01" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/claude-3-on-google-cloud-20c65b308f01">Getting Started with Claude 3 on Google Cloud</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>
Author
Link
Published date
Image url
Feed url
Guid
Hidden blurb
--- !ruby/object:Feedjira::Parser::RSSEntry title: Getting Started with Claude 3 on Google Cloud url: https://medium.com/google-cloud/claude-3-on-google-cloud-20c65b308f01?source=rss----e52cf94d98af---4 author: Vaibhav Malpani categories: - anthropic-claude - multimodal - generative-ai - gemini - google-cloud-platform published: 2024-04-01 04:11:36.000000000 Z entry_id: !ruby/object:Feedjira::Parser::GloballyUniqueIdentifier is_perma_link: 'false' guid: https://medium.com/p/20c65b308f01 carlessian_info: news_filer_version: 2 newspaper: Google Cloud - Medium macro_region: Blogs rss_fields: - title - url - author - categories - published - entry_id - content content: '<p>Google Cloud recently announced that <a href="https://www.anthropic.com/news/claude-3-family">Anthropic’s Claude 3 Models</a> will be available on Google Cloud (Sonnet and Haiku for now), and Opus will be added in coming weeks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GTJap7mGMYHggm-I-NUxnQ.png" /></figure><h3>What is Claude 3?</h3><p>Claude 3 comes with 3 state-of-the-art models: Opus, Sonnet and Haiku.</p><p><strong>Opus:</strong> Excels in complex tasks understanding new situations with impressive human-like ability. It pushes the boundaries of what AI can do.</p><p><strong>Sonnet:</strong> Balances performance and cost, well-suited for businesses needing fast and reliable performance.</p><p><strong>Haiku: </strong>Super fast and small, giving lightning quick answers to questions. This lets you create AI that feels like talking to a real person.</p><h3><strong>Comparison of the Claude 3 models with GPT and Gemini Models.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DhSMUYbSBL-rnZT0" /></figure><h3><strong>Cost Comparison between 3 Models:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XhCvOEiuCnbnyUlr" /></figure><h3><strong>How to get started?</strong></h3><ol><li>Go to Model Garden tab in Vertex AI for <a href="https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-sonnet">Sonnet</a> or <a href="https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-haiku">Haiku</a></li><li>Click on Enable, Fill the basic details about your Organization or just about your self.</li><li>Once Step 2 is done, wait for 2–3 minutes to get the model enabled.</li><li>You can now view the code for interacting with Claude 3 models. It has a lot of examples like Text input, Image input, Streaming responses, Calling via API, Calling via SDK.</li></ol><h3>Steps Interact with Claude 3 using SDK</h3><pre>!pip3 install anthropic[vertex]</pre><pre>MODEL = "claude-3-sonnet@20240229" #for Haiku claude-3-haiku@20240307<br>REGION = "us-central1"<br>PROJECT_ID = "[your-project-id]"<br><br>import vertexai<br>import json<br>vertexai.init(project=PROJECT_ID, location=REGION)</pre><h3>1. Text Input</h3><pre>from anthropic import AnthropicVertex<br><br>client = AnthropicVertex(region=REGION, project_id=PROJECT_ID)<br>message = client.messages.create(<br> max_tokens=1024,<br> messages=[<br> {<br> "role": "user",<br> "content": "Send me a recipe for Pizza.",<br> }<br> ],<br> model=MODEL,<br>)<br>data = json.loads(message.model_dump_json(indent=2))["content"][0]<br>print(data["text"])</pre><p><strong>Query: </strong>Send me a recipe for Pizza.</p><p><strong>Response:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*fqH4D2F-_EMrsXMk3MSvVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7E7aEVYYScPmxMKxEhbYQ.png" /></figure><h3>2. Single Image Input</h3><p><strong>Image Used:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lnsWMpIz61oidGEiqgktZg.jpeg" /><figcaption>Image 1</figcaption></figure><pre>import base64<br><br>import httpx<br>from anthropic import AnthropicVertex<br><br>client = AnthropicVertex(region=REGION, project_id=PROJECT_ID)<br><br>image1_url = "https://cache.getarchive.net/Prod/thumb/cdn12/L3Bob3RvLzIwMTYvMTIvMzEvdHJhZmZpYy1qYW0tdHJhZmZpYy1pbmRpYS10cmFuc3BvcnRhdGlvbi10cmFmZmljLTFlNDJiZi0xMDI0LmpwZw%3D%3D/1280/720/jpg"<br>image1_media_type = "image/jpeg"<br>image1_data = base64.b64encode(httpx.get(image1_url).content).decode("utf-8")<br><br><br>message = client.messages.create(<br> max_tokens=1024,<br> messages=[<br> {<br> "role": "user",<br> "content": [<br> {<br> "type": "image",<br> "source": {<br> "type": "base64",<br> "media_type": image1_media_type,<br> "data": image1_data,<br> },<br> },<br> {"type": "text", "text": "Describe the image and get the location and weather."},<br> ],<br> }<br> ],<br> model=MODEL,<br>)<br>data = json.loads(message.model_dump_json(indent=2))["content"][0]<br>print(data["text"])</pre><p><strong>Query: </strong>Describe the image and get the location and weather.</p><p><strong>Response:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*TkPjrrUhBYFkrKUlgH2y_Q.png" /></figure><h3>3. Multi Image Input:</h3><p><strong>Images Used:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E2Nc-I6HA6Qyvu1G" /><figcaption>Image 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YPtg3Jiw3HEx8I88" /><figcaption>Image 2</figcaption></figure><pre>import base64<br><br>import httpx<br>from anthropic import AnthropicVertex<br><br>client = AnthropicVertex(region=REGION, project_id=PROJECT_ID)<br><br>image1_url = "https://parkplus.io/_next/image?url=https%3A%2F%2Fstrapi-file-uploads.s3.ap-south-1.amazonaws.com%2Fopen_top_cars_2da902c4b3.jpg&w=1920&q=75"<br>image2_url = "https://images.pexels.com/photos/3817871/pexels-photo-3817871.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2"<br>image1_media_type = "image/jpeg"<br>image1_data = base64.b64encode(httpx.get(image1_url).content).decode("utf-8")<br>image2_data = base64.b64encode(httpx.get(image2_url).content).decode("utf-8")<br><br><br>message = client.messages.create(<br> max_tokens=1024,<br> messages=[<br> {<br> "role": "user",<br> "content": [<br> {<br> "type": "image",<br> "source": {<br> "type": "base64",<br> "media_type": image1_media_type,<br> "data": image1_data,<br> },<br> },<br> {<br> "type": "image",<br> "source": {<br> "type": "base64",<br> "media_type": image1_media_type,<br> "data": image2_data,<br> },<br> },<br> {"type": "text", "text": "What are the similarities and differences between these two images"},<br> ],<br> }<br> ],<br> model=MODEL,<br>)<br>data = json.loads(message.model_dump_json(indent=2))["content"][0]<br>print(data["text"])</pre><p><strong>Query: </strong>What are the similarities and differences between these two images</p><p><strong>Response:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*ZiFv1QIZDyJcQbCSXyVTaQ.png" /></figure><h3>Conclusion:</h3><p>Claude 3 has Capabilities like:</p><ol><li>Performing complex cognitive tasks.</li><li>Transcribing and analyzing static images.</li><li>Code generation</li><li>Translating between various languages in real-time.</li><li>Offers models with combination of speed and performance depending upon the use case.</li><li>It is Secure, Capable and Reliable.</li></ol><h3>If you liked this post, please Clap for it. Follow me if you want to read more such posts!</h3><h3>Twitter: <a href="https://twitter.com/IVaibhavMalpani">https://twitter.com/IVaibhavMalpani</a><br>LinkedIn: <a href="https://www.linkedin.com/in/ivaibhavmalpani/">https://www.linkedin.com/in/ivaibhavmalpani/</a></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20c65b308f01" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/claude-3-on-google-cloud-20c65b308f01">Getting Started with Claude 3 on Google Cloud</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>'
Language
Active
Ricc internal notes
Imported via /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/import-feedjira.rb on 2024-04-01 08:40:10 +0200. Content is EMPTY here. Entried: title,url,author,categories,published,entry_id,content. TODO add Newspaper: filename = /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/../../../crawler/out/feedjira/Blogs/Google Cloud - Medium/2024-04-01-Getting_Started_with_Claude_3_on_Google_Cloud-v2.yaml
Ricc source
Show this article
Back to articles