Running Large Language Models on Google Cloud Platform via Cloud Run, VertexAI and PubSub - LLMOps on GCP

Hello blog, its been a long time. Since I finished the GA4 book I have had a good break and lots of life events have happened such as a new job, philosophies and family arrangements, but I have always intended to pick this thread up again once I had an idea on where it would best lead.

As old readers may remember, I’ve always tried to work on the meta-horizons of where I am, restlessly looking for the next exciting lesson, and that impulse has led me to Large Language Models (LLMs) sparked off by the Chat-GPT revolution, but foreshadowed by the image generation models such as Stable Diffusion a few months before.

A key facilitator has been Harrison Chase’s Langchain, an active hive of open-source goodness. It has allowed me to learn and imagine and digest this new active field of LLMops (Large Language Model Operations), that is the data engineering to make LLMs actually useful on a day to day basis. I took it upon myself to see how I could apply my Google Cloud Platform (GCP) data engineering background to these new toys Langchain has helped provide.

This means I now have this new brain, Edmonbrain, that I converse with daily in Google Chat, Slack and Discord. I have fed it in interesting URLs, Git repos and Whitepapers so I can build up a unique bot of my very own. I fed it my own book, and can ask it questions about it, for example:

Read more

Share

Activating GA4 events with GTM Server-Side and Pub/Sub for Fun and Profit

Image from https://solarsystem.nasa.gov/resources/758/brief-outburst/?category=solar-system_sun

With Google Tag Manager Server-side (GTM-SS), the scope on what you can do with your GA4 events is much enhanced, since using GTM-SS you have the ability to interact easily with other GCP services, in particular easier Google authentication. This integration can allow you to enrich your data streams or send your GA4 data to different locations other than the Google Marketing Platform. The first example of this has been using the BigQuery API in your GTM-SS templates to export your event data, but what if you need your event data on a more real-time basis? For that, there is Google Pub/Sub.

Read more

Share

Google Tag Manager Server Side on Cloud Run - Pros and Cons

Is Cloud Run viable for running Google Tag Manager server-side?

Read more

Share

Shiny on Google Cloud Run - Scale-to-Zero R Web Apps

How to create scale-to-zero Shiny apps on Google Cloud Run: pitfalls, how and why

Read more

Share

Online payments for data science apps (DSaaS) using R, Shiny, Firebase, Paddle and Google Cloud Functions

A bootstrap example on how to create a paid data science app (DSaaS)

Read more

Share

Introducing googleCloudRunner - serverless R on Google Cloud Platform

googleCloudRunner includes tools for R users to create APIs, cloud builds or scheduled scripts in the Google Cloud Platform

Read more

Share

gago: Blazingly fast Google Analytics API downloads with Go

Announcing gago: Go library for Google Analytics API v4 that can speed up API fetches by 85%

Read more

Share

R at scale on the Google Cloud Platform

Current thinking on what I consider the optimal way to work with R on Google Cloud Platform

Read more

Share

Auto Google Analytics Data Imports from Cloud Storage

Use Google Cloud Functions to auto-load your data imports into Google Analytics form Cloud Storage

Read more

Share

R on Kubernetes - serverless Shiny, R APIs and scheduled scripts

Some examples of running R applications on Google Kubernetes Engine

Read more

Share

Run RStudio Server on a Chromebook as a Cloud Native

I recently got an Asus Chromebook Flip with which I’m very happy, but it did make me realise that if a Chromebook was to replace my normal desktop as my primary workstation, my RStudio Server setup would need to be more cloud native than was available up until now. TL;DR - A how-to on making RStudio Server run on a Chromebook that automatically backs up data and configuration settings to Google Cloud Storage is on the googleComputeEngineR website here.

Read more

Share

Real-time forecasting dashboard with Google Tag Manager, Google Cloud and R Shiny - Part two

In part two of this two part series we walk through the steps to stream data from a Google Tag Manager (GTM) implementation into a Google App Engine (GAE) web app, which then adds data to a BigQuery table via BigQuery’s data streaming capability. In part two, we go into how to query that table in realtime from R, make a forecast using R, then visualise it in Shiny and the JavaScript visualisation library Highcharts.

Read more

Share

Real-time forecasting dashboard with Google Tag Manager, Google Cloud and R Shiny - Part one

In part one of this two part series we walk through the steps to stream data from a Google Tag Manager (GTM) implementation into a Google App Engine (GAE) web app, which then adds data to a BigQuery table via BigQuery’s data streaming capability. In part two, we go into how to query that table in realtime from R, make a forecast using R, then visualise it in Shiny and the JavaScript visualisation library Highcharts.

Read more

Share

Insights sorting by delta metrics in the Google Analytics API v4

As analysts, we are often called upon to see how website metrics have improved or declined over time. This is easy enough when looking at trends, but if you are looking to break down over other dimensions, it can involve a lot of ETL to get to what you need. For instance, if you are looking at landing page performance of SEO traffic you can sort by the top performers, but not by the top most improved performers.

Read more

Share

Launch RStudio Server in the Google Cloud with two lines of R

I’ve written previously about how to get RStudio Server running on Google Compute Engine: the first in July 2014 gave you a snapshot to download then customise, the second in April 2016 launched via a Docker container. Things move on, and I now recommend using the process below that uses the RStudio template in the new on CRAN googleComputeEngineR package. Not only does it abstract away a lot of the dev-ops set up, but it also gives you more flexibility by taking advantage of Dockerfiles.

Read more

Share

A digital analytics workflow through the Google Cloud using R

There are now several packages built upon the googleAuthR framework which are helpful to a digital analyst who uses R, so this post looks to demonstrate how they all work together. If you’re new to R, and would like to know how it helps with your digital analytics, Tim Wilson and I ran a workshop last month aimed at getting a digital analyst up and running. The course material is online at www.

Read more

Share

Efficient anti-sampling with the Google Analytics Reporting API

Avoiding sampling is one of the most common reasons people start using the Google Analytics API. This blog lays out some pseudo-code to do so in an efficient manner, avoiding too many unnecessary API calls. The approach is used in the v4 calls for the R package googleAnalyticsR. Avoiding the daily walk The most common approach to mitigate sampling is to break down the API calls into one call per day.

Read more

Share

SEO keyword research using searchConsoleR and googleAnalyticsR

In this blog we look at a method to estimate where to prioritise your SEO resources, estimating which keywords will give the greatest increase in revenue if you could improve their Google rank. Overview Thanks to Vincent at data-seo.com who proof read and corrected some errors in the first draft Data comes from Google Search Console and Google Analytics. Search Console is used to provide the keywords in these days post (not provided).

Read more

Share

Scheduling R scripts for a team using RStudio Server, Docker, Github and Google Compute Engine

edit 20th November, 2016 - now everything in this post is abstracted away and available in the googleComputeEngineR package - I would say its a lot easier to use that. Here is a post on getting started with it. http://code.markedmondson.me/launch-rstudio-server-google-cloud-in-two-lines-r/ This blog will give you steps that allows you to run on Google Compute Engine a server that has these features: RStudio Server instance with multiple login. Apache to host a welcome webpage.

Read more

Share

googleAuthR 0.2.0

googleAuthR is now on CRAN version 0.2.0. This release is the result of using the library myself to create three working Google API libraries, and tweaking the googleAuthR code to better support the process. As a result all of these libraries are now able to be authorised with one Google OAuth2 login flow: googleAnalyticsR searchConsoleR bigQueryR Batching This means the libraries above and any other created with googleAuthR can take advatage of batching: this uses a Google API feature that means you can send multiple API calls at once.

Read more

Share