


If you've worked with machine learning models on Databricks, you've probably encountered both approaches without realising they're fundamentally different things. You write a few lines in a notebook, call your model, get predictions — that works. But then someone says "let's serve this model" and suddenly there are endpoints, REST APIs, and deployment configurations involved.
So what's actually different? And when should you use one over the other? This blog breaks it down clearly — with real examples from Databricks notebooks.
Running a model in a notebook means loading the model directly into your notebook's Python session and calling it inline. The model lives in memory for the duration of the notebook run. When the session ends, so does the model.
This is what most data scientists do during experimentation — and it's completely appropriate for that stage.


Model: daIn this pattern, the model isn't "running" anywhere on your cluster. You're calling the Databricks Foundation Model API — a managed endpoint Databricks exposes for free-tier models like databricks-gpt-oss-20b. Your notebook calls it like any API call, gets a response, and moves on.
Important distinction
For custom models you've trained yourself, "running in a notebook" means loading the model weights into memory with mlflow.pyfunc.load_model() or similar. The model binary lives on the driver node for the session duration.
One issue we hit in production: the LLM was returning its full response object — including internal reasoning blocks — rather than clean text. The notebook call was working, but the output was wrong.


Model serving is a completely different concept. Instead of calling a model inline from your notebook, you deploy the model as a persistent REST API endpoint that lives outside your notebook session — and can be called by anything: notebooks, applications, dashboards, other services.
Databricks Model Serving creates a managed endpoint backed by auto-scaling compute. When a request comes in, it hits the endpoint. Your notebook session doesn't need to be running at all.
Registering and serving a custom model · MLflow

Notice how in Step 2, the notebook is just making an HTTP request. The model itself is running somewhere else entirely — on Databricks-managed serving infrastructure. The notebook could close and the endpoint would still be live.
Aspect | Running in Notebook | Model Serving |
Where model runs | Driver node / API call inline | Dedicated serving cluster |
Availability | Only while notebook is active | Always-on, independent of notebooks |
Access | Only from within the notebook | REST API — any app, tool, or service |
Scaling | Single cluster, manual | Auto-scales with traffic |
Best for | Experiments, batch jobs, dev | Production apps, real-time inference |
Cost model | Cluster DBUs while notebook runs | Per-token or per-request pricing |
Setup effort | Minimal — just call the model | Register model → configure endpoint → deploy |
Here's a real bug that hits almost every Databricks data engineer at some point — and it has nothing to do with model serving or running. It's about what happens when you mix PySpark and Python in the same notebook session.
When you do from pyspark.sql.functions import *, PySpark silently overwrites Python's built-in functions like round(), min(), max(), and sum(). PySpark's versions of these expect Column objects, not Python floats or integers.
BREAKS with AssertionError

Watch out
This affects round(), min(), max(), sum() — all standard Python builtins that PySpark also defines. The fix is always the same: import builtins and prefix any Python builtin call with builtins.
This one caught us in the Gold layer KPI computation. The original notebook was written assuming certain column names — injury, property, vehicle — but the actual Gold table had different names because the Bronze→Silver→Gold transformations renamed them.
fact_claims KPI · UNRESOLVED_COLUMN error

Best practice
Always run df.printSchema() or check your Unity Catalog table schema before writing aggregation logic. Column names change during transformations — don't assume they match your raw source files.

Use notebook execution when you're exploring data, building a pipeline, running a one-off batch job, or iterating on a model. It's fast to set up and easy to iterate on. The model doesn't need to outlive your session.
Use model serving when your model needs to be consumed by other systems — a web app, a dashboard, an automated pipeline that triggers independently, or any real-time use case. Serving is how you productionise a model.
In most real projects, you do both: you experiment and develop using notebook execution, then graduate to serving when it's time to deploy. Understanding the boundary between the two — and the gotchas in each — is what separates engineers who ship models from those who keep rerunning the same notebook.

Hit the Databricks Free Edition quota wall mid-project. Here's the exact caching pattern that cut my LLM API calls by 80% — and kept my workspace alive.

Navigate Databricks Marketplace like a pro. Learn the 5 key criteria for choosing AI models that match your agents, LLMs, and text generation needs—without the trial-and-error.

Spark optimization isn't always complex; some tweaks have a huge impact. Inferring schemas forces Spark to scan your data twice, slowing ingestion and inflating cost. Explicit schemas avoid the extra pass and make pipelines faster and cheaper.

Cricket is no longer just a game of "gut feelings." This blog uncovers how hidden metrics like Expected Wickets and "Ghost" simulations are winning matches before the first ball. Dive into the high-stakes world where data science meets the 22 yards to redefine the sport.

I tested a simple hypothesis about image similarity - and watched it fail spectacularly when my algorithm said a "3" looks more like an "8" than another "3". The investigation revealed why pixel-by-pixel comparison is too brittle and what humans do effortlessly that machines must learn explicitly.

Passed the Databricks Gen AI Associate Certification with 56 questions in 90 minutes! Here's my honest experience, preparation strategy, time management tricks, and the exact resources that helped me succeed. Real insights for aspiring certificants.

A practical walkthrough of how I reduced heavy batch workloads using Change Data Feed (CDF) in Databricks. This blog shows how CDF helps process only updated records, cutting compute costs and boosting pipeline efficiency.

I dropped a table in Snowflake, then queried to verify it was gone. The system said it doesn't exist, but also showed it consuming 3.57 MB. That contradiction led me down a rabbit hole of metadata delays, missing commands, and hidden costs. Here's what I discovered.

The AI industry has a security problem: data scientists aren't trained in security, ML engineers are working with black-box models, and security pros don't understand GenAI. Learn about the frameworks and tools bridging this gap—from Llama Guard to Databricks' safety features.

Why DELETE isn’t enough under GDPR, and how Time Travel can make sensitive data reappear unless VACUUM is used correctly.

This blog shares my personal journey into Snowflake Gen AI, from early confusion to hands-on clarity. It offers practical study tips, common pitfalls, and guidance to help you prepare effectively and understand Snowflake’s evolving AI capabilities.

Started scrolling Instagram at 2 AM. Saw Cloudflare memes. Fell down a 4-hour research rabbit hole. Discovered that AND database = 'default' could have prevented the whole thing. My sleep schedule is ruined but at least I understand distributed systems now.

Discover the top 10 data pipeline tools every data engineer should know in 2025. From Airflow to Fivetran, learn how each tool powers modern data workflows, supports real-time analytics, and scales across cloud ecosystems.

Confused between a data lake, data warehouse, and data mart? Discover key differences, real-world use cases, and when to use each architecture. Learn how to build a modern, layered data strategy for scalability, governance, and business insights.

Explore what syntax means in the world of data and AI—from SQL and Python to JSON and APIs. Learn why syntax matters, common errors, real-world examples, and essential best practices for data engineers, analysts, and AI developers in 2025.

Discover how AWS Data Pipeline helps automate data movement and transformation across AWS services like S3, Redshift, and EMR. Learn its key features, benefits, limitations, and how it compares to modern tools like AWS Glue and MWAA.

Learn how to build scalable and secure data pipeline architectures in 2024 with best practices, modern tools, and intelligent design. Explore key pillars like scalability, security, observability, and metadata tracking to create efficient and future-proof data workflows.

Explore the key differences between ETL and ELT data integration methods in this comprehensive guide. Learn when to choose each approach, their use cases, and how to implement them for efficient data pipelines, real-time analytics, and scalable solutions.

Learn the essential role of ETL (Extract, Transform, Load) in data engineering. Understand the three phases of ETL, its benefits, and how to implement effective ETL pipelines using modern tools and strategies for better decision-making, scalability, and data quality.

Discover why data orchestration and analysis are essential for modern data systems. Learn how automation tools streamline data workflows, boost insights, and scale with your business

Learn what a data ingestion pipeline is, why it's vital for modern analytics, and how to design scalable, real-time pipelines to power your data systems effectively.

Discover the top 15 data warehouse tools for scalable data management in 2024. Learn how to choose the right platform for analytics, performance, and cost-efficiency.

Confused between a data mart and a data warehouse? Learn the key differences, use cases, and how to choose the right data architecture for your business. Explore best practices, real-world examples, and expert insights from Enqurious.

Discover the top 10 predictive analytics tools to know in 2025—from SAS and Google Vertex AI to RapidMiner and H2O.ai. Learn why predictive analytics is essential for modern businesses and how to choose the right tool for your data strategy.

Explore the key differences between descriptive and predictive analytics, and learn how both can drive smarter decision-making. Discover how these analytics complement each other to enhance business strategies and improve outcomes in 2025 and beyond.

Explore the key differences between predictive and prescriptive analytics, and learn how both can drive smarter decisions, enhance agility, and improve business outcomes. Discover real-world applications and why mastering both analytics approaches is essential for success in 2025 and beyond.

Compare PostgreSQL vs SQL Server in this comprehensive guide. Learn the key differences, strengths, and use cases to help you choose the right database for your business needs, from cost to performance and security.

Learn what Power BI is and how it works in this beginner's guide. Discover its key features, components, benefits, and real-world applications, and how it empowers businesses to make data-driven decisions.

Explore what a Business Intelligence Engineer does—from building data pipelines to crafting dashboards. Learn key responsibilities, tools, and why this role is vital in a data-driven organization.

Discover why data lineage is essential in today’s complex data ecosystems. Learn how it boosts trust, compliance, and decision-making — and how Enqurious helps you trace, govern, and optimize your data journeys.

Learn what a data mart is, its types, and key benefits. Discover how data marts empower departments with faster, targeted data access for improved decision-making, and how they differ from data warehouses and data lakes.

Master data strategy: Understand data mart vs data warehouse key differences, benefits, and use cases in business intelligence. Enqurious boosts your Data+AI team's potential with data-driven upskilling.

Learn what Azure Data Factory (ADF) is, how it works, and why it’s essential for modern data integration, AI, and analytics. This complete guide covers ADF’s features, real-world use cases, and how it empowers businesses to streamline data pipelines. Start your journey with Azure Data Factory today!

Discover the key differences between SQL and MySQL in this comprehensive guide. Learn about their purpose, usage, compatibility, and how they work together to manage data. Start your journey with SQL and MySQL today with expert-led guidance from Enqurious!

Learn Power BI from scratch in 2025 with this step-by-step guide. Explore resources, tips, and common mistakes to avoid as you master data visualization, DAX, and dashboard creation. Start your learning journey today with Enqurious and gain hands-on training from experts!

AI tools like ChatGPT are transforming clinical data management by automating data entry, enabling natural language queries, detecting errors, and simplifying regulatory compliance. Learn how AI is enhancing efficiency, accuracy, and security in healthcare data handling.

Big Data refers to large, complex data sets generated at high speed from various sources. It plays a crucial role in business, healthcare, finance, education, and more, enabling better decision-making, predictive analytics, and innovation.

Discover the power of prompt engineering and how it enhances AI interactions. Learn the key principles, real-world use cases, and best practices for crafting effective prompts to get accurate, creative, and tailored results from AI tools like ChatGPT, Google Gemini, and Claude.

Learn what a Logical Data Model (LDM) is, its key components, and why it’s essential for effective database design. Explore how an LDM helps businesses align data needs with IT implementation, reducing errors and improving scalability.

Discover the power of a Canonical Data Model (CDM) for businesses facing complex data integration challenges. Learn how CDM simplifies communication between systems, improves data consistency, reduces development costs, and enhances scalability for better decision-making.

Discover the 10 essential benefits of Engineering Data Management (EDM) and how it helps businesses streamline workflows, improve collaboration, ensure security, and make smarter decisions with technical data.

Explore how vibe coding is transforming programming by blending creativity, collaboration, and technology to create a more enjoyable, productive, and human-centered coding experience.

Learn how Azure Databricks empowers data engineers to build optimized, scalable, and reliable data pipelines with features like Delta Lake, auto-scaling, automation, and seamless collaboration.

Explore the top 10 data science trends to watch out for in 2025. From generative AI to automated machine learning, discover how these advancements are shaping the future of data science and transforming industries worldwide.

Discover the key differences between data scientists and data engineers, their roles, responsibilities, and tools. Learn how Enqurious helps you build skills in both fields with hands-on, industry-relevant learning.

Discover the 9 essential steps to effective engineering data management. Learn how to streamline workflows, improve collaboration, and ensure data integrity across engineering teams.

Azure Databricks is a cloud-based data analytics platform that combines the power of Apache Spark with the scalability, security, and ease of use offered by Microsoft Azure. It provides a unified workspace where data engineers, data scientists, analysts, and business users can collaborate.

In today's data-driven world, knowing how to make sense of information is a crucial skill. We’re surrounded by test scores, app usage stats, survey responses, and sales figures — and all this raw data on its own isn’t helpful.

In this blog, we will discuss some of the fundamental differences between AI inference vs. training—one that is, by design, artificially intelligent.

This guide provides a clear, actionable roadmap to help you avoid common pitfalls and successfully earn your SnowPro Core Certification, whether you’re making a career pivot or leveling up in your current role.

"Ever had one of those days when you’re standing in line at a store, waiting for a sales assistant to help you find a product?" In this blog we will get to know about -What is RAG, different types of RAG Architectures and pros and cons for each RAG.

Discover how Databricks and Snowflake together empower businesses by uniting big data, AI, and analytics excellence

How do major retailers like Walmart handle thousands of customer queries in real time without breaking a sweat? From answering questions instantly to providing personalized shopping recommendations, conversational AI reshapes how retailers interact with their customers.