<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ferris Argyle on Medium]]></title>
        <description><![CDATA[Stories by Ferris Argyle on Medium]]></description>
        <link>https://medium.com/@fargyle?source=rss-79ad99492546------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hmJw9yvLagPFo7qr</url>
            <title>Stories by Ferris Argyle on Medium</title>
            <link>https://medium.com/@fargyle?source=rss-79ad99492546------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:11:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fargyle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Vertex AI Generative AI / Large Language Model Trust]]></title>
            <link>https://medium.com/google-cloud/vertex-ai-generative-ai-large-language-model-trust-f206aae1a014?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/f206aae1a014</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[responsible-ai]]></category>
            <category><![CDATA[generative-ai]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Wed, 16 Oct 2024 02:58:47 GMT</pubDate>
            <atom:updated>2024-10-16T15:35:11.168Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Compliance, IP, Bias, Accuracy, SLAs, Terms of Service</h4><h3>Introduction</h3><p>One of the significant advantages of Google Cloud’s Generative AI and LLM support is that it is built by Google Cloud and embedded in <a href="https://cloud.google.com/vertex-ai">Vertex AI</a> (as well as <a href="https://workspace.google.com/">Workspace</a>), so you can interact with, customize, and embed foundation models into your applications, no ML expertise required; you can access over 150 foundation models on <a href="https://cloud.google.com/model-garden">Model Garden,</a> tune models via a simple UI in <a href="https://cloud.google.com/generative-ai-studio">Vertex AI Studio</a>, or use models directly in a data science notebook.</p><p>However, this does also mean that the answers to many questions about compliance, IP, bias, terms of service, etc. are distributed in existing (and in some cases, new) documentation. This article seeks to pull these answers together into one spot as a reference; refer to the source materials for the most current and accurate information.</p><h4>Disclaimer</h4><p>It’s particularly important to emphasize for this article that these are my personal writings; the views expressed in these pages are mine alone and not those of my employer, Google, though they do quote extensively from Google sources. In fact, the majority of the content is quoted from Google sources; for readability, quotation marks are omitted in most cases.</p><h3>Preamble</h3><p>Google was one of the first in the industry to publish an <a href="https://cloud.google.com/blog/products/ai-machine-learning/google-cloud-unveils-ai-and-ml-privacy-commitment">AI/ML Privacy Commitment</a> (in 2020), which outlines Google’s belief that customers should have the highest level of security and control over their data that is stored in the cloud. That commitment extends to Google Cloud generative AI products.</p><p>Google Cloud Generative AI products are subject to the standard <a href="https://cloud.google.com/terms">Google Cloud terms</a> once they’re GA:</p><ul><li>5.2 <em>Protection of Customer Data.</em> Google will only access, use, and otherwise process Customer Data in accordance with the Cloud Data Processing Addendum and will not access, use, or process Customer Data for any other purpose. Google has implemented and will maintain technical, organizational, and physical measures to protect Customer Data, as further described in the Cloud Data Processing Addendum.</li></ul><p>… as well as to the <a href="https://cloud.google.com/terms/service-terms#:~:text=19.-,Generative%20AI%20Services,-.">Generative AI service-specific terms</a> and <a href="https://policies.google.com/terms/generative-ai/use-policy">Generative AI prohibited use policy</a>.</p><h4>Definitions</h4><p>Since the term “Gen AI” is at the beginning of a <a href="https://en.wikipedia.org/wiki/Gartner_hype_cycle">hype cycle</a> at the moment, it’s helpful to get a bit of grounding in what these terms actually mean.</p><p>My apologies to whichever source I’ve cribbed this from (contact me for attribution), but apparently I’ve changed it enough to stymie Google Search.</p><p><strong>Generative AI </strong>can be used to create images, video, and audio similar to the training data, in addition to the text which overlaps with the domain of LLMs.</p><p><strong>Large Language Models</strong> can be used for NLP tasks such as translation, summarization, and question answering which aren’t strictly generative.</p><p>That being said, many solutions will include both; for instance, a chatbot could apply LLMs to find information, and Generative AI to craft the responses.</p><p>Google Cloud includes Large Language Models under its Generative AI on Vertex AI brand.</p><h3>Foundation model pre-training data</h3><p>Gemini models are trained on a dataset that is both multimodal and multilingual. The pre-training dataset uses data from web documents, books, and code, and includes image, audio, and video data.</p><p>Google also applies quality filters to all datasets, using both heuristic rules and model-based classifiers. They also perform safety filtering to remove harmful content based on their policies.</p><p>Please refer to <a href="https://storage.googleapis.com/deepmind-media/gemini/gemini_1_report.pdf">Gemini: A Family of Highly Capable<br>Multimodal Models</a>.</p><h3>IP</h3><p>By default, Google Cloud doesn’t use customer data to train its foundation models; this includes prompts, responses, and any adapter model training data.</p><p>By default, customer data is stored in encrypted form and is encrypted in transit. Caching is optional and configurable by the customer depending on your latency requirements.</p><p>Please refer to <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance">Generative AI and data governance</a> for additional information.</p><p>Further, “Customer will have sole access to use Fine-Tuned Google Models and Google Customer-Trained Models. Neither Google nor any third party not authorized by Customer may access or use Fine-Tuned Google Models and Google Customer-Trained Models, including after expiration or termination of the Agreement.” Please refer to the Google Cloud <a href="https://cloud.google.com/terms/service-terms">Service Specific Terms</a>.</p><p>Please refer to <a href="https://services.google.com/fh/files/misc/adaptation_of_foundation_models_whitepaper_google_cloud.pdf">this whitepaper</a> to learn more about the design of adapter tuning on Vertex AI.</p><h3>Web IP</h3><p>Google <a href="https://blog.google/technology/ai/an-update-on-web-publisher-controls/">announced</a> <a href="https://developers.google.com/search/docs/crawling-indexing/google-common-crawlers#google-extended">Google-Extended</a>, a new control that web publishers can use to manage whether their sites help improve Gemini Apps and Vertex AI generative APIs, including future generations of models that power those products.</p><h3>Indemnity</h3><p>Google Cloud goes beyond the shared responsibility model of generative AI indemnification for training data used by Google for generative AI models in <em>all</em> its services, to a shared fate model underpinned by indemnity for output generated by customers using Google Cloud’s generative AI models. Please refer to the <a href="https://cloud.google.com/blog/products/ai-machine-learning/protecting-customers-with-generative-ai-indemnification">Shared fate: Protecting customers with generative AI indemnification announcement</a> for further details.</p><h3>Compliance</h3><p>Vertex AI (<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/compliance">including Generative AI</a>) <a href="https://cloud.google.com/vertex-ai/docs/general/vertexai-compliance">complies</a> with various SOC, ISO, IEC, HIPAA, and DSS standards.</p><p>More generally, Google Cloud has extensive <a href="https://cloud.google.com/security/compliance/offerings#/focusArea=Security">security</a> and <a href="https://cloud.google.com/security/compliance/offerings#/focusArea=Privacy">privacy</a> certifications from independent auditors who assessed Google Cloud services’ compliance practices in those domains. Refer to the “Services in Scope” section of the certification for service applicability.</p><p><strong>GDPR and EU AI Act</strong></p><p>Google Cloud has a long-standing commitment to <a href="https://cloud.google.com/privacy/gdpr">GDPR compliance</a>, and AI is no different. Google’s data processing agreements for Google Cloud clearly articulate its privacy commitment to customers. <a href="https://cloud.google.com/privacy/gdpr">Google Cloud specifically updated these terms to reflect the GDPR</a> to facilitate its customers’ compliance assessment and GDPR readiness when using Google Cloud services; please refer to the <a href="https://cloud.google.com/terms/data-processing-addendum">Cloud Data Processing Addendum</a>.</p><p>Google has been engaged from the earliest phases of the EU AI Act which came into force in August; Google submitted <a href="https://ec.europa.eu/info/law/better-regulation/have-your-say/initiatives/12527-Artificial-intelligence-ethical-and-legal-requirements/F2662492_en">comments</a> in July 2021 and also participated in the pre-proposal phase (<a href="https://www.blog.google/documents/77/Googles_submission_to_EC_AI_consultation_1.pdf">whitepaper consultation</a> and <a href="https://ec.europa.eu/info/law/better-regulation/have-your-say/initiatives/12527-Artificial-intelligence-ethical-and-legal-requirements/F550556_en">inception impact assessment</a>) to support the European Union’s effort to regulate AI. As Google’s CEO, Sundar Pichai, <a href="https://www.ft.com/content/8be1a975-e5e0-417d-af51-78af17ef4b79">said</a>, “AI is too important not to regulate, and too important not to regulate well.” To learn how Google Cloud is preparing for AI Act compliance and what Google Cloud customers can do to prepare for the AI Act, please refer to <a href="https://cloud.google.com/blog/products/identity-security/navigating-the-eu-ai-act-google-clouds-proactive-approach?e=48754805">Navigating the EU AI Act: Google Cloud’s proactive approach</a>.</p><h3>Data residency</h3><p>Customers who want to keep their data in a specified geographic location can take advantage of Google Cloud’s data residency capabilities. <a href="https://cloud.google.com/terms/data-residency">Google Cloud services with data residency</a>, including Generative AI on Vertex AI and Cloud Storage, allow the customer to store Customer Data at rest in their region of choice.</p><h4>Adapted models</h4><p>Through the addition of a minimal number of parameters (adapters), Parameter Efficient Fine Tuning (PEFT) helps foundational models adapt to specialized tasks by incorporating domain-specific or organization-internal data. These techniques enable tuning of the model with adapter weights that are specific to a particular task or domain at runtime without having to rebuild the entire foundation model.</p><p>Parameter Efficient Fine Tuning jobs run on Cloud TPUs/GPUs through Vertex AI’s training service. Vertex AI creates a separate tenant project for each customer project and runs the training workloads on Compute Engine VMs on the tenant project. Throughout the training process, user input data remains confined to the user’s storage bucket in the customer project, ensuring no external data transfer. Please refer to the <a href="https://services.google.com/fh/files/misc/adaptation_of_foundation_models_whitepaper_google_cloud.pdf">Adaptation of Large Foundation Models whitepaper</a> for a visual representation and further information.</p><h3>Data retention</h3><p>Data used by customers with Google’s Generative AI services is stored, protected and deleted as set forth in the <a href="https://cloud.google.com/terms/data-processing-addendum">Cloud Data Processing Addendum</a>.</p><p>Customers are able to delete adapters at any time. Temporary checkpoints generated in the tenant’s project bucket are subject to automatic deletion within a 30-day period, minimizing the risk of unauthorized access or unintended data retention. Please refer to the <a href="https://services.google.com/fh/files/misc/adaptation_of_foundation_models_whitepaper_google_cloud.pdf">Adaptation of Large Foundation Models whitepaper</a> for further information.</p><h3>Accuracy</h3><p>Gemini 1 Ultra’s performance exceeded state-of-the-art results at the time on 30 of the 32 widely-used academic benchmarks used in large language model (LLM) research and development.</p><p>With a score of 90.0%, Gemini Ultra was the first model to outperform human experts on <a href="https://arxiv.org/abs/2009.03300">MMLU</a> (massive multitask language understanding), which uses a combination of 57 subjects such as math, physics, history, law, medicine and ethics for testing both world knowledge and problem-solving abilities. Gemini uses its reasoning capabilities to think more carefully before answering difficult questions, leading to significant improvements over just using its first impression.</p><p>Gemini 1.5 built on this leadership; Gemini 1.5 Pro significantly outperformed Gemini 1 Ultra on most benchmarks, particularly for text and vision, while providing enhanced performance and deployability at scale. Please refer to the <a href="https://storage.googleapis.com/deepmind-media/gemini/gemini_v1_5_report.pdf">Gemini 1.5: Unlocking multimodal<br>understanding across millions of tokens of<br>context report</a>’s “Core Capability Evaluations” section for the comparison to prior Gemini versions, and <a href="https://deepmind.google/technologies/gemini/#:~:text=Relentless%20innovation">here</a> for comparison between Gemini 1.5 models.</p><p>That being said, Generative AI Services (as described at <a href="https://cloud.google.com/terms/services">https://cloud.google.com/terms/services</a>) use emerging technology, may provide inaccurate or offensive Generated Output, and are not designed for or intended to meet Customer’s regulatory, legal, or other obligations. Please see the <a href="https://cloud.google.com/terms/service-terms#:~:text=19.-,Generative%20AI%20Services,-.">Service Specific Term</a>s for further information.</p><h3>Bias</h3><p>Since 2018, <a href="https://ai.google/responsibility/principles/">Google’s AI Principles</a> have served as a living constitution; one of these principles is to avoid creating or reinforcing unfair bias. Please refer to Google Cloud’s resources on Responsible AI and content safety filters that are available <a href="https://cloud.google.com/vertex-ai/docs/generative-ai/learn/responsible-ai">in Cloud’s product documentation</a> and recommended <a href="https://ai.google/responsibility/responsible-ai-practices/">Responsible AI Practices</a>. Also see the <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance">Generative AI and data governance</a> resource.</p><p>PaLM 2 introduced multilingual toxicity classification capabilities; potential harms and biases across a range of potential downstream uses were evaluated. Please refer to the <a href="https://ai.google/static/documents/palm2techreport.pdf">PaLM 2 Technical Report</a>’s “Responsible AI” section for more details on the approach.</p><p>Gemini 1 built on this with evaluation against the the Winogender, Winobias, and Bias Benchmark in QA (BBQ) datasets. Accuracy scores close to 99% suggested that increased language model capabilities may also reduce representational harms. In addition to these datasets, Google monitors the average toxicity scores during the pre-training stage on Real Toxicity Prompts. Please refer to the <a href="https://storage.googleapis.com/deepmind-media/gemini/gemini_1_report.pdf">Gemini: A Family of Highly Capable<br>Multimodal Models</a> report’s “Representational harms” section for more details. Gemini 1.5 continued this approach; see <a href="https://storage.googleapis.com/deepmind-media/gemini/gemini_v1_5_report.pdf">that report</a>’s “Training for Safety, Security, and Responsibility” section.</p><h3>Terms of Service and SLAs</h3><p>Please refer to the <a href="https://cloud.google.com/terms/service-terms">Service Specific Terms</a>.</p><p>Note that pre-GA offerings are provided “as-is” without any express or implied warranties or representations of any kind… and…are not covered by any SLA or Google indemnity. — <a href="https://cloud.google.com/terms/service-terms">General Service Terms</a></p><p>The Vertex AI Platform SLAs are <a href="https://cloud.google.com/vertex-ai/sla">here</a>.</p><p>Google has a rigorous incident management process for security events that may affect the confidentiality, integrity, or availability of customer data. Please refer to the<a href="https://cloud.google.com/docs/security/incident-response"> Data incident response process</a></p><h3>What’s next</h3><p>Review how to <a href="https://medium.com/google-cloud/governing-vertex-ai-gen-ai-llm-model-access-via-quotas-19df2c53fccd">Govern Vertex AI Generative AI / Large Language Model Access With Quotas</a>.</p><p>Review the documentation:</p><ul><li><a href="https://cloud.google.com/blog/products/ai-machine-learning/google-cloud-unveils-ai-and-ml-privacy-commitment">AI/ML Privacy Commitment</a></li><li><a href="https://ai.google/responsibility/principles/">Google’s AI Principles</a></li><li><a href="https://blog.google/technology/ai/a-policy-agenda-for-responsible-ai-progress-opportunity-responsibility-security/">Google policy agenda for responsible AI progress</a></li><li><a href="https://cloud.google.com/vertex-ai/docs/general/vertexai-compliance">Vertex AI certifications</a></li><li><a href="https://cloud.google.com/terms/data-residency">Google Cloud services with data residency</a></li><li><a href="https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance">Generative AI and Data Governance</a></li><li><a href="https://cloud.google.com/vertex-ai/docs/release-notes">Vertex AI release notes</a></li><li><a href="https://cloud.google.com/terms/service-terms#:~:text=19.-,Generative%20AI%20Services,-.">Generative AI Service Specific Terms</a></li><li><a href="https://policies.google.com/terms/generative-ai/use-policy">Generative AI prohibited use policy</a></li><li><a href="https://ai.google/static/documents/palm2techreport.pdf">PaLM 2 Technical Report</a></li><li><a href="https://storage.googleapis.com/deepmind-media/gemini/gemini_1_report.pdf">Gemini: A Family of Highly Capable<br>Multimodal Models</a></li><li><a href="https://storage.googleapis.com/deepmind-media/gemini/gemini_v1_5_report.pdf">Gemini 1.5: Unlocking multimodal<br>understanding across millions of tokens of<br>context</a></li><li><a href="https://services.google.com/fh/files/misc/adaptation_of_foundation_models_whitepaper_google_cloud.pdf">Adaptation of Large Foundation Models whitepaper</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f206aae1a014" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/vertex-ai-generative-ai-large-language-model-trust-f206aae1a014">Vertex AI Generative AI / Large Language Model Trust</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>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generative AI (GenAI) and Large Language Models (LLM) Energy Data and Information Management Impact]]></title>
            <link>https://medium.com/google-cloud/generative-ai-genai-and-large-language-models-llm-energy-data-and-information-management-impact-918c6b56e1b3?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/918c6b56e1b3</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[data-management]]></category>
            <category><![CDATA[energy]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Fri, 27 Sep 2024 01:54:55 GMT</pubDate>
            <atom:updated>2024-09-29T17:16:59.024Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Potential to change these professions</h4><h3>Introduction</h3><p>It’s particularly important to emphasize for this article that these are my personal writings; the views expressed in these pages are mine alone and not those of my employer, Google.</p><p>This article is also a bit different from my usual articles; it’s based on an <a href="https://www.ecim.no/2023">ECIM</a> talk about a year ago, so will be more of a survey. Remarkably, the bulk of that talk has stood the test of time. The theme of the conference was “Disruption is our new normal — how does it affect us?”, and certainly Generative AI (GenAI) and Large Language Models (LLM) are one of the most potentially disruptive data and information management developments in recent memory.</p><h3>Definitions</h3><p>Since the term “Gen AI” is at the beginning of a <a href="https://en.wikipedia.org/wiki/Gartner_hype_cycle">hype cycle</a> at the moment, it’s helpful to get a bit of grounding in what these terms actually mean.</p><p>My apologies to whichever source I’ve cribbed this from (contact me for attribution), but apparently I’ve changed it enough to stymie Google Search.</p><p><strong>Generative AI </strong>can be used to create images, video, and audio similar to the training data, in addition to the text which overlaps with the domain of LLMs.</p><p><strong>Large Language Models</strong> can be used for NLP tasks such as translation, summarization, and question answering which aren’t strictly generative.</p><p>That being said, many solutions will include both; for instance, a chatbot could apply LLMs to find information, and Generative AI to craft the responses.</p><h3>Energy Use Cases</h3><p>Following are a few high level use cases for Generative AI and Large Language Models; I’ll expand on them through the lens of Data and Information Management as appropriate in the following section.</p><h4><strong>Generative AI</strong></h4><p><strong>Code Generation: </strong>SQL without the subject matter expertise has the potential to provide strongly grounded responses.</p><p><strong>Image generation: operational aspects of the energy industry. </strong>There are many operational aspects of the industry for which generating images can be helpful, from digital twins to health and safety.</p><p><strong>Synthetic data generation. </strong>One of the significant challenges of testing 3rd party applications, on which even the largest energy firms rely extensively, is how to do so in a way which respects proprietary data sensitivity.</p><h4>Large Language Models</h4><p><strong>Summarization.</strong> The energy industry is swimming in a sea of data about their assets, their processes, health and safety, and more; the challenge is turning information into knowledge, and knowledge into decisions.</p><p><strong>Question answering, particularly for unstructured data. </strong>This ties into the point above. The energy industry has huge volumes of data, including decades of scanned files that predate the digital era. Many of these files contain graphical and unstructured data which makes supervised AI model training particularly challenging given the scarcity of structured labeling and subject matter experts.</p><p><strong>Translation: JSON. </strong>This may more properly belong under the section above; I’ve included it here since it’s a means of making the data returned by Large Language Models processable by other systems.</p><h3>Data and Information Management Applicability</h3><h4>‘Analytics-ready’ Data</h4><p><strong>Human-readable results. </strong>As anyone who has worked with tools like Google Cloud’s <a href="https://cloud.google.com/document-ai?e=48754805">Document AI </a>knows, it produces machine readable results, including probabilities and positions; it actually requires a fair bit of post-processing to get to something human readable. Generative AI can interpret the key-value mapping aspects of these responses and render human intelligible results.</p><p><strong>Machine-readable results.</strong> Conversely, getting data from document tables into a format which is suitable for ingestion by other systems can be a challenge; Generative AI can assist here as well, automagically turning semi-structured text into JSON; the inherent variability of Generative AI can be mitigated by one-shot processing with examples.</p><h4>Data Automation and Data Quality</h4><p><strong>Labeling. </strong>One of the biggest challenges in the energy industry is decades of legacy information which has been “digitized”; this mostly consists of scanning it into PDFs, and it may still live on 8mm tapes. Generative AI has promise for low-shot labeling; however, predictive AI models can already provide great results with as few as 50 samples, and don’t suffer from some of the generative AI constraints mentioned elsewhere in this article.</p><p><strong>Synthetic data generation? </strong>I’m interested to see how this develops, since there is a strong need for synthetic data, and Generative AI is excellent at creating it. However, your synthetic data won’t create new information, and may decrease your signal to noise ratio due to training data in the foundation model which isn’t relevant to your use case; a promising use case is generating novel combinations of data which aren’t found in your sources… however, these may also be combinations which aren’t ever going to occur in real life due to physics or other constraints… think of it as combinatorial hallucination.</p><h4>Data Availability and Discovery</h4><p><strong>Code generation: SQL. </strong>If business intelligence tools such as <a href="https://cloud.google.com/looker">Looker</a> were the first generation of democratization of databases and queries, Generative AI’s ability to generate SQL from plain-English (or localization of your choice) text or speech input takes us to the Star Trek computer, with every end-user a Lieutenant Uhura. This is potentially one of the most powerful energy industry use cases because of its ability to provide deterministic answers and leverage existing data stores rather than re-ingest the data along with the prompt.</p><h4>Data Governance and Cost</h4><p>The flip side of democratization is shadow IT; some enterprises have governance concerns around the whole area of Generative AI and Large Language Models and wish to treat them differently than predictive AI.</p><p>Beginning with a foundation model, in most cases developed by a third party, appears to raise IP concerns which hadn’t been the case for analogous predecessors such as Google Cloud’s <a href="https://cloud.google.com/automl">AutoML</a>. Take this into account when transitioning from the experimental to production stage and budget the time to gain alignment on how <a href="https://services.google.com/fh/files/misc/adaptation_of_foundation_models_whitepaper_google_cloud.pdf">adapters such as those provided by Google Vertex AI</a> address these concerns.</p><p>Prompts introduce at least two threats:</p><ul><li>You can think of <strong>prompt injection</strong> as analogous to SQL injection, so in that sense not new, but harder to combat; there are numerous examples which demonstrate that with sufficient intent and skill, Generative AI and Large Language Models can be persuaded to skip their guardrails. We tend to see this concern more in the area of consumer-facing applications such as support chatbots.</li><li><strong>IP leakage</strong>. The real power of Generative AI and Large Language Models is in helping provide the knowledge to make decisions which are important to the business; this implies asking questions which are important to the business, and these are likely to contain confidential IP. Customer ownership of this IP, and not logging it, as provided for by Vertex AI, is an important first step. However, in production, prompts will be surfaced through an application; what does this application log? Who has access to the logs?</li></ul><p>As always, these risks increase the importance of fine-grained preventive, detective, and corrective controls. Think of prompts not so much as a field in an application, but as part of a data pipeline which will include measures such as Google Cloud’s <a href="https://cloud.google.com/security/products/sensitive-data-protection?e=48754805">Sensitive Data Protection API</a>, as well as leveraging tools such as the Gemini API’s <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters">safety filters and attributes</a>.</p><p><strong>Cost: </strong>As discussed below, though there’s a bit of a model size arms race, a smaller, more efficient model may in fact better suit your use case, in addition to being less costly.</p><p>AI-optimized processors such as <a href="https://cloud.google.com/tpu/?e=48754805">Google Cloud’s TPUs</a> can help manage training cost.</p><p>The biggest cost, other than training, is likely data storage, so consider this closely as part of your overall budget.</p><h3>Limitations and Considerations</h3><h4>Limitations</h4><p>Many of the limitations are related to the sheer amount of compute required to train and evaluate models.</p><p><strong>It’s early days. </strong>Compute availability is regionally constrained, and scaling is an omnipresent consideration: time and cost considerations for Generative AI and LLMs are a different order of magnitude from that with which the industry is familiar, even in the HPC realm. This is where right-sized models such as <a href="https://deepmind.google/technologies/gemini/flash/">Gemini Flash</a>, and highly optimized compute such as <a href="https://cloud.google.com/tpu/?e=48754805">Google Cloud TPUs</a> can help…which then brings us back to <a href="https://cloud.google.com/tpu/docs/regions-zones#asia-pacific">regional constraints</a>.</p><p><strong>Latency</strong> is a also a different order of magnitude than that to which users have become accustomed; I recall hearing targets of 200 microseconds as the acceptable threshold for internet SaaS latency as businesses transitioned from on-premise; Generative AI and LLM latency is often measured in seconds.</p><p><strong>Explainability. </strong>Businesses are driven by decisions; understanding why decisions are made in a certain way is key. Explainability methods such as Shapley, gradients, and decomposition have been developed for Predictive AI models, and yet, this level of statistical explanation can be challenging for businesses.</p><p>Now imagine explaining a result for the billions of parameters which are a defining characteristic of Generative AI and LLM… and in most cases the model will have been developed by a third party, and at most tuned by the business; this is the case even for open (in the Generative AI and LLM model context “open” often actually means portable) models such as <a href="https://blog.google/technology/developers/gemma-open-models/">Google’s Gemma models</a>. It’s indicative that Google’s <a href="https://ai.google.dev/responsible">Responsible Generative AI Toolkit</a>’s model evaluation is in fact a <a href="https://ai.google.dev/responsible/docs/evaluation#llm-comparator">Comparator</a> which evaluates the relative suitability of various models’ responses against a reference dataset.</p><p><strong>What’s old is new again. </strong>Every technology stands on the shoulders of those which went before. So, for instance, LLMs may leverage the underlying OCR capabilities of prior predictive AI and, for instance, exhibit the same label association characteristics as, in the Google Cloud case, <a href="https://cloud.google.com/document-ai?e=48754805">Document AI</a>.</p><h4>Considerations</h4><p>Related to the above point re. explainability, Generative AI and LLMs are <strong>non-deterministic</strong>, ie. results will vary even for the same inputs.</p><ul><li>Mitigation: set accuracy thresholds and test against them.</li></ul><p>The energy industry is largely about physics, and much of physics is arithmetic and statistics (we even have physics to thank for calculus). Large <strong>Language</strong> Models aren’t, which also brings me to a hobby horse of mine. <a href="https://en.wikipedia.org/wiki/Clarke%27s_three_laws">Clarke’s third law</a> is that any sufficiently advanced technology is indistinguishable from magic; to many, LLMs seem a lot like magic, and therefore may be capable of all kinds of things. But they’re not; they’re fundamentally semiotic rather than semantic engines, and therefore, numbers are symbols without a relation to number theory.</p><ul><li>Mitigation: force algorithmic and programmatic computation in your prompts and triangulate the responses. Consider whether one of the newer reasoning engines (or a spreadsheet) may be better suited to your use case.</li></ul><p><strong>Foundation model drift: </strong>models are constantly being improved; an improvement for the general use case may not be for yours. In addition, many aspects of the energy industry have evolved over decades; consistency and repeatability are often more important than accuracy.</p><ul><li>Mitigation: test for regression, and select models carefully and wisely.</li></ul><p><strong>Model size </strong>There’s a bit of a model size arms race: “more parameters are more better”. In addition to the explainability concern described above, more parameters imply more latency, all other factors being equal, and parameters extraneous to your use case exacerbate this.</p><p>A smaller and more efficient model may be better than a larger model for your use case.</p><h3>Potential to change the energy data and information management professions</h3><p>In conclusion, I’ll revisit the subtitle of this article; in addition to the democratization of AI alluded to earlier, Generative AI and Large Language Models have the potential to enable the processing of vasts swaths of data which were previously locked in de facto information silos. Both of these consequences will increase the importance of data and information management, while the first will fundamentally change the nature of the profession; in addition, prompts need to be considered as a fundamental aspect of the managed data. One thing which won’t change is the importance of training pipelines; while foundation models provide general purpose knowledge engines, adapters or their equivalent will be required for many enterprise models.</p><h3>Next Steps</h3><p>Review the documentation:</p><ul><li><a href="https://services.google.com/fh/files/misc/adaptation_of_foundation_models_whitepaper_google_cloud.pdf">Adaptation of Foundation Models Whitepaper</a></li><li><a href="https://cloud.google.com/automl">AutoML</a></li><li><a href="https://cloud.google.com/document-ai?e=48754805">Document AI</a></li><li><a href="https://deepmind.google/technologies/gemini/flash/">Gemini Flash</a></li><li><a href="https://blog.google/technology/developers/gemma-open-models/">Gemma models</a></li><li><a href="https://cloud.google.com/security/products/sensitive-data-protection?e=48754805">Sensitive Data Protection API</a></li><li><a href="https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters">Safety filters and attributes</a></li><li><a href="https://ai.google.dev/responsible">Responsible Generative AI Toolkit</a></li><li><a href="https://ai.google.dev/responsible/docs/evaluation#llm-comparator">Comparator</a></li><li><a href="https://cloud.google.com/tpu/?e=48754805">Google Cloud TPUs</a></li><li><a href="https://cloud.google.com/tpu/docs/regions-zones#asia-pacific">TPU regions and zones</a></li></ul><p>Review <a href="https://medium.com/google-cloud/governing-vertex-ai-gen-ai-llm-model-access-via-quotas-19df2c53fccd">this article</a> for some thoughts on predictive access controls; note that <a href="https://cloud.google.com/resource-manager/docs/organization-policy/creating-managing-custom-constraints#custom_constraints">custom constraints</a> have obviated the use of quotas for this purpose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=918c6b56e1b3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/generative-ai-genai-and-large-language-models-llm-energy-data-and-information-management-impact-918c6b56e1b3">Generative AI (GenAI) and Large Language Models (LLM) Energy Data and Information Management Impact</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>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mesop vs. low-code Google Cloud tools]]></title>
            <link>https://medium.com/google-cloud/mesop-vs-other-low-code-google-cloud-frameworks-640da44ca1ae?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/640da44ca1ae</guid>
            <category><![CDATA[mesop]]></category>
            <category><![CDATA[dialogflow]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[google-appsheet]]></category>
            <category><![CDATA[notebooklm]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Mon, 23 Sep 2024 01:11:02 GMT</pubDate>
            <atom:updated>2024-09-23T15:51:40.157Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Democratizing GenAI?</h4><p>I was glad to learn of Mesop recently from one of my colleagues looking for a low-code GenAI environment. One of the promises of GenAI was to democratize AI, and it does; but what happens when you need to build an application for your users to interact with the AI? <a href="https://google.github.io/mesop/">Mesop</a> goes some way towards answering this question.</p><p>However, it is a nuanced answer.</p><h3>Use case</h3><p>Mesop provides some unique chat state management capabilities which set it apart from other frameworks such as StreamLit, which is more focused on dashboards.</p><h3>Low code</h3><p>Mesop is still Python, so you might consider it low-code in the way in which <a href="https://jupyter.org/">Jupyter Notebooks</a> provide a low-code environment for data scientists. One of the benefits of GenAI is that tools such as <a href="https://cloud.google.com/products/gemini/code-assist">Gemini Code Assist</a> can significantly lower the coding burden of code-first environments, potentially enabling departmental power users.</p><h3>Server-side templating</h3><p>Though it does leverage Angular, Mesop is based on Python templating. One of my colleagues, Chad Brockman, reminded me why I stepped away from this approach and into the arms of Angular 1 many years ago: server-side templates don’t provide enough control, particularly when it comes to implementing client-side delegated auth. I’ve found historically that the edge cases (multi-page apps, auth) always forced me into rich client-side frameworks even for departmental apps, so Mesop’s primary use case today may be rapid prototyping.</p><p>It may be possible to embed Mesop into a webapp by packaging it as an npm similar to <a href="https://stackoverflow.com/questions/74731187/is-it-possible-to-embed-react-app-into-angularjs-1-x">this approach</a> to leverage it for the chat and AI components, while still benefiting from the extensibility of client-side frameworks.</p><h3>Google Cloud low-code alternatives</h3><h4>AppSheet</h4><p><a href="https://about.appsheet.com/home/">AppSheet</a>’s AI capabilities are quite constrained; IIRC it was originally a no-code environment.</p><p><a href="https://support.google.com/appsheet/answer/12857667?hl=en&amp;ref_topic=12849263&amp;sjid=14693522462231319466-NC">It appears</a> that chat apps are surfaced through Google Chat rather than through the <a href="https://support.google.com/appsheet/answer/11510510">App Gallery</a>; I expect that this implies that chat users would require <a href="https://workspace.google.com/pricing.html?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=na-US-all-en-dr-bkws-sitelink-all-trial-e-dr-1707446&amp;utm_content=text-ad-none-any-DEV_c-CRE_703749155170-ADGP_Hybrid+%7C+BKWS+-+MIX+%7C+Txt-G+Suite-Top-KWID_43700080377323853-kwd-967875257202&amp;utm_term=KW_google%20workspace%20pricing-ST_google+workspace+pricing&amp;gad_source=1&amp;gclid=Cj0KCQjwwO20BhCJARIsAAnTIVRXbluPFgTGjyO8BeO0GLeLKk55XsQoIom-gyi3KWhtQXl7s_zO0ygaAuUTEALw_wcB&amp;gclsrc=aw.ds">Workspace licenses</a>.</p><p><a href="https://www.googlecloudcommunity.com/gc/Tips-Tricks/Supercharge-AppSheet-using-Vertex-AI-amp-AppsScript-Demo-App-amp/m-p/769796">It appears</a> (also <a href="https://youtu.be/G13LD0PyfJY?t=300">here</a>) that Agent Builder integration would be <a href="https://support.google.com/appsheet/answer/11997142?hl=en">via Apps Script</a>, so it’s developer choice of whether Javascript is simpler than Python; because Mesop has the Gen AI primitives, Python would be my choice. I don’t think that <a href="https://support.google.com/appsheet/answer/11511244?sjid=4133222755533791185-NC">webhooks</a> support the required Auth to go direct.</p><p>AppSheet’s <a href="https://support.google.com/appsheet/answer/11447806?sjid=14693522462231319466-NC">document parsing only supports those types supported by DocAI</a>:</p><ul><li>Invoices</li><li>Receipts</li><li>W-9 forms</li></ul><p>I would consider AppSheet primarily for Workspace-centric apps.</p><h4>NotebookLM</h4><p><a href="https://notebooklm.google/">NotebookLM</a>, <a href="https://workspaceupdates.googleblog.com/2024/09/notebooklm-now-available-as-additional-service.html">recently graduated</a> from Labs to a Workspace additional service, is great at no-code RAG, but not so good at chat, and doesn’t provide an API.</p><p>It is now available as Workspace additional service.</p><p>Like AppSheet, I would consider this primarily for Workspace-centric apps.</p><h4>Dialogflow</h4><p><a href="https://cloud.google.com/dialogflow/cx/docs/concept/generative">DialogFlow</a> may be an option for implementing AI-enabled chat in a no-code way, depending on the degree of flexibility required.</p><h4>Application Integration</h4><p><a href="https://cloud.google.com/application-integration?e=48754805">Application Integration</a> is <a href="https://cloud.google.com/application-integration/docs/all-triggers-tasks">more about workflow</a> than UI; it’s not clear from the <a href="https://cloud.google.com/integration-connectors/docs/connectors/gsc_vertex_ai/configure#useintegr">docs</a> how well the Vertex AI connector will support chat use case.</p><ul><li>It does include <a href="https://cloud.google.com/integration-connectors/docs/connectors/gsc_google_drive/configure">Drive</a> and <a href="https://cloud.google.com/integration-connectors/docs/connectors/cloudstorage/configure">Cloud Storage</a> connectors</li></ul><h3>What’s next</h3><p>Read the following to learn more about the concepts and solution components described in this article:</p><ul><li><a href="https://google.github.io/mesop/">Mesop</a></li><li><a href="https://medium.com/google-cloud/did-google-just-kill-streamlit-76f719d9e275">Did Google Just Kill Streamlit?</a></li><li><a href="https://cloud.google.com/products/gemini/code-assist">Gemini Code Assist</a></li><li><a href="https://cloud.google.com/dialogflow/cx/docs/concept/generative">DialogFlow</a></li><li><a href="https://about.appsheet.com/home/">AppSheet</a></li><li><a href="https://notebooklm.google/">NotebookLM</a></li><li><a href="https://cloud.google.com/application-integration?e=48754805">Application Integration</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=640da44ca1ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/mesop-vs-other-low-code-google-cloud-frameworks-640da44ca1ae">Mesop vs. low-code Google Cloud tools</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>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scale Google Sheets For Enterprise Data Across Teams]]></title>
            <link>https://fargyle.medium.com/google-sheets-scaling-for-enterprise-data-across-organizations-0562cb2dae2b?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/0562cb2dae2b</guid>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[google-workspace]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Sun, 22 Sep 2024 23:30:24 GMT</pubDate>
            <atom:updated>2024-09-24T20:26:18.586Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Line of business sales automation</h4><p>A common line of business requirement is to further process enterprise systems data (eg. data imported with the <a href="https://workspace.google.com/marketplace/app/salesforce_connector/857627895310">Salesforce Connector</a>); for instance, combine it with other data sources, supplement it with manual input, and share this combined information with other stakeholders based on filter criteria in the manual input. Google Sheets formulas are a great way of automating much of this to deliver an always-in-sync (apart from any latency in the enterprise system connector) system; however, this approach can introduce a couple of challenges:</p><ul><li>Formulas put an additional burden on processing, which can make large spreadsheets unusable well before the <a href="https://support.google.com/drive/answer/37603?sjid=4380075714501107991-NC">10 million cell limit</a>; 10 million cells may seem like a lot, but an export of 50k rows from an enterprise system with 20 columns of data is already at 1 million cells; augment that with another 20 manually entered fields (even in another sheet) and it grows to 2 million cells (3 million if the source columns are also copied to the new sheet).</li><li>The line of business users inputting the manual information may not be familiar with spreadsheet formulas and the potential for corruption if they enter manual data in a cell which either contains a formula or is populated by one, or if they sort the sheet, or insert rows so the formulas are no longer where they were designed to be.</li><li>Enterprise data should be governed by least-privilege to the extent possible.</li></ul><p>This article provides approaches to addressing these challenges.</p><h3>Manage Sheets complexity</h3><p>This is important to be able to maintain the sheets over time, minimize the potential impact of team member manual entries, and maximize performance.</p><p>You’ll need to evaluate the tradeoff between ease of maintenance, performance, and usability for your use case.</p><ul><li>Minimizing the use of conditional format rules <a href="https://support.google.com/docs/answer/11468464?hl=en">will increase performance</a>, but may make the sheet less usable; can conditional formatting be applied only in a later derivative spreadsheet with less of the data where it will have less of a performance impact?</li><li><a href="https://support.google.com/docs/answer/12568985?hl=en">Maps</a>, <a href="https://support.google.com/docs/answer/3093343?hl=en">queries</a> and <a href="https://support.google.com/docs/answer/3093275?hl=en">arrayFormulas</a> may be less performant than repeating the formula in every row (there are mixed reports; repeating importRanges in every row is an exception… this is an anti-pattern), but are definitely easier to maintain, and minimize the impact of rows being added/inserted. The flip side is that behaviour may not be what team members expect: data entered in cells populated by a query will be overwritten (which isn’t so bad); data entered in a cell populated by an arrayFormula will break the formula so none of the cells are populated.</li></ul><h3>Manage spreadsheet size</h3><p>This may seem obvious, but the question is how to do it.</p><ul><li>One approach is to break up your enterprise data exports into smaller chunks via filters, pull each of them into its own spreadsheet for initial processing, and only combine the relevant rows and columns once that processing is complete.</li><li>Another is to minimize sheet replication within a spreadsheet</li></ul><h4>ImportRange</h4><p><a href="https://support.google.com/docs/answer/3093340?hl=en">ImportRange</a> supports pulling the filtered data into another spreadsheet; there are a couple of challenges here, both of which can be mitigated with <a href="https://support.google.com/docs/answer/3093343?hl=en">queries</a>.</p><p>ImportRange is limited in the amount of data it can import from another spreadsheet; this limit is far smaller than it is for a query between sheets within a spreadsheet.</p><p>One approach to managing this is to further filter the data within your source spreadsheet based on the manually entered supplemental data, pull that into a staging sheet and then import that smaller sheet only.</p><p>However, this may not be possible, or the data may still be too large; queries allow you to combine multiple importRanges into a single result set within a sheet. There are mixed reports on the best way to segment your data to maximize import size (columnar vs. rows); in my testing segmenting by rows supported the largest amount of data per importRange. So your query would look something like the following, where the first range_string refers to, for instance, the source sheet’s first 10k rows, and the second range_string to the final 10k rows:</p><pre>=QUERY({<br>IMPORTRANGE(spreadsheet_url, row_range_string_1);<br>IMPORTRANGE(spreadsheet_url, row_range_string_2)<br>},<br>&quot;&quot;, <br>1)</pre><p>You’ll notice if you try this that you get an uninformative “#REF!” error. This is because you need to allow access to the source spreadsheet the first time you establish this connection, and the dialogue to do so only triggers when there’s a single import statement.</p><ul><li>So run the query with one importRange statement, and then add the second.</li></ul><h4>Combine multiple spreadsheets</h4><p>You can also use the above query methodology to combine multiple filtered spreadsheets into a final combined spreadsheet. In this case you’ll want to add a select statement against a key value field to avoid importing blank rows, which both increase the size of the spreadsheet, and are inserted between the two imports, potentially causing issues for your target spreadsheet.</p><pre>=QUERY({<br>IMPORTRANGE(spreadsheet_url_1, range_string);<br>IMPORTRANGE(spreadsheet_url_2, range_string)<br>},<br>&quot;select * where ColN is not null&quot;, // eg. Col1; Nis the index of the key column<br>1)</pre><p>In this case you’ll need to run the query first with the importRange of your first spreadsheet, then with the importRange of your second (presuming you‘re combining two spreadsheets), since each of them needs to be “allowed” separately.</p><h4>Index</h4><p>Some connectors, such as the Salesforce Connector, update the whole sheet when they sync, not just the columns which they’re populating; this means that you can’t add formula-based calculated columns, but instead need to copy the required data from the original sheet just to be able to add some transformed columns, potentially doubling the size of your source spreadsheet before you even get to the final sheet intended for export. One way of minimizing replication is to do the transformations inline rather than having an intermediate processing sheet; so, for instance, if you need to convert a dollar amount to a bucketized t-shirt size, populate the target sheet with <a href="https://support.google.com/docs/answer/3098242">index</a> rather than a query:</p><pre>=INDEX({source_sheet_col_1_range, ...source_sheet_col_n-1_range, IF(source_sheet_col_n_range&gt;100,”Bucket1”,”Bucket2”), source_sheet_col_n+1_range,...})</pre><h3>Merge Sheets</h3><p>Since your team will be manually entering data in the final joined spreadsheet, you can’t just overwrite it with data from the enterprise data feed; instead, you need to merge in these fields.</p><h4>Map</h4><p>Map functions provide similar functionality to arrayFormulas, but are more recent, and may be simpler to understand (and therefore maintain) for some, particularly for 2d arrays.</p><p>For instance, a function to populate all the cells in a 2d range based on a key value and contiguous data in another sheet would look like the following.</p><pre>=MAP(target_key_range, LAMBDA(a, if(a=&quot;&quot;,&quot;&quot;,XLOOKUP(a, source_key_range, source_data_range))))</pre><h4>Reconcile new and deprecated records</h4><p>There will likely also be new records in the enterprise system over time; and other records will no longer be included as the business changes.</p><p>A sheet with a formula similar to the following will help you identify new records; you can then just copy the key values to your manual entry spreadsheet to auto-populate the data from the enterprise system’s import sheet (using the map statement above).</p><pre>=FILTER(enterprise_system_import_key_range,ISNA(MATCH(enterprise_system_import_key_range,manual_entry_sheet_key_range,0)))</pre><p>You may also want to populate a column to the right with descriptive information for each new record in the enterprise system’s import sheet.</p><pre>=FILTER(enterprise_system_import_description_range,ISNA(MATCH(enterprise_system_import_key_range,manual_entry_sheet_key_range,0)))</pre><p>Lastly, you’ll want to identify deprecated records; in this case, there won’t be any descriptive information, because that’s pulled from the enterprise system (in which the record no longer exists).</p><h3>Governance</h3><h4>Sharing and least-privilege</h4><p>Often you’ll need to share your spreadsheets with a partner or another department which shouldn’t have access to all of the enterprise data which your internal team does.</p><p>Separate spreadsheets enable least-privilege sharing of just that data which should be shared: create a sheet within your team’s spreadsheet which only has the rows and columns you wish to share, and use the techniques described above to import it into a secondary spreadsheet which will be shared more broadly.</p><h4>Hygiene</h4><p>As discussed above, formulas introduce the possibility of corruption by line of business users inputting manual information.</p><p>To minimize this risk, put the formulas in the header row; note that in general, this means that the target sheet header row will have the same wording as the source sheet.</p><p><a href="https://support.google.com/docs/answer/1218656?sjid=15134674683942700649-NC&amp;visit_id=638626423076770933-3445265354&amp;rd=1#zippy=%2Cprotect-a-range-or-sheet">Protected Ranges</a> provide the ability to further protect the formulas by preventing editing of the formula cells, as well as the cells they populate, by non-authorized team members.</p><p>However, in addition to the constraints described in the documentation, they also prevent those team members against whom the cells are protected from saving <a href="https://developers.google.com/sheets/api/guides/filters#filter-views">filter views</a>; they can only create temporary filter views, which is challenging if they frequently use the same filters.</p><p>Someone with permission in the protected ranges can create filter views on their team members’ behalf, but team members can’t change the criteria of the filter views (eg. filter on value Y within the column instead of value X), which is a strong constraint.</p><p>Google AppSheet provides policy and model abstraction from the underlying spreadsheet and its formulas, and may be the next step on your journey. The other way of skinning the cat is to use Apps Script for the backend automation instead of spreadsheet formulas, so that Sheets solely fulfills the MVC view role; this moves the solution from no-code to low-code, and may be more difficult to maintain, depending on your team’s skills.</p><h3>What’s next</h3><p>Read the following to learn more about the concepts and solution components described in this article:</p><ul><li><a href="https://workspace.google.com/marketplace/app/salesforce_connector/857627895310">Salesforce connector</a></li><li><a href="https://support.google.com/docs/answer/11468464">Learn how to improve Sheets performance</a></li><li><a href="https://support.google.com/docs/answer/3093275">ArrayFormula</a></li><li><a href="https://support.google.com/docs/answer/12568985">Map</a></li><li><a href="https://support.google.com/docs/answer/3093340?hl=en">ImportRange</a></li><li><a href="https://support.google.com/docs/answer/3098242">Index</a></li><li><a href="https://support.google.com/docs/answer/1218656?sjid=15134674683942700649-NC&amp;visit_id=638626423076770933-3445265354&amp;rd=1#zippy=%2Cprotect-a-range-or-sheet">Protected ranges</a></li><li><a href="https://developers.google.com/sheets/api/guides/filters#filter-views">Filter views</a></li><li><a href="https://about.appsheet.com/home/">AppSheet</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0562cb2dae2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Govern Vertex AI Generative AI / Large Language Model Access With Quotas]]></title>
            <link>https://medium.com/google-cloud/governing-vertex-ai-gen-ai-llm-model-access-via-quotas-19df2c53fccd?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/19df2c53fccd</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[governance]]></category>
            <category><![CDATA[generative-ai]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Sun, 06 Aug 2023 02:03:59 GMT</pubDate>
            <atom:updated>2024-10-16T03:15:17.110Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Roleless access control</h4><h3>Introduction</h3><p>Some organizations want to limit Google Cloud generative AI and large language model (LLM) usage to a subset of those folks who have access to Vertex AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i5dNTzMm3wOxkh6X4R9aKw.png" /></figure><p>Ideally, you’d manage this with organization policy constraints at the <a href="https://cloud.google.com/resource-manager/docs/creating-managing-folders">folder or project level</a>. However, there <a href="https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints#constraints-for-specific-services">aren’t generative AI and LLM organization policy constraints for Vertex AI</a> today.</p><p>There are Vertex AI <a href="https://cloud.google.com/iam">IAM</a> roles; however, the <a href="https://cloud.google.com/iam/docs/understanding-roles#ai-platform-roles">AI Platform</a>, <a href="https://cloud.google.com/iam/docs/understanding-roles#other-roles">Other</a> (VisionAI, etc.) <a href="https://cloud.google.com/iam/docs/understanding-roles#recommendations-ai-roles">Recommendations AI</a>, and <a href="https://cloud.google.com/iam/docs/understanding-roles#vertex-ai-roles">Vertex AI roles/permissions</a> aren’t required to call Vertex AI generative AI and large language model APIs, just to perform platform activities (eg. features, models, metadata, Tensorboards).</p><p>So let’s look at the preventive, detective and corrective controls which are available.</p><ul><li>Google Cloud generative AI and large language model access is governed globally by <a href="https://cloud.google.com/vertex-ai/docs/featurestore/setup#configure_project">Vertex AI API enablement</a>. So <a href="https://cloud.google.com/resource-manager/docs/organization-policy/restricting-resources">restrict usage</a> of this API to only those projects which need it.</li><li>You can govern which models (eg. text-bison, code-bison, imagegeneration) are accessible from a Vertex API enabled project by restricting <a href="https://cloud.google.com/vertex-ai/docs/quotas#request_quotas">quota</a> to zero for a model.</li><li>You can audit usage of the Vertex AI APIs with <a href="https://cloud.google.com/vertex-ai/docs/general/audit-logging#enabling_audit_logging">Vertex AI Data Access Logs</a> and enable automated remediation pipelines.</li></ul><p>This highlights the general need to implement an automated approval and provisioning system for Google Cloud APIs and roles/permissions, while withholding the <a href="https://cloud.google.com/iam/docs/understanding-roles#basic">Project Owner basic role</a> from the general user population and instead provisioning them with the most limited predefined roles or custom roles that meet your needs (ie. not the <a href="https://cloud.google.com/docs/quota_detail/permissions#permissions_changing">serviceusage.quotas.update permission</a>). Otherwise project owners can set quotas themselves.</p><ul><li>Basic roles include thousands of permissions across all Google Cloud services. In production environments, do not grant basic roles unless there is no alternative; see the <a href="https://cloud.google.com/iam/docs/understanding-roles">“understanding roles” documentation</a>.</li><li>The <a href="https://cloud.google.com/docs/enterprise/setup-checklist#checklist-heading-6">Google Cloud setup checklist</a> includes guidance on sample principals and roles.</li></ul><p>The following describes considerations and implementation of governing Google Cloud generative AI and large language model access with quotas.</p><h3>Quota-based Access Control Considerations</h3><ul><li>The account setting the quotas requires <a href="https://cloud.google.com/docs/quota_detail/permissions#permissions_changing">serviceusage.quotas.update permission</a>.</li><li><a href="https://cloud.google.com/resource-manager/docs/organization-policy/restricting-resources">Restrict broad access to the aiplatform.googleapis.com</a> to only those projects which need it and <a href="https://cloud.google.com/docs/quota_detail/permissions#permissions_changing">serviceusage.quotas.update permission</a> to only those users who need it to limit the potential for out-of-policy use of generative AI and large language models.</li><li>When creating new projects<br>- Only put them in a folder with organizational policy which allows access to the aiplatform.googleapis.com if needed.<br>- Set zero quotas for each<a href="https://cloud.google.com/vertex-ai/docs/quotas"> model</a> you wish to disable, each region in which the models are enabled, and each project.<br>- Augment the process as new <a href="https://cloud.google.com/vertex-ai/docs/quotas#request_quotas">models</a> are added.</li><li>Run chron jobs to remediate out-of-policy access to the models for all regions, projects, and models.<br>- Default quota is available in regions in which the models are newly enabled, and setting quota in regions where the model is unavailable fails, so reactive controls are required.<br>- Augment the jobs as new <a href="https://cloud.google.com/vertex-ai/docs/quotas#request_quotas">models</a> are added.</li><li>The <a href="https://cloud.google.com/sdk/gcloud/reference/alpha/services/quota/update#:~:text=help%20for%20details.-,NOTES,-This%20command%20is">gCloud command is alpha</a> and might change without notice.</li></ul><h3>Manage Access From The Console</h3><p>This is of course only applicable to one-off testing, not to governance.</p><p>Edit the relevant quotas.</p><ul><li>Note that not all dimension values are available in the filter drop-down (eg. chat-bison may be, but text-bison not), so may need to type these in rather than selecting.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*G1yses6HtCt7-OhC" /></figure><h3>Manage Access With gCloud</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46316d3d9e01f42dc0c0cc349e989f31/href">https://medium.com/media/46316d3d9e01f42dc0c0cc349e989f31/href</a></iframe><p>Interesting thing is that even though VertexAI is available in regions such as West2, bison only appears to be available in Central1, and VertexAI deployed to West2 uses the Central1 bison under the covers. Setting the quota in an unavailable bison region yields the following error:</p><p>FAILED_PRECONDITION: The consumer override value can only be set between 0 to 0.</p><p>Setting quota to zero does a validation check re. whether you really want to do this:</p><p>Set ‘ — force_only’ to avoid specific checks or ‘ — force’ to avoid all the checks.</p><p>However, — force_only doesn’t appear to be a valid flag, and yields the following error:</p><p>unrecognized arguments: — force_only (did you mean ‘ — force’?)</p><p>Zero quota appears be represented without an overRideValue or effectiveLimit (unlike non-zero quota; see below) whether it’s changed via the Console or gCloud:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19ce71734ce1aa152377575cf2e18a63/href">https://medium.com/media/19ce71734ce1aa152377575cf2e18a63/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d12244940dd5222cda6f2072f21aab4/href">https://medium.com/media/2d12244940dd5222cda6f2072f21aab4/href</a></iframe><p>But it does give the desired result of causing execution of the API to fail in a <a href="https://cloud.google.com/vertex-ai/docs/workbench/user-managed/create-new">Workbook</a> calling it:</p><p>ResourceExhausted: 429 Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: text-bison. Please submit a quota increase request.<a href="https://cloud.google.com/vertex-ai/docs/quotas"> https://cloud.google.com/vertex-ai/docs/quotas</a>.</p><h3>Audit and Remediation</h3><p>Enable <a href="https://cloud.google.com/vertex-ai/docs/general/audit-logging#enabling_audit_logging">Vertex AI Data Access Logging</a> to track out-of-policy usage.</p><p><a href="https://cloud.google.com/vertex-ai/docs/general/audit-logging#gcloud">Filter out the Cloud Audit logs</a>; they’ll have a payload similar to the following, which includes:</p><ul><li>Who invoked the model</li><li>The project from which the model was invoked</li><li>Which model was invoked</li></ul><p>The logs exclude confidential information such as the prompt or data used.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/054aa01068c38121543e1084a824f5bb/href">https://medium.com/media/054aa01068c38121543e1084a824f5bb/href</a></iframe><p>Build a pipeline to remediate out-of-policy usage as appropriate based on <a href="https://cloud.google.com/logging/docs/alerting/log-based-alerts">log-based alerts</a>.</p><h3>Scaling</h3><p>Use <a href="https://cloud.google.com/resource-manager/docs/creating-managing-folders">Organization Policy Folders</a> to manage Vertex AI access at scale. With the appropriate controls in place to ensure that users can’t add tags to projects themselves, <a href="https://cloud.google.com/resource-manager/docs/tags/tags-overview#administration">tags</a> can be <a href="https://cloud.google.com/resource-manager/docs/organization-policy/tags-organization-policy">another way of managing organization policy constraints</a> at scale. Data Access Logs can be enabled at the organization or folder level, and this <a href="https://cloud.google.com/logging/docs/audit/configure-data-access#iam_policy_objects">applies to all existing projects within that organization or folder</a>.</p><p>Your script can automatically discover new <a href="https://cloud.google.com/vertex-ai/docs/quotas#request_quotas">models</a> as they’re added by inspecting the response of the “gcloud alpha services list” command.</p><p>If bash scripts with gCloud run too slow for an organization of your size, call the <a href="https://cloud.google.com/service-usage/docs/apis">Service Usage APIs</a> natively from a Go binary; Go routines’ multi-threading capability is a huge advantage here: it can manage quota for many projects in parallel, yielding orders of magnitude speed improvements for these sorts of scripts.</p><p>Apply the relevant <a href="https://cloud.google.com/architecture/automating-cost-optimizations-with-cloud-functions-cloud-scheduler-and-stackdriver#considerations_for_a_production_environment">production considerations</a> described in the <a href="https://cloud.google.com/architecture/automating-cost-optimizations-with-cloud-functions-cloud-scheduler-and-stackdriver">Automating cost optimizations with Cloud Functions, Cloud Scheduler, and Cloud Monitoring documentation</a> to your audit and remediation pipeline; many are generally applicable. You may also find the patterns described in the <a href="https://www.youtube.com/watch?v=jCQTeglIfeI">Automate Your Security in GCP with Serverless Computing video</a> helpful.</p><h3>Sidebar: Non-zero Quota Override</h3><p>You may need to re-enable access.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f60643dac60f58ea55c14007f773914/href">https://medium.com/media/1f60643dac60f58ea55c14007f773914/href</a></iframe><p>Non-zero quotas are represented as you’d expect:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19ce71734ce1aa152377575cf2e18a63/href">https://medium.com/media/19ce71734ce1aa152377575cf2e18a63/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ed25f8f4084b54a2dd83e824aaa6762/href">https://medium.com/media/1ed25f8f4084b54a2dd83e824aaa6762/href</a></iframe><h3>What’s next</h3><p>Review this article on <a href="https://fargyle.medium.com/vertex-ai-generative-ai-large-language-model-trust-f206aae1a014">Vertex AI Generative AI / Large Language Model Trust</a>.</p><p>Review the documentation:</p><ul><li><a href="https://cloud.google.com/vertex-ai/docs/quotas#request_quotas">Vertex AI request quotas</a></li><li><a href="https://cloud.google.com/service-usage/docs/reference/rest/v1beta1/services.consumerQuotaMetrics.limits.adminOverrides#QuotaOverride">REST Resource: services.consumerQuotaMetrics.limits.adminOverrides</a></li><li><a href="https://cloud.google.com/sdk/gcloud/reference/alpha/services/quota/list">gcloud alpha services quota list</a></li><li><a href="https://cloud.google.com/sdk/gcloud/reference/topic/filters">gcloud topic filters</a></li><li><a href="https://cloud.google.com/sdk/gcloud/reference/alpha/services/quota/update">gcloud alpha services quota update</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19df2c53fccd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/governing-vertex-ai-gen-ai-llm-model-access-via-quotas-19df2c53fccd">Govern Vertex AI Generative AI / Large Language Model Access With Quotas</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>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Platform Notebooks “headless” training]]></title>
            <link>https://medium.com/google-cloud/ai-platform-notebooks-headless-training-b8efd905dfaf?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8efd905dfaf</guid>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[google-ai-platform]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Sun, 27 Dec 2020 00:08:04 GMT</pubDate>
            <atom:updated>2020-12-27T00:14:07.506Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>AI Platform Notebooks “headless” Training</h3><h4>Less triggering than a chicken in a barnyard</h4><p><a href="https://cloud.google.com/ai-platform-notebooks">AI Platform Notebooks</a> provide managed JupyterLab notebook instances, a familiar tool to experiment, develop, and deploy models into production.</p><p>The missing piece is training models for production; this typically runs much longer than the initial experimentation or the production prediction. The interactive Notebook in which you did your experimentation is probably not the right place for this: browser sessions time out, connections are lost, image rendering freezes, and the instance isn’t right-sized for training.</p><p>This article focuses on two approaches to running your training in a headless manner:</p><ul><li><a href="https://cloud.google.com/ai-hub">AI Hub</a> JupyterLab VM: Papermill</li><li><a href="https://cloud.google.com/ai-platform/training/docs/training-jobs">AI Platform Training</a></li></ul><h3>AI Hub JupyterLab VM: Papermill</h3><p><a href="https://papermill.readthedocs.io/en/latest/">Papermill</a> is a tool for parameterizing and executing Jupyter Notebooks in a <a href="https://cloud.google.com/blog/products/ai-machine-learning/let-deep-learning-vms-and-jupyter-notebooks-to-burn-the-midnight-oil-for-you-robust-and-automated-training-with-papermill">number of different ways</a> including by spinning up a VM.</p><p>One of these is submitting the notebook from the command line of the Notebook’s VM: this takes advantage of the custom VM configuration which you’ve already configured with your AI libraries, while bypassing the potential freezing issues associated with rendering the results in the Notebook UI. The Notebook VM also includes Papermill pre-installed, so no additional configuration is required.</p><ul><li>If you’d like to run on a separate VM with Papermill, <a href="https://cloud.withgoogle.com/next/sf/sessions?session=MLAI212">this TPU-based Next 2019 talk</a> walks through that scenario.</li></ul><p>You can access the command line either from the <a href="http://cloud.google.com/console/compute/instances">Cloud Console -&gt; Compute Engine -&gt; VM instances</a> -&gt; SSH option for the VM, or from within the Notebook itself; the former excludes the Notebook UI as a potential concern. You can open the SSH session in a browser window, or in a dedicated client for additional state persistence.</p><h4>Parameterization</h4><p>You can <a href="https://papermill.readthedocs.io/en/latest/usage-parameterize.html">parameterize</a> your Notebook to pass variable information such as the number of epochs into the notebook at run time. Set default parameters in a cell tagged with the “parameter” keyword and refer to these in the training or other steps; these are then over-ridden by whatever you specify on the command line.</p><p>Eg. Command Line for a Notebook with an epochs parameter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/980753a64a56d6bc2798fc8f61370f77/href">https://medium.com/media/980753a64a56d6bc2798fc8f61370f77/href</a></iframe><h4>Execution</h4><p>When you run the command, you specify an output Notebook; all intermediate results, logging, etc. are recorded here. Include the <a href="https://papermill.readthedocs.io/en/latest/usage-cli.html">log-output flag</a> to write notebook output to stderr (ie. the terminal window)</p><p>Note that if the terminal is closed, this terminates the SSH session, and by default any Notebooks running within it, including headless notebooks.</p><p><strong>Continue execution if the terminal is closed</strong></p><p>To continue execution even if the terminal session is closed, use a command sequence like one of the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d0b8ec4ac49abc460a5235c8f967503/href">https://medium.com/media/0d0b8ec4ac49abc460a5235c8f967503/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70f16d31b37aaf158342140b4f62b4d4/href">https://medium.com/media/70f16d31b37aaf158342140b4f62b4d4/href</a></iframe><p>These commands show the process id (pid) and redirect stderr and stdout to nohup.out or ~/output.txt respectively.</p><p>You can monitor the running process from from the output notebook, as well as from a new terminal session using the following command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9acc0779bf850937a98afe624cec7b40/href">https://medium.com/media/9acc0779bf850937a98afe624cec7b40/href</a></iframe><p>Note that redirecting stdout and stderr throws the following error; this doesn’t affect Notebook execution or logging:</p><ul><li><em>AttributeError: ‘NoneType’ object has no attribute ‘send_multipart’</em></li></ul><p>More background here:</p><ul><li><a href="https://unix.stackexchange.com/questions/4004/how-can-i-run-a-command-which-will-survive-terminal-close#4006">Running commands which survive terminal close</a></li><li><a href="https://unix.stackexchange.com/questions/3886/difference-between-nohup-disown-and">Difference between nohup, disown, and &amp;</a></li></ul><h3>AI Platform Training</h3><p>This approach is based on creating a Docker image with your libraries layered on top of a <a href="https://aihub.cloud.google.com/p/products%2F28bd45d7-04f1-43ba-a231-15299cd57ac6">base Tensorflow image</a>, then deploying that to <a href="https://cloud.google.com/ai-platform/training/docs/training-jobs">AI Platform Training</a>; you can also run the image locally for testing. This has the advantage of being able to size your training environment differently from your Notebook environment, and natively close the terminal session without affecting job execution; you can track job execution in the <a href="http://cloud.google.com/console/ai-platform/jobs">cloud console</a>; logs are written to Stackdriver.</p><p>Store the model weights in Google Cloud Storage as the link between the training and prediction steps; note that you can also <a href="https://www.tensorflow.org/beta/guide/keras/saving_and_serializing#whole-model_saving">save the whole model</a> instead of just <a href="https://www.tensorflow.org/guide/keras/save_and_serialize#weights-only_saving">the weights</a>; the chosen approach will depend on your use case.</p><h4>Parameterization</h4><p>As before, you can parameterize the execution, eg. with the number of epochs.</p><h4>Sample script</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40f7541ec3e2bc8af4545acabc607b65/href">https://medium.com/media/40f7541ec3e2bc8af4545acabc607b65/href</a></iframe><h4>Execution</h4><p>Step through the steps outlined above on your VM, or run it all as a bash script. You will need to create your own GCS bucket in the project in which you’re running the VM; this GCS bucket can be on a different VM if you configure service accounts appropriately.</p><p>If you choose to run the optional local training test step, your VM will need a GPU.</p><h4>Checkpoints</h4><p>​To support better recovery from failures during a job, you can implement​<a href="https://www.tensorflow.org/beta/guide/checkpoints"> checkpoints</a>;<a href="https://github.com/GoogleCloudPlatform/cloudml-samples/blob/master/census/keras/trainer/task.py"> this Keras sample</a> demonstrates checkpointing on epochs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8efd905dfaf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/ai-platform-notebooks-headless-training-b8efd905dfaf">AI Platform Notebooks “headless” training</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>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Explorer for Google Groups]]></title>
            <link>https://medium.com/google-cloud/explorer-for-google-groups-4de258b1344f?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/4de258b1344f</guid>
            <category><![CDATA[google-workspace]]></category>
            <category><![CDATA[visjs]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Sat, 26 Dec 2020 21:13:54 GMT</pubDate>
            <atom:updated>2021-01-25T20:47:30.447Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Edges and nodes for days</h4><p>Ever bumped into the Google <a href="https://support.google.com/a/answer/33343">admin-managed Groups</a> parent <a href="https://support.google.com/a/answer/6099642?hl=en#membershiplimits">limits</a>? They can be an issue for B2B multi-tenant application authorization, particularly if you are serving Google Cloud Storage objects in a differentiated way.</p><p>Use <a href="https://github.com/demoforwork/public/tree/master/Groupcount">this utility</a> to proactively check whether you’re getting close to these limits, and to understand hotspots.</p><ul><li>It provides a visualizer as well as CSVs for offline analysis</li><li>Batch mode enables you to run it at low load times and analyze the cached results later</li></ul><p>You can search for an identity (user, service account, or group) whose ancestry to map, or for a group prefix for which to display summary statistics.</p><p>You can also highlight a group’s parents within the visualizer to identify potential group optimizations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pLBZ-ycov51Vdqi7e1dbQ.png" /></figure><h3>Considerations</h3><p>The utility does not include group ownerships, which do count towards the quota; there isn’t a way to do this other than scanning the entire groups tree.</p><p>Each edge joining a child via multiple groups to a single parent (ie. diamond patterns) is counted; the actual Groups limits may be calculated differently for some children.</p><h3>Scaling</h3><p>This utility takes a number of measures to address performance and scaling in addition to the batch mode mentioned earlier; it…</p><ul><li>caches prior query results.</li><li>supports multiple service accounts, since some aspects of the <a href="https://developers.google.com/admin-sdk/directory/v1/limits">Admin SDK Directory API</a> Groups quota metrics are per-identity; two service accounts appear to be sufficient to support reading almost 5k groups.</li><li>takes advantage of Go concurrency with <a href="https://gobyexample.com/waitgroups">WaitGroups</a>.</li><li>implements <a href="https://github.com/golang/go/wiki/RateLimiting">channel-based throttling</a>.</li></ul><p>Note that for constant-load applications such as this utility, <a href="https://developers.google.com/admin-sdk/directory/v1/limits#backoff">exponential backoff</a> actually increases load; it is only useful for spiky load use cases.</p><h3>Webserver</h3><p>The Go webserver implements endpoint-specific approaches to serve static files, dynamically generated JSON, and interactive query responses.</p><h3>Visualization</h3><p>The graphical visualization is based on <a href="https://visjs.github.io/vis-network/examples/">vis.js network diagrams</a> and includes a sample data generator for simulation.</p><p>Tuning the visualization for 5k nodes required a bit of trial and error. For instance, <a href="https://visjs.github.io/vis-network/docs/network/physics.html">physics-based graphs</a> improve node spacing for large graphs, but are too slow for thousands of nodes; however, some of the physics options still have a useful effect, though it’s different than it would be with physics enabled.</p><h3>Digression: Rate Limiters</h3><p>To test the Explorer utility’s scaling, I needed a large Groups hierarchy with sufficient nesting, which in turn meant another utility. Creating group hierarchy is much less performant than reading it.</p><p>The Explorer utility uses <a href="https://github.com/golang/go/wiki/RateLimiting">channel-based throttling</a>, but apparently this approach <a href="https://rodaine.com/2017/05/x-files-time-rate-golang/">spends a disproportionate amount of time in the overhead</a> once you go over tens of queries per second, and it’s then better to use the <a href="https://pkg.go.dev/golang.org/x/time/rate?tab=doc">rate limiter package</a>.</p><p>According to the <a href="https://pkg.go.dev/golang.org/x/time/rate#Limiter">rate limiter docs</a>, most callers should use Wait; however, all the code samples I’d been able to find use Allow and Reserve. Daz Wilkin provided this great snippet demonstrating the correct use of context and the burst parameter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9071f84043d739ed70586405aa1c8430/href">https://medium.com/media/9071f84043d739ed70586405aa1c8430/href</a></iframe><h3>What’s next</h3><p>Upgrade the utility to the:</p><ul><li><a href="https://cloud.google.com/identity/docs/reference/rest">Cloud Identity API</a>; it provides a much higher default read quota than the Admin SDK API quota.</li><li><a href="https://pkg.go.dev/golang.org/x/time/rate?tab=doc">rate limiter package</a> for the reasons discussed in the article.</li></ul><p>Investigate whether this <a href="https://github.com/salrashid123/gsuites_gcp_graphdb">comprehensive Groups, IAM policy, and projects visualization utility</a> better meets your requirements.</p><ul><li>It includes Cloud IAM policies and projects in the hierarchy.</li><li>It loads the data into a JanusGraph database which you can visualize with multiple tools.</li></ul><p>Review whether you can replace some or all of your Groups for managing Google Cloud Storage access by downscoping with <a href="https://cloud.google.com/iam/docs/downscoping-short-lived-credentials">Credential Access Boundaries</a>.</p><ul><li>These are supported at both the bucket and object level.</li><li>You can create a service account that can access every Cloud Storage bucket that you own, then apply a Credential Access Boundary that only allows access to the bucket with your customer’s data.</li><li>You can create an IAM condition that makes permissions available for objects whose name starts with a specific prefix.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4de258b1344f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/explorer-for-google-groups-4de258b1344f">Explorer for Google Groups</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>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apps Script: get Paragraph Formatting]]></title>
            <link>https://fargyle.medium.com/apps-script-get-paragraph-formatting-153dcfa86353?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/153dcfa86353</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[google-docs]]></category>
            <category><![CDATA[google-apps-script]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 12:02:45 GMT</pubDate>
            <atom:updated>2019-08-27T11:19:12.224Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Hacky workarounds 103</h4><p>As you may have noticed, the Apps Script <a href="https://developers.google.com/apps-script/reference/document/paragraph#getAttributes()">paragraph.getAttributes()</a> function returns mostly nulls.</p><p>This is because paragraph styles are <a href="https://developers.google.com/docs/api/reference/rest/v1/documents#ParagraphStyle">inherited from the named styles</a> unless they’re explicitly set on the paragraph (as demonstrated in <a href="https://developers.google.com/apps-script/advanced/docs#insert_and_style_text">this Advanced Docs sample</a>), over-riding the default styles. Unfortunately, the <a href="https://developers.google.com/apps-script/reference/document/">Apps Script Document Service</a> doesn’t provide an API to get the named styles.</p><p>Fortunately, the <a href="https://developers.google.com/apps-script/advanced/docs">Advanced Docs Service</a> does. The following snippet demonstrates its use; one thing to be aware of is that opening a large document with the Advanced Docs Service can be slow (eg. 30+ seconds for a 150 page document).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f80241ce1f64f04007dcba370b7c95a1/href">https://medium.com/media/f80241ce1f64f04007dcba370b7c95a1/href</a></iframe><p>When building your own Advanced Docs Service scripts, <a href="https://docs.googleapis.com/$discovery/rest?version=v1">this</a> rather hard-to-read discovery document is a helpful tool for navigating the available methods. An astonishing amount of supplemental context is available in the <a href="https://developers.google.com/docs/api/reference/rest/v1/documents">Overview</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=153dcfa86353" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[G Suite Group Calendar Automation]]></title>
            <link>https://fargyle.medium.com/g-suite-group-calendar-automation-6a0d326dcca4?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a0d326dcca4</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[google-apps-script]]></category>
            <category><![CDATA[google-groups]]></category>
            <category><![CDATA[google-calendar]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 16:06:38 GMT</pubDate>
            <atom:updated>2019-08-25T16:27:26.927Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Productivity tools</h4><p>As you may know, G Suite provides the ability to create <a href="https://support.google.com/a/answer/1626902?hl=en">shared group calendars</a>, which are great for 1:many sharing.</p><p>Many teams would like to have visibility not only into a shared administrative calendar, but also their team-mates’ calendars; while you can do this by adding your team members in your calendar left-nav, it’s a chunk of manual clicking every time, particularly if you have a large team.</p><p>A shared team calendar would seem to be the trick; however, many users (me included) don’t want to copy their appointments from their main calendar to a shared calendar; it’s just too much overhead.</p><p>Fortunately, this can be automated with Apps Script:</p><ul><li>Google Groups provides a simple way to manage and access your team list; note that to be able to access it programmatically, this must be a <a href="https://support.google.com/a/answer/33343?hl=en">domain-managed group</a>.</li><li>The Calendar API provides the ability to copy appointments between calendars (with a bit of work: there isn’t a native copy function), and to invite group calendars to a user’s calendar.</li></ul><h3>Shared calendar approaches</h3><p>There are two fundamental approaches here, each with their pros and cons.</p><h4>Copy each users events to the shared calendar:</h4><ul><li>This only requires view permissions on the user’s calendar</li><li>Changes to the user’s calendar are only reflected on the shared calendar when the next refresh is run.</li><li>The script needs to add meta-data to the calendar event to update/remove events on refresh since the event ids in the shared calendar are different than the event ids in the user’s calendar.</li><li>It’s a chunk of code to get and set all the event attributes since there isn’t a copy method.</li></ul><h4>Invite the shared calendar to the user’s calendar</h4><ul><li>This requires elevated, ie. edit, privileges on the user’s calendar</li><li>Changes to the user’s calendar are reflected immediately in the shared calendar.</li><li>The user’s events will have an additional group calendar invitee, which can look a little obscure.</li></ul><h3>Automation Script</h3><p>The following script takes the second approach; it only includes events to which a particular domain have been invited, so you can have separate shared calendars for different clients with whom you work, for instance.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/10b947ea6324ccb93d1c6e1f1318516a/href">https://medium.com/media/10b947ea6324ccb93d1c6e1f1318516a/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a0d326dcca4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apps Script: get Docs Heading Id]]></title>
            <link>https://fargyle.medium.com/apps-script-get-docs-heading-id-3ea2bde48778?source=rss-79ad99492546------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ea2bde48778</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[google-docs]]></category>
            <category><![CDATA[google-apps-script]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ferris Argyle]]></dc:creator>
            <pubDate>Sat, 24 Aug 2019 23:05:37 GMT</pubDate>
            <atom:updated>2019-08-27T11:26:13.674Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Hacky workarounds 102</h4><p>As you may have noticed, the heading id isn’t one of the <a href="https://developers.google.com/apps-script/reference/document/attribute">attributes</a>, and there isn’t a method to retrieve it in the basic <a href="https://developers.google.com/apps-script/reference/document/">Document Service</a>; however, there are a couple of workarounds.</p><h3>Heading Id Argument from Table of Contents</h3><p>You can get the heading argument from the <a href="https://developers.google.com/apps-script/reference/document/table-of-contents#getLinkUrl()">Table of Contents</a> (TOC), and that may be the better way to go depending on your use case:</p><ul><li>It’s about twice as fast for large documents as the alternative described below; it can still be fairly slow from a user experience perspective.</li><li>It depends on your users updating the TOC, which puts it a bit outside your script’s scope of control since there isn’t an API to update the TOC.</li><li>It depends on headings (ie. the text) being unique; this works well for meeting minutes documents with dated headings. If the headings aren’t unique, the script will return the heading id argument of the first matching heading, so either use reverse chronological order in your documents or invert the loop iteration orders (eg. for (var i = numBodyChildren; i — ;)).</li></ul><p>Note that this returns the full heading argument, ie. “#heading=...”.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef00b2e34e6c5a41dcff32ef360a8166/href">https://medium.com/media/ef00b2e34e6c5a41dcff32ef360a8166/href</a></iframe><h3>Heading Id from Advanced Docs Service</h3><p>You can get the heading id from the <a href="https://developers.google.com/apps-script/advanced/docs">Advanced Docs Service</a> if you can’t rely on your users updating the TOC or providing unique headings; however, there are other constraints.</p><ul><li>It takes about twice as long for large documents (eg. 30+ seconds for 150 page document) as using the basic Table of Contents approach; this is mostly the time required to open a large document with the Advanced Service.</li><li>Your users need to enter the document headings themselves because headings generated by Apps Script (either basic or Advanced service) don’t receive heading Ids until the TOC is refreshed, so you’d be back where you started. So this approach doesn’t help for automatically generated document sections.</li></ul><p>This approach doesn’t depend on unique heading text; only the name of the named range containing the heading needs to be unique, and your script can control this.</p><p>Create a named range using the basic service, and retrieve the heading Id in the matching named range in the Advanced Service. Unfortunately the named range Ids don’t match between the basic and Advanced Service, so you need to rely on the name of the ranges; just prune the named ranges before you create a new one, and generate unique names based on your script id, and perhaps a date/time stamp, and you should be good.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4e8990a2c5da8217394de3fa22f8cf3/href">https://medium.com/media/f4e8990a2c5da8217394de3fa22f8cf3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ea2bde48778" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>