Use External Models in Databricks: Connecting to Azure, AWS, Google Cloud, Anthropic and More
Summary
- External model integration: This video shows how to leverage a wide set of GenAI models in Databricks, including external connections to Azure, AWS, Google Cloud, Anthropic, Cohere, and AI21 Labs through Mosaic AI Gateway.
- Model comparison and governance: Learn best practices for evaluating multiple models, performing A/B testing between providers, and managing governance and cost control across diverse model deployments.
- Multi-vendor strategy: Discover why connecting to multiple model providers hedges against vendor lock-in, cost fluctuations, and ensures access to the best model for each specific use case.
Use External Models in Databricks: Connecting to Azure, AWS, Google Cloud, Anthropic and More

Talk by Ina Koleva, Product Manager, Databricks
In this video you will learn how to leverage a wide set of GenAI models in Databricks, including external connections to cloud vendors and other model providers. We will cover establishing connection to externally served models, via Mosaic AI Gateway. This will showcase connection to Azure, AWS & Google Cloud models, as well as model vendors like Anthropic, Cohere, AI21 Labs and more. You will also discover best practices on model comparison, governance and cost control on those model deployments.
Databricks Named a Leader in the 2025 Gartner® Magic Quadrant™ for Data Science and Machine Learning Platforms: https://www.databricks.com/blog/databricks-named-leader-2025-gartner-magic-quadrant-data-science-and-machine-learning
Build and deploy quality AI agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements
Chapters
0:00Introduction to external models1:14Challenges in AI deployment7:59Mosaic AI Gateway overview9:46Supported model providers12:31Practical configuration demo18:04Model comparison and testing20:23Quantitative model evaluation23:42Governance and observability28:30Conclusion and summary
FAQs
Why is multi-vendor model access important according to this video?
This video explains that no single model excels at all tasks, and leveraging models from multiple vendors hedges against vendor lock-in, cost fluctuations, and ensures you can quickly adopt new high-performing models as they emerge.
What is Mosaic AI Gateway and how does it work?
Mosaic AI Gateway is the Databricks solution for establishing connections to externally served models, enabling seamless access to models from Azure, AWS, Google Cloud, and vendors like Anthropic, Cohere, and AI21 Labs.
How does this video address model selection?
According to this video, different models excel at different tasks—for example, some are strong at reasoning while others excel at agentic coding assistance—making it important to evaluate and compare models for your specific use case.
What governance and cost controls are available according to this video?
This video covers observability for governance, cost control across different model providers, and best practices for monitoring and optimizing model deployments to ensure both compliance and cost-efficiency.
Full transcript
0:00 Introduction to external models
Hello everyone. So. I'm part of the product team in data bricks and this session is about external models. I just want to see um some hands um who's interested in the Azure implementation of those connecting to Azure, right? Um, connecting to OpenAI models. Okay. More Azure users. All right. Um, AWS users. Bedrock. Okay. Um, all right. I'll show you all of those. Um, so this session is about all of you that are leveraging models from different providers, be it um, metal lama models or the claic models, open AAI, etc. or, you know, a combination of those.
I'm going to show you um what is supported in data bricks. I'm going to show you how to deploy the endpoints, how to query them, and we're going to talk about the best practices around observability, around secure deployments, and uh then we're going to see how you can compare between different models and do AB testing between them just to see which one is the best for your use case. So why this topic is important? The thing is that there is a new model crashing the benchmarks every week.
Um so the world of jai is changing very rapidly. Um at the same time we get models that are performing as well at a lower cost. So being able to very quickly get to those models and implement them in your use cases is quite important to stay on top of innovation. The second reason is um that being highly dependent on a single vendor puts you in a position of you know being very very exposed to cost fluctuation backwards compatibility issues um and so on.
1:14 Challenges in AI deployment
So basically leveraging models from across providers u allows you to hedge against changes in the market and being able to be more portable um no matter what um model comes out um next week being able to swap between those. So you might have been in a situation where you're looking at all of those providers and you're wondering what to use. There's a lot out there. Some of those models are good for one use cases but not as good for the other.
How do we navigate a world like that? I pulled out some benchmarks um recently and this is just to show that there's no oneizefit. There's not one big model that is train on all the data out there and performs very very well in everything that you needed to do. Um you can see that for example grock models over here are performing very well at reasoning and then the cloud models are very very good at agentic coding assistance.
So that might end up being the choice for those use cases. And that llama models are very good at tool use. And this is just to put things in perspective that in your organization with all the different geni use cases that you will find yourself building, you're going to need a different model for each of your use cases. All right? And in a world where you need to navigate all of those vendors, all of those different models, what are some of the things that you need to consider?
So the first thing is being able to achieve high quality. And what you find yourself um needing to do is just provide your team with optionality. All of those models, as I mentioned, change uh week over week. And there's new cost profile models coming out. there's new models that will give you lower latency at the same cost etc. So being able to get all of the optionality to your teams is very important and even more importantly giving them the tooling to evaluate those models against each other and choose the best one for the job.
So you may find yourself choosing cloud models for code assistant but for your content generation marketing campaigns it might be that a fine-tuned llama model is better and for some of your more complex task it might be that a GP model that can reason um over tools and perform this sort of deep research capabilities um might be the choice. The second thing is u standardization. Um my watch is not my clock is not moving.
I don't know doesn't matter. Um so the second thing is around standardization which is needing to access those models in a standardized well across their versions and across providers. You may think of an organization that has teams A, B and C which are trying to make use of let's say Amazon Bedrock and Mistra and Gemini models and maybe some models are on data bricks and it might be the case that let's say team A is authenticating to Gemini models through their Google cloud project and that's how they're reaching those models and maybe team B is leveraging API keys to M trial while actually authenticating to Amazon Bedrock with their AWS access keys and maybe even sourcing some open source models from Amazon Bedrock and maybe there's team C that is actually authenticating through data bricks um and is getting to those models uh from our integration um with Google cloud.
So what you can see over here is that we're just looking at a lot of inconsistency a lot of inconsistency of how they reach those providers. there's a lot of inconsistencies between the code bases. So, it just means that collaboration becomes very very difficult. Um, knowledge transfer becomes difficult and creating reusable assets that are used by all of these GNAI um paths and workflows um becomes nearly impossible.
So, in an ideal scenario, you're basically looking at all of those teams standardizing the way they're reaching model vendors um no matter who they are. Now the third thing is governance and it kind of comes with this standardization but in an ideal world you want to uh govern who has permission to what models. You might have one business unit that is dealing with highly confidential data that you're only comfortable you know exposing to certain providers while others you you can get more permissive.
So being able to govern who can access what in a central manner is very very important. Um, being able to manage credential keys. We've all seen those unfortunate situation where API keys get exposed into the codebase is something you want to avoid with managing multiple API keys to multiple model vendors and applying guardrails as a central team. For example, imposing the guardrail for PII data masking across your organization or applying safety um for content guardrails um across all of those teams.
So you might be you might be looking at a setup where all of those different teams actually make use of a centralized system where you can apply those those guardrails when you can do fine grain permissions management do credentials management um and apply the guardrails in a single location. And the fourth thing is observability with all of those vendors with all of those activities. And we know in the future there's going to be more and more of those.
We want to know who is using what, what are they calling. We want to log everything. We want to know how these models are performing from a quality standpoint. And we want to know how much we're spending on all of those vendors. Maybe you have budget controls that you want to implement on a team by team basis. So having the observability and being able to associate those budget controls um is uh what we're after. So we spoke to a lot of customers about all of these issues and last year we released Mosaic AI gateway and as of summit now it is generally available.
7:59 Mosaic AI Gateway overview
So what is Mosaic AI gateway? Mosaic AI gateway introduces production readiness capabilities on top of all of your endpoints that are served on model serving. And when I say all of your model endpoints, what we mean by that is all of your data bricks hosted endpoints. So your Python models, your foundation models, etc. But also what we call external models and external models are secure connections to models that are served outside of data bricks.
So think about your Azure foundry deployments, your Amazon Bedrock deployments, maybe a GP model, right? So all of those providers the other type of endpoints that we serve on model serving are agents and chains which is an endpoint that contains a system. So, Mosaic AI model serving um providing all of those endpoints and AI gateway serves on uh sits on top of that and it provides you with fine grain permission control, guard rails, being able to do rate limiting, being able to do usage tracking, observability, and so on.
And I'm going to I'm going to show you all of those capabilities, but it sits on top of model serving on all of those endpoints. and you can see where the value is because now you have one single location where you can impose all of that governance um on basically any model no matter if it's on data bricks or if it's somewhere else because you have that linkage. So yeah this this talk right now is um more about external models.
9:46 Supported model providers
So I'm going to dive a little bit deeper on what we support there. So the first level of support we call it the native firstparty supported models um is from providers data bricks anthropic and meta and when I mean native support you don't need to bring your API keys you can just start calling those models in pay as you go manner or provision throughput um just straight from the platform the second level of support for all of these providers is um integration it's integration that means you are providing the associated ated um authentication keys to datab bricks you might be doing this through data bricks secrets and you configure those um when you're creating the endpoint and we will securely then call those uh providers so for AWS bedrock for example that would mean bringing your AWS access key secret access key and for open AAI and Azure foundry it would mean bringing your um API key and I'll show you in a And the third level and this is something that we released recently is custom providers.
So basically any other provider as long as the API schema is open API compatible you can now set up um a custom connection to your favored model vendor and you can register that as a endpoint in data bricks. The other cool thing that custom providers now unlock is custom gateway integration. So all of the challenges that I mentioned earlier, a lot of you actually started encountering those months ago and a lot of you actually build your own AI gateways and they may look something like this.
You have a gateway that propagates your traffic to maybe open AAI. Maybe you're using some open- source models or you have custom models on data bricks and you're doing some rate limiting or just doing it for governance purposes. Now with custom connectors, you can chain the Mosaic AI gateway to the custom AI gateway and you can make use of additional capabilities. For example, you can expand to other vendors or clouds that you didn't have access to before.
Um, and you don't need to build those in necessarily in a DI1 DIY manner in your custom AI gateway. And obviously you can leverage other out of the box capabilities that Mosaic AI gateway has that um might not be in your custom AI gateway for now. So we're we're quite excited for that. So I'm going to jump into demo to show you how to do the connections to all of those providers and we're going to compare the models in um in playground.
12:31 Practical configuration demo
All right. So the first thing that I did is that this is the OpenAI uh dev platform. I generated some API keys here. I also have an Azure foundry deployment. I just chose one of their models. I just chose the five four model, but you can deploy basically anything. And I have the API keys here. And I have the URL that I will need to um call this deployment. And I have a mistrial API keys as well just for demonstrative purposes.
So I have my um my data bricks notebook over here. What I did before this demo is that I configured data bricks secrets. I created a scope and I created secrets inside that scope that has those API keys that I will need for the configuration. This is just so that you don't expose your API keys in the notebooks. Then I have my MLflow deployment client and here and I hope it's big enough. We are creating an open AI connection.
We're creating an external model endpoint that is pointing to OpenAI and it's very very easy. We have the MLflow deployment client. We're doing create endpoint and under serve entities we basically have external model. We have the ID of the model which this one is GPT 401 mini and we have the OpenAI config which is stored in the secrets and that's it. That's how I've now created the connection to OpenAI and I can use that OpenAI model anywhere within data bricks.
So I've also done this for 3. 5 Thurbo um which is a completions model. It's again going with the OpenAI API keys. To show you how to do this with Foundry, I show you my 54 um deployment. Um actually Foundry is done through a custom provider connection and for custom providers you need to provide the custom provider config and here I have the URL and the token. So this URL is actually coming from over here. you copy this um and the token so the API keys is coming from over here it's very very easy you just need to copy those over and now I have a secure connection to that uh particular deployment for Amazon Bedrock how it's done it's an external model I'm connecting to cloud 3.
5 um and for configuration of authentication I have Amazon bedrock config and I have my secret access keys and the region of the deployment for Mistra very similar to foundry I basically have external model it's a custom connection um and we provide the URL and the API keys and here I'm deploying medium model and here I'm deploying the 8B model all right so this is how it works from code and this is the UX it's very very simple um when you're creating a served um when you're creating a served entity you can just um use the UX for this, right?
You can see the datab bricks deployments, but you can also see the external models and you can just start configuring those and enter your keys from here. All right, so I run this and now I have all of these endpoints and now I have six endpoints which are securely pointing to all of those providers and I can start quering them. So let's see, we can open the GPT41. You can do this super simply through like the query interface and just send a query just to test if um if it's working or not or just asking it what data bricks it's giving me an answer.
Um awesome. Um the other thing you can do is uh through a Python client. So over here I have an endpoint. Um I have a client model moflow deployment client and I'm doing um client. predict predict and I am just putting the name of the endpoint and sending the inputs. 4. 1 is a chat model. So the expected input is in messages. But if I was to query a completions model and uh 3. 5 turbo is a completions model. This is how the input would look like.
But it's basically client. predict as any other endpoint. Um the um other cool thing is that um all of those models can be used like a normal data bricks model and that is that you can use them for batch inference for example. So here I have DBSQL um query which is calling um an AI query function which is the way we perform batch in the DBCSQL context. And I have the end point name over here which is GPT 4. 1. And what I've run over here is I've the first column being some articles that I got from an open source data set.
And I'm performing a write me a three sentence long summary and the highlights of this article. And I'm applying this um on a on a on a batch um yeah within batch. So you can you can just swap the name of the endpoint to your data bricks lama deployment or it can be um your bedrock deployment etc. It's all very standard. It's just the name of the endpoint and you can swap them. Um I also wanted to show you um playground where you have we have the split screen with all of the different providers and you know we can ask them anything what is there to do in SF and I have um the open AI model uh next to the mistral model next to the cloud sonet 4 um which is a datab bricks natively provided model right next to the next to each other.
18:04 Model comparison and testing
So you can start um comparing um each of those. All right. So what did we do? So the problem that we used to have in the organization where every new provider used to take weeks to support is now very very easily solved by establishing connection to all of those providers in a consistent in a consistent manner and then being able to query them um in batch with Python, SQL, etc. all of it in the standardized way. There's um very very easy to um it's very very easy to do this across the organization because now we have a standard query interface across providers.
We're no longer in this inconsistent uh scenario that I showed you earlier. And the other um challenge that we've heard from customers is that changing a provider um typically involved changing a lot of the client code because different providers would have different behavior and would expect different type of um of payload. Now it this is no longer the case. It's basically a oneline change of the endpoint name um and your client code can stay the same.
So you can swap models very easily no matter how the market develops. And what used to be a very very difficult way to compare models because they were all exposed in different interfaces. Now you can leverage um playground as we saw to actually do this side by side and see how they how they differ. All right. So you might be uh wondering okay it's it's very cool that I can do a vibe check on playground in how those models are different but what if I want to have some sort of quantitative comparison between those models.
I want to make an informed choice of which model um is better for my use case. So I'm going to show you this now. I got a data set from hugging face. is the same data set I showed you for batch. It basically has a column with um with articles from CNN and it has one column for highlights. It's like three sentence highlights of what this article is about. I took this one um and we just have it as a delta table. I'll show you what it looks like.
20:23 Quantitative model evaluation
Let's go. All right. So yeah, we have articles and we have their um yeah, their summaries on the side over here. So what I've done is I'm going to use all of those endpoints that we have. Well, actually a couple of them, but I'm going to use several of those models in order to try to generate um a three sentences summary of the articles. And then what we're going to do, we're going to compare how good the summaries are against the ground truth that we have from the data set here.
So we're doing this through batch over here which is basically applying AI query with all of the model endpoints generating a three um sentence long summary. And I've saved this into a delta table. So we basically have all of the responses. So you can see we have the llama four responses. For some reason they all start with here's a three sentence summary. Um we have the openi responses 3. 5 and we have the mist trial model um responses over here.
I save this as a table but um if you have uh inference tables um enabled on those endpoints you can actually find those um payloads into into the system tables. Uh but this is easier to visualize. So we have all of these responses. So let's um start to get some quantitative idea of how we're doing. Um I have this this um this notebook over here. And we're going to do a very simple like data sciency comparison. We're going to get the rur scores and the burst bird scores um that just commonly used for um evaluating how good a summary uh is.
Over here we are let me zoom in. We're importing the libraries. We have few function that are basically just computing the scores. We're loading up our table and we're evaluating and we're logging those as um moflow runs within a single experiment so that we can use moflow interface to compare all of those scores from the different models. And we're running this for llama 4 maverick open aai 41 mini 3. 5 turbo and the mistral medium and 8b models.
This is very very simple evaluation. You can do all sorts of you know you can do custom logic on how you're doing this or you can even use agent evaluation lm judges on it. Um so once we run this um what happens is that I have um all of the runs with all of the different models and if we see on the um on the graphs over here I can start comparing like the bird score the R score etc. All right. So, we didn't speak about governance and I want to take some time to also show you um how AI gateway can allow you to do this.
23:42 Governance and observability
You can imagine how difficult it is to actually impose PII masking and guard rails across multiple vendors. So what we're what we've done with AI gateway is to provide you a consistent way to do this and I'm going to show you um in a minute. The other the other thing is we heard from customers that a lot of times they are hitting certain um quotas like limits with let's say their GPD deployments um and they required a fall back strategy.
So let's say you're hitting a GP your GPD model, you're hitting the limit and you want to fall back to let's say a fine-tuned llama model. Um so something we're doing with gateway as well is this fallback capability between providers that wasn't um otherwise available. And the last thing is the general observability. So all of the endpoints that are data bricks deployed endpoints or external model um endpoints they are all basically subjected to the capabilities that are available to a data bricks native model which means inference tables are are active.
You can see usage tracking. You can see payload logging for all of those models and you can build observability dashboards on top of those. All right, let me show you. All right. So, I have this um fi deployment um and I want to enable those governance features on top of it. I can just click configure gateway and I can get all of those um capabilities over here. So, I'm just going to go through them just to tell you what's what.
Um enable usage tracking. This is going to allow me to get the metadata about the usage on this endpoint. enable inference tables would then create a system table that is going to log the input payloads and what the model uh produce and we're going to unpack this for you. So then you're going to have delta tables about everything that is happening um with the with all the predictions that your models are producing. And what's really cool about this is that now it's a delta table that you can start to monitor for let's say there's a quality drop.
Now you can put alerts on the difference of values in that delta table um and you know alert anything downstream um to do root cause analysis on your model because things are going south. Then there is AI guard rails for your input. We have say content safety filters and PII detection and safe for your same for your output as well. We have rate limits and rate limits can be done on a per user or per endpoint basis. Why are rate limits important?
Um well a lot of you might be thinking about rate limits for cost um uh and just availability uh reliance and the feed the fallbacks that I mentioned earlier. So the fallbacks the way they would work is you would need to have multiple served entities on the um endpoint and when we start getting um yeah 409 or 500 um error codes we will basically start falling back to the other served entities um within your endpoint so that your service is still um active.
All right so this is how you enable them. I've already enabled them before that on the GPT for all. You can see how those Let me zoom out a little bit. You can see how those look like um in the console. And you can see under inference tables, we have a delta table within the catalog with all of um all of the requests um that we're getting. Um and you can see yeah like the request messages and the responses etc. So um this is this is basically something you can enable for any of those endpoints.
So you can now do centralized observability no matter how many vendors you're using under the hood because we're treating all of these endpoints the same. So you can build you can imagine building you know observability dashboards on all of the delta tables that capture the payload from bedrock as well as um open AAI as well as your data bricks hosted models. So, you know, we're aiming for this sort of like standardization uh on top of the on top of the model vendors.
Um, all right. So, just a summary of what we covered um is that within data bricks, we can securely allow you to connect to all of those providers. There's more coming very very soon. So tune in um tomorrow. Um I've left the QR code for the gateway. Um so you can read more about it. And just a reminder of the challenges that we're solving solving here. High quality. We're trying to give our developers the widest optionality of models possible.
28:30 Conclusion and summary
Standardization. We're aiming for them to reach those providers as coherently as possible. We're trying to do centralized governance through AI gateway with guardrails, fine grain permission management, auditability on everything um and observability. We're now able to do observability in a standardized way on all of those model providers and build dashboards um as a as a central team. Um so yeah, thank you very much.
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.