Powering the County of Santa Barbara’s Zero-Emission Vehicle Revolution with Open Source AI
The County of Santa Barbara has a deep lineage of environmental leadership.
From the famous Environmental Rights Day in 1970, the pioneering Community Environmental Council to the first of its kind Environmental Studies program at UCSB, the County has been the tip of the spear of sustainability and protecting our ecosystem.
In that light, it’s only appropriate that the County of Santa Barbara stand proudly at the cutting edge of leveraging neural networks and open source GenAI models to deliver the promise of the zero-emission vehicle revolution.


AI Tech Built for Democratic Governance and Sustainability
I’m excited to share the journey of creating a suite of open source AI solutions that’s helping the County of Santa Barbara take action on sustainability. This system was developed in close collaboration with Zero-Emission Vehicle and Mobility Planning specialist Jerel Francisco and UC Berkeley professor Savio Saldanha. It is built with open source software at its core so that it can be adapted to other counties with no licensing costs, and so that it can be safely hosted and governed by the County and its citizens without being beholden to any third parties.
What is Semantic Search? How Can it Help?
With the open-source LLaMA 3 GenAI model at its core, this system allows county officials to upload important documents like the Zero-Emission Vehicle (ZEV) Plan, the Climate Action Plan, and local ordinances directly into the system. From there, a RAG (Retrieval-Augmented Generation) interface built with an open-source FAISS vector database lets them query these documents intelligently.
Unlike traditional keyword search, semantic search understands meaning. The vector database converts text into geometric coordinate representations that capture context, so when you ask about a “cat on a rug,” a RAG system will find relevant passages mentioning a “kitten on the carpet”—even though the exact words differ. For the County, this means staff can ask natural questions about sustainability policies and get answers from the precise relevant sections without needing to know the exact terminology used in each document.
But the system can do much more than just chat about sustainability documents. That is just the starting point.
The County’s ZEV Charging Station Grid Has Its Own Brain
Our AI system is augmented by custom developed neural networks that are trained on data from the County’s electric vehicle charging station grid. Each time a county employee or resident charges their electric vehicle a Powerflex system keeps track of the telemetry. The neural network learns patterns from that telemetry through a process called back propagation and can be retrained and augmented as the technology improves and as more data becomes available. Already, the model can predict energy utilization with 73% accuracy, but it will only become more powerful as more data is collected and as the model gets further fine-tuned. Predicting spikes will become increasingly more important since the magnitude of the spikes increases in proportion to the increased usage of the charging grid. Some predictions are that in 5 years the County will require almost 10X the amount of kWh delivered for charging ZEVs. That will very likely mean massive energy utilization spikes.

But to understand the output of these neural networks and how to best utilize the information we’ll need more than visualizations and annotated maps. That is where our GenAI model comes back in the picture to provide further assistance. Our dashboard GenAI reporting feature can translate statistical analysis into plain english and highlight potential issues and insights. Furthermore it can be trained to expertly understand the code behind the neural network workload. It can understand its capabilities and limitations and thus translate the results and potential issues to the County staff with specific insight.
“I Know Kung Fu”
Just like the character Neo in the movie Matrix, our GenAI model can internalize capabilities by training on custom datasets. Earlier we reviewed the vectorized knowledge base system (or RAG) and how it can provide access to pertinent information. Think of that like a cheat sheet the AI can read before answering a question. Model fine tuning on the other hand can provide skills intrinsic to the model itself such as capabilities for mathematics, coding or California law. That improves its ability to reason, think mathematically or like an engineer. Yes, the implications of this are quite powerful and all the more important that such systems can be run democratically and governed by its stakeholders.
These training datasets have a very simple question and answer format, but some of these like the Nvidia OpenMathInstruct-2 dataset has 14 million question solution pairs. That takes our model about an afternoon to internalize. (Think about that for a second…) Using techniques such as QLoRA these trainings can happen without expensive compute costs. This also allows us to have multiple models that are specialists in different areas of expertise. Our AI Interface allows you to easily dispatch different expert models for different queries. County staff can save these as preset “recipies” which get them going in the right direction quickly with the right model already set.
This is what it looks like when our model learns a new skill:

Doubling Down on the Meta Open Source Community
While Meta the company as a whole sure has its share of controversies, the open source community behind many of its most famous tech advancements is legit. I’ve been going to conferences for over 6 years and meeting the brilliant minds behind React.js, GraphQL, FAISS and LLaMA and these folks are nothing short of amazing. It is for this reason that I believe in the LLaMA GenAI project even though Chinese or closed source models might at times be superior. I remember when React.js had fierce competition from Angular, Ember, and many others. In the end the React.js community prevailed with Meta backing them all along the way. Open source wins when the community has a great culture and has the support that it needs to thrive. For this reason I believe that LLaMA continues to be our best option for a home grown open source model we can make our own.
Going Beyond a ChatGPT Knock-Off
The front-end interface is built with React.js, providing a modern, responsive user experience that makes it easy for County staff to interact with the system. GraphQL is used to manage the communication between the front end and the back end, allowing for efficient and flexible queries that only fetch the data needed.
One of the standout features of this system is what we call “Apps.” In this context an “app” is something that builds on top of the foundational system to provide help with specific tasks. As more of these are needed more can be built to do unique tasks. The idea is to go beyond the “copy-and-paste” paradigm into an “input-leads-to-result” type of solution.
One of these apps lets county staff insert Zoom meeting notes into the system, and from there, the system can automatically draft emails to all meeting stakeholders. The emails are generated based on the questions asked in the meeting and the information pulled from the knowledge base, saving them time and ensuring accuracy in follow-ups.
An ambitious app that is in development allows the user to drop a pin on a Google Map and the system analyses all possible charging station locations in a 4 mile radius based on Google Street View images and recommends the best ones based on the type of parking and proximity to street light pole junction boxes. This app requires a new fine tuned neural network specializing in the needed image recognition and is a work in progress.
High Standards for Speed, Security and Reliability Backed by AWS GovCloud
To ensure we can meet FedRAMP compliance we are architecting a system using virtual private clouds in the AWS GovCloud. Think of it as a separate section of the internet dedicated specifically for hosting government applications securely. Encryption at transit and at rest will be ensured by using AWS ACM and AWS KMS respectively. AWS IAM, CloudTrail and Config are there to provide strict permission policies, security logging and governance oversight. If a setting is ever changed first of all you’ll need permission to do so, and logs are kept of all changes performed. Furthermore, an isolated subnet is used for the database and AWS RDS ensures the database is always backed up, the software always up to date and secured. Eventually, it might be even better if the County could host the AI infrastructure themselves, but the needed graphics cards come at a hefty initial investment that would require thorough planning and budget approval to provision all the infrastructure.

UC Berkeley Support & Award
I’m thankful to my professor Savio Saldanha who went above and beyond what was required of him to review the initial research project (it was my capstone). I’m proud to say that the project has been awarded an “Exemplary Assignment Award” which is very motivating.
Onwards!
The path forward is clear: sustainable governance requires sustainable technology. By building this system on open-source foundations, the County of Santa Barbara isn’t just solving today’s challenges—it’s creating a blueprint that any county in America can adopt and adapt to their own needs. As electric vehicles become ubiquitous and the demands on our charging infrastructure grow exponentially, tools like these will be essential for managing the transition intelligently. This project proves that local governments don’t need to choose between innovation and sovereignty, between cutting-edge AI and democratic control. With the right approach, communities can harness the full power of artificial intelligence while keeping their data, their decisions, and their future firmly in their own hands. Santa Barbara’s environmental leadership continues, now powered by the same open-source spirit that has driven technological progress for decades.
