{"templateName":"blog-page","cssClassNames":"blog-page page basicpage summit-page","allowedRenditionsWidth":["320","480","640","768","960","1200","1440","1920"],"description":"Automate LLM optimization, lower credit consumption, and improve accuracy with Snowflake Cortex AI Function Studio. Discover the Pareto frontier today.","language":"en","title":"AI Models with Cortex AI Function Studio","analyticsPageType":"homepage","analyticsCategory":"general","analyticsSubCategory":"","excludeFromAnalytics":false,":mappedPath":"/en/blog/engineering/cortex-ai-function-studio-optimization/",":type":"snowflake-site/components/structure/page",":items":{"root":{"columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"experiencefragment-banner":"aem-GridColumn aem-GridColumn--default--12","experiencefragment-sub-header":"aem-GridColumn aem-GridColumn--default--12","experiencefragment-pre-footer":"aem-GridColumn aem-GridColumn--default--12","experiencefragment-header":"aem-GridColumn aem-GridColumn--default--12","markup_editor-table":"aem-GridColumn aem-GridColumn--default--12","responsivegrid":"aem-GridColumn aem-GridColumn--default--12","experiencefragment-footer":"aem-GridColumn aem-GridColumn--default--12","markup_editor":"aem-GridColumn aem-GridColumn--default--12","container_47873732":"aem-GridColumn aem-GridColumn--default--12"},":items":{"experiencefragment-banner":{"id":"experiencefragment-1ded4414c3","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/pushdown-banner/pushdown-banner-blank/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/pushdown-banner/pushdown-banner-blank.xfmodel.json?callerPage=/content/snowflake-site/global/en/blog/engineering/cortex-ai-function-studio-optimization"},"experiencefragment-header":{"id":"experiencefragment-4fec21a8cf","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/mega-nav-header/master/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/mega-nav-header/master.xfmodel.json?callerPage=/content/snowflake-site/global/en/blog/engineering/cortex-ai-function-studio-optimization","appliedCssClassNames":"snowflake-sticky-nav-host"},"experiencefragment-sub-header":{"id":"experiencefragment-ab462c0246","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/sub-navigation/engineering-blog-sub-nav/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/sub-navigation/engineering-blog-sub-nav.xfmodel.json?callerPage=/content/snowflake-site/global/en/blog/engineering/cortex-ai-function-studio-optimization"},"responsivegrid":{"columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"container_breadcrumb":"aem-GridColumn aem-GridColumn--default--12","container_main_content":"aem-GridColumn aem-GridColumn--default--12"},":items":{"container_breadcrumb":{"layout":"RESPONSIVE_GRID","columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"breadcrumb":"aem-GridColumn aem-GridColumn--default--12"},"id":"blog-page-breadcrumb-indentation",":type":"snowflake-site/components/container",":items":{"breadcrumb":{"id":"breadcrumb-0efe0fe1ac","breadcrumbItems":[{"title":"Blog","path":"/en/blog/engineering/","active":false},{"title":"Machine Learning","path":"/en/blog/engineering/machine-learning/","active":false},{"title":"How Cortex AI Function Studio can help improve quality while reducing AI inference costs.","path":"/en/blog/engineering/cortex-ai-function-studio-optimization/","active":false}],":type":"snowflake-site/components/blog/breadcrumb"}},":itemsOrder":["breadcrumb"],"appliedCssClassNames":"snowflake-container"},"container_main_content":{"layout":"RESPONSIVE_GRID","columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"flexible_column_container":"aem-GridColumn aem-GridColumn--default--12","related_content":"aem-GridColumn aem-GridColumn--default--12"},"id":"main-content",":type":"snowflake-site/components/container",":items":{"flexible_column_container":{"id":"flexible-column-container-6ea2c6c95a","propertiesId":"snowflake-blog-template-main-container","type":"2-column-60-40","alignColumns":"top","containerMaxWidth":"extra-large","topPadding":"none","bottomPadding":"none","spaceBetween":"none","reverseOnMobile":true,"carouselOnMobile":false,"backgroundImageOption":"none","flexible_column_content_container_1":{"layout":"SIMPLE","id":"container-011f79a054",":type":"snowflake-site/components/flexible-column-container/flexible-column-content-container",":items":{"container_hero":{"layout":"RESPONSIVE_GRID","columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"blog_hero":"aem-GridColumn aem-GridColumn--default--12"},"id":"container-a5bca52950",":type":"snowflake-site/components/container",":items":{"blog_hero":{"id":"blog-hero-78c26114bf","linkedInShareUrl":"https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.snowflake.com%2Fcontent%2Fsnowflake-site%2Fglobal%2Fen%2Fblog%2Fengineering%2Fcortex-ai-function-studio-optimization&title=How+Cortex+AI+Function+Studio+can+help+improve+quality+while+reducing+AI+inference+costs.","twitterShareUrl":"https://x.com/intent/post?url=https%3A%2F%2Fwww.snowflake.com%2Fcontent%2Fsnowflake-site%2Fglobal%2Fen%2Fblog%2Fengineering%2Fcortex-ai-function-studio-optimization&text=How+Cortex+AI+Function+Studio+can+help+improve+quality+while+reducing+AI+inference+costs.","facebookShareUrl":"https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.snowflake.com%2Fcontent%2Fsnowflake-site%2Fglobal%2Fen%2Fblog%2Fengineering%2Fcortex-ai-function-studio-optimization","image":{"id":"image-247a509015","src":"https://www.snowflake.com/adobe/dynamicmedia/deliver/dm-aid--b1aa056b-f206-4c84-bcb1-5337938b10e6/sf-eng-blog-ml-0.png?preferwebp=true&quality=85","height":"720","lazyEnabled":true,"width":"1680",":type":"snowflake-site/components/image"},"authors":[{"authorImage":{"id":"image-aa5a1783d6","src":"https://www.snowflake.com/adobe/dynamicmedia/deliver/dm-aid--2bc20cf3-c141-43b9-82d4-69607b435438/kyle.jpg?preferwebp=true&quality=85","height":"512","alt":"Kyle Schmaus","lazyEnabled":true,"width":"512",":type":"snowflake-site/components/image"},"authorCta":{"id":"button-3d382034cb","showOutboundIcon":false,"buttonLink":{"valid":true,"url":"/en/blog/authors/kyle-schmaus/"},"linkTargetContentType":"DOCUMENT_LEARN",":type":"snowflake-site/components/button","linkType":"SNOWFLAKE_INTERNAL","text":"Kyle Schmaus"}}],"timeToRead":"8","publicationDate":"JUL 21, 2026","tag":{"tagText":"Machine Learning","tagColor":"#29B5E8"},"title":{"lines":["How Cortex AI Function Studio can help improve quality while reducing AI inference costs."],"type":"heading2",":type":"snowflake-site/components/title-v2"},":type":"snowflake-site/components/blog/blog-hero"}},":itemsOrder":["blog_hero"]},"responsivegrid_content":{"columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"blog_text_727590611":"aem-GridColumn aem-GridColumn--default--12","blog_text_2052973076":"aem-GridColumn aem-GridColumn--default--12","code_snippet":"aem-GridColumn aem-GridColumn--default--12","image":"aem-GridColumn aem-GridColumn--default--12","blog_text_290615398":"aem-GridColumn aem-GridColumn--default--12","blog_text":"aem-GridColumn aem-GridColumn--default--12","blog_text_546681775":"aem-GridColumn aem-GridColumn--default--12","blog_text_1879639238":"aem-GridColumn aem-GridColumn--default--12","blog_text_1858018618":"aem-GridColumn aem-GridColumn--default--12","image_1422226906":"aem-GridColumn aem-GridColumn--default--12"},"appliedCssClassNames":"snowflake-layout-container-inner-padding-small",":items":{"blog_text":{"id":"blog-text-2a2b712cff","richText":true,":type":"snowflake-site/components/blog/blog-text"},"blog_text_727590611":{"id":"blog-text-5eb75e86d3","richText":true,":type":"snowflake-site/components/blog/blog-text"},"blog_text_2052973076":{"id":"blog-text-d5c3a735a6","text":"\u003Cp\u003EMany AI engineers building pipelines for unstructured data default to using the most powerful (and most expensive) model for every task. While this approach accelerates prototyping, it often sacrifices efficiency and cost optimization in production. However, as AI adoption matures, organizations are increasingly focused on optimizing AI usage.\u003C/p\u003E\r\n\u003Cp\u003EFor some workloads, prompt tuning with smaller models can deliver comparable results while reducing cost and increasing throughput. The challenge is determining where frontier models are truly necessary and where optimized alternatives can achieve the same outcome.\u003C/p\u003E\r\n\u003Cp\u003EThis requires moving from intuition-based model selection to empirical evaluation and optimization. This is why we are so excited to introduce \u003Ca href=\"https://docs.snowflake.com/en/user-guide/snowflake-cortex/ai-function-studio\" target=\"_blank\" rel=\"noopener noreferrer\"\u003E\u003Cb\u003ECortex AI Function Studio\u003C/b\u003E\u003C/a\u003E, currently in public preview, purpose built to automate this optimization and deployment lifecycle.\u003C/p\u003E\r\n\u003Ch2\u003EBenchmarking real-world complexity\u003C/h2\u003E\r\n\u003Cp\u003EStandard benchmarks often fail to reflect the nuance of actual enterprise AI workloads. In order to demonstrate what the \u003Cb\u003ECortex AI Function Studio\u003C/b\u003E can actually do, we needed a data set that mirrors the complexity of real-world use cases, such as routing nuanced customer support tickets to parsing complex financial inquiries.\u003C/p\u003E\r\n\u003Cp\u003EWe chose the \u003Ca href=\"https://huggingface.co/datasets/legacy-datasets/banking77\" target=\"_blank\" rel=\"noopener noreferrer\"\u003EBANKING77\u003C/a\u003E data set because it represents these challenges. Unlike standard sentiment analysis, this benchmark requires precise intent classification across 77 distinct banking scenarios—ranging from 'card arrival' to 'exchange rate' inquiries. Because it demands high-level domain understanding, BANKING77 serves as an ideal proving ground for the \u003Ca href=\"https://docs.snowflake.com/en/user-guide/snowflake-cortex/ai-function-studio\" target=\"_blank\" rel=\"noopener noreferrer\"\u003E\u003Cb\u003ECortex AI Function Studio\u003C/b\u003E\u003C/a\u003E.\u003C/p\u003E\r\n\u003Cp\u003EOur testing revealed that the AI Function Studio delivers tangible production benefits:\u003C/p\u003E\r\n\u003Cul\u003E\r\n\u003Cli\u003E\u003Cb\u003ESignificant accuracy gains:\u003C/b\u003E Achieve a +4pp improvement over baselines (80% to 84%) while reducing costs by over 50%, from 2.653 to 1.155 credits per 1,000 rows.\u003C/li\u003E\r\n\u003Cli\u003E\u003Cb\u003EOptimized efficiency:\u003C/b\u003E Dynamically balance cost and performance by identifying the Pareto frontier, enabling you to select the leanest model that meets your specific accuracy threshold.\u003C/li\u003E\r\n\u003Cli\u003E\u003Cb\u003EAutomated optimization:\u003C/b\u003E Eliminate manual prompt engineering. The built-in optimization algorithm (GEPA) systematically explores prompt variations and model selection to identify the Pareto frontier.\u003C/li\u003E\r\n\u003Cli\u003E\u003Cb\u003EEnterprise governance:\u003C/b\u003E Deployments result in top-level SQL objects protected by role-based access control (RBAC), ensuring production-grade observability and a simplified interface for downstream consumers.\u003C/li\u003E\r\n\u003C/ul\u003E\r\n\u003Cp\u003EThese results represent an ideal balance of cost and accuracy. To understand how to achieve this for your organization, let's first look at how AI engineers traditionally implement custom logic using \u003Ccode\u003EAI_COMPLETE\u003C/code\u003E, followed by how the Cortex AI Function Studio workflow makes it easy to optimize your AI workloads.\u003C/p\u003E\r\n\u003Ch2\u003EThe path to production with AI_COMPLETE\u003C/h2\u003E\r\n\u003Cp\u003E\u003Ca href=\"https://docs.snowflake.com/en/sql-reference/functions/ai_complete\" target=\"_blank\" rel=\"noopener noreferrer\"\u003E\u003Ccode\u003EAI_COMPLETE\u003C/code\u003E\u003C/a\u003E is our native SQL primitive for granular LLM control. With support for multimodal inputs and custom signatures, it is the primary tool for complex, domain-specific tasks that go beyond off-the-shelf AI functions.\u003C/p\u003E\r\n\u003Cp\u003E\u003Ccode\u003EAI_COMPLETE\u003C/code\u003E offers flexibility, giving AI engineers control over their AI workloads. However, to successfully deploy into production, teams must master three core operational areas:\u003C/p\u003E\r\n\u003Cul\u003E\r\n\u003Cli\u003E\u003Cb\u003EModel selection and cost efficiency:\u003C/b\u003E Teams must pinpoint the most efficient model that meets their accuracy threshold requirements for a given task. The challenge is needing to build out empirical benchmarks across multiple models on your specific data. Without this, many typically default to the largest, most expensive frontier model just to be safe, leading to severe over-provisioning that is not economical.\u003C/li\u003E\r\n\u003Cli\u003E\u003Cb\u003EPrompt refinement:\u003C/b\u003E Teams need to ensure reliable outputs. Achieving this requires highly optimized, task-specific prompts that can consistently handle edge cases. This requires the development of a systematic, data-driven feedback loop to test and iterate on prompts automatically. Instead, many organizations resort to a classic engineering anti-pattern of manual trial-and-error — a cycle that doesn't scale, is slow, and remains notoriously unreliable.\u003C/li\u003E\r\n\u003Cli\u003E\u003Cb\u003EGovernance and production readiness:\u003C/b\u003E Teams must also ensure that AI deployments operate with strict security, role-based access control (RBAC), and continuous usage monitoring. Because we treat every function as a native Snowflake object, you get security, RBAC and observability out of the box — no custom infrastructure required.\u003C/li\u003E\r\n\u003C/ul\u003E\r\n\u003Cp\u003ECortex AI Function Studio resolves these challenges by automating the creation, evaluation, optimization and governance lifecycle. Users interact with the studio conversationally, through \u003Ca href=\"https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code\" target=\"_blank\" rel=\"noopener noreferrer\"\u003ECortex Code\u003C/a\u003E (CLI or Desktop) or the \u003Ca href=\"https://docs.snowflake.com/en/user-guide/ui-snowsight\" target=\"_blank\" rel=\"noopener noreferrer\"\u003ESnowsight\u003C/a\u003E Cortex Code web interface — describing what you want in natural language and iterating interactively. Behind the scenes, the system orchestrates the full pipeline inside your Snowflake account and produces top-level, durable Snowflake objects that are RBAC-governed, observable via account usage views and callable like standard SQL functions.\u003C/p\u003E\r\n\u003Ch2\u003EThe Cortex AI Function Studio workflow\u003C/h2\u003E\r\n\u003Cp\u003ECortex AI Function Studio provides a guided create → evaluate → optimize workflow that takes you from a task description to a production-ready Custom AI Function. Whether you are working with text, documents, or images, the studio automates the development lifecycle. The following walkthrough uses the BANKING77 data set to demonstrate the creation of a custom classification function.\u003C/p\u003E\r\n\u003Ch3\u003ECreate: describe the task, get a working function\u003C/h3\u003E\r\n\u003Cp\u003EIn the create step, we define the task intent, inputs, and expected output format. The studio then generates a clean, production-ready SQL UDF backed by \u003Ccode\u003EAI_COMPLETE\u003C/code\u003E with structured output. For our BANKING77 example, it produces the following function structure:\u003C/p\u003E\r\n","richText":true,":type":"snowflake-site/components/blog/blog-text"},"code_snippet":{"id":"code-snippet-6950c8e686","language":"sql","codeSnippet":"CREATE OR REPLACE FUNCTION CLASSIFY_BANKING_INTENT(TEXT VARCHAR)\r\nRETURNS VARCHAR\r\nLANGUAGE SQL\r\nAS '\r\n  AI_COMPLETE(\r\n    model=''claude-sonnet-4-6'',\r\n    messages=\u003EARRAY_CONSTRUCT(\r\n      OBJECT_CONSTRUCT(\r\n        ''role'', ''system'',\r\n        ''content'', ''You are an expert banking customer service intent classifier...''\r\n      ),\r\n      OBJECT_CONSTRUCT(\r\n        ''role'', ''user'',\r\n        ''content'', ''Classify the following message:'' || TEXT\r\n      )\r\n    ),\r\n    response_format=\u003EPARSE_JSON(''{\r\n      \"type\": \"json\",\r\n      \"schema\": { ... }\r\n    }'')\r\n  ):intent::VARCHAR\r\n';","multiLine":true,":type":"snowflake-site/components/code-snippet"},"blog_text_290615398":{"id":"blog-text-63c6e27262","text":"\u003Ch3\u003EEvaluate: measure accuracy against ground truth\u003C/h3\u003E\r\n\u003Cp\u003EEvaluation is triggered via the agent interfaces, running the function against a labeled data set to return quantified scores and per-row details automatically. A table is provided containing input columns and an &quot;expected output&quot; column. The system supports simple pre-written metrics like exact or fuzzy match, an agentic custom metric writer or LLM-as-judge for tasks where semantic comparisons are needed (note: all metrics must output a score between 0.0 and 1.0, inclusive). The function is evaluated on each row of the data set, and the results are averaged.\u003C/p\u003E\r\n\u003Cp\u003EFor the BANKING77 test data set, the un-optimized function from the create step (using claude-sonnet-4-6) produces a score of 80.0% using the exact match metric.\u003C/p\u003E\r\n\u003Ch3\u003EOptimize: automated search over prompts and models\u003C/h3\u003E\r\n\u003Cp\u003EThe optimization phase utilizes the \u003Ca href=\"https://gepa-ai.github.io/gepa/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003EGenetic-Pareto (GEPA)\u003C/a\u003E algorithm, an iterative technique that uses a reflection model to systematically mutate prompts and logic across a range of \u003Ca href=\"https://docs.snowflake.com/en/sql-reference/functions/ai_complete-prompt-object#arguments\" target=\"_blank\" rel=\"noopener noreferrer\"\u003Emodels\u003C/a\u003E. Central to this process is the identification of the \u003Ca href=\"https://en.wikipedia.org/wiki/Pareto_front\" target=\"_blank\" rel=\"noopener noreferrer\"\u003EPareto frontier\u003C/a\u003E — the set of optimal configurations where no other option achieves higher quality at a lower cost. To ensure efficiency, GEPA prunes any configurations that are statistically dominated, meaning they provide lower quality at a higher or equal cost compared to another candidate on the frontier.\u003C/p\u003E\r\n\u003Cp\u003EFor the BANKING77 example, six models representing different price points and families were explored: \u003Ccode\u003Eopenai-gpt-5-nano\u003C/code\u003E, \u003Ccode\u003Eopenai-gpt-5\u003C/code\u003E, \u003Ccode\u003Eqwen3-32b\u003C/code\u003E, \u003Ccode\u003Eqwen3-vl-235b-a22b\u003C/code\u003E, \u003Ccode\u003Eclaude-haiku-4-6 and claude-sonnet-4-6\u003C/code\u003E. Following optimization, the \u003Ccode\u003Eqwen3-32b\u003C/code\u003E, \u003Ccode\u003Eclaude-haiku-4-6 and claude-sonnet-4-6\u003C/code\u003E models were filtered out entirely, as they were not on the Pareto frontier. The results for the remaining optimal models are shown below.\u003C/p\u003E\r\n","richText":true,":type":"snowflake-site/components/blog/blog-text"},"image":{"id":"image-a89f46fb20","src":"https://www.snowflake.com/adobe/dynamicmedia/deliver/dm-aid--9bba4314-0ee4-4521-8a97-b8854da24cc6/figure-1.-cost-with-cortex-ai-function-studio.png?preferwebp=true&quality=85","height":"1184","alt":"Figure 1. Cost With Cortex AI Function Studio","lazyEnabled":true,"width":"1979","title":"Figure 1. Cost With Cortex AI Function Studio",":type":"snowflake-site/components/image"},"blog_text_1858018618":{"id":"blog-text-d5a25e95f3","text":"\u003Ctable\u003E\r\n\u003Cthead\u003E\u003Ctr\u003E\u003Cth\u003EModel\u003C/th\u003E\r\n\u003Cth\u003ESystem Prompt Input Tokens\u003C/th\u003E\r\n\u003Cth\u003ETest Score\u003C/th\u003E\r\n\u003Cth\u003ECost (Snowflake credits per 1,000 rows of BANKING77 data)\u003C/th\u003E\r\n\u003C/tr\u003E\u003C/thead\u003E\u003Ctbody\u003E\u003Ctr\u003E\u003Ctd\u003Eopenai-gpt-5-nano\u003C/td\u003E\r\n\u003Ctd\u003E613\u003C/td\u003E\r\n\u003Ctd\u003E75.5%\u003C/td\u003E\r\n\u003Ctd\u003E0.048\u003C/td\u003E\r\n\u003C/tr\u003E\u003Ctr\u003E\u003Ctd\u003Eopenai-gpt-5-nano\u003C/td\u003E\r\n\u003Ctd\u003E1407\u003C/td\u003E\r\n\u003Ctd\u003E76.0%\u003C/td\u003E\r\n\u003Ctd\u003E0.087\u003C/td\u003E\r\n\u003C/tr\u003E\u003Ctr\u003E\u003Ctd\u003Eqwen3-vl-235b-a22b\u003C/td\u003E\r\n\u003Ctd\u003E1432\u003C/td\u003E\r\n\u003Ctd\u003E78.0%\u003C/td\u003E\r\n\u003Ctd\u003E0.424\u003C/td\u003E\r\n\u003C/tr\u003E\u003Ctr\u003E\u003Ctd\u003Eopenai-gpt-5\u003C/td\u003E\r\n\u003Ctd\u003E1568\u003C/td\u003E\r\n\u003Ctd\u003E82.0%\u003C/td\u003E\r\n\u003Ctd\u003E0.505\u003C/td\u003E\r\n\u003C/tr\u003E\u003Ctr\u003E\u003Ctd\u003Eopenai-gpt-5\u003C/td\u003E\r\n\u003Ctd\u003E1685\u003C/td\u003E\r\n\u003Ctd\u003E83.0%\u003C/td\u003E\r\n\u003Ctd\u003E1.050\u003C/td\u003E\r\n\u003C/tr\u003E\u003Ctr\u003E\u003Ctd\u003Eopenai-gpt-5\u003C/td\u003E\r\n\u003Ctd\u003E2828\u003C/td\u003E\r\n\u003Ctd\u003E84.0%\u003C/td\u003E\r\n\u003Ctd\u003E1.155\u003C/td\u003E\r\n\u003C/tr\u003E\u003C/tbody\u003E\u003C/table\u003E\r\n","richText":true,":type":"snowflake-site/components/blog/blog-text"},"blog_text_1879639238":{"id":"blog-text-dad72d4126","text":"\u003Cp\u003EBy comparison, the un-optimized claude-sonnet-4-6 function achieved a score of 80.0% and a cost of 2.653 credits per 1,000 rows (Note: token counts given by \u003Ca href=\"https://docs.snowflake.com/en/sql-reference/functions/ai_count_tokens\" target=\"_blank\" rel=\"noopener noreferrer\"\u003E\u003Ccode\u003EAI_COUNT_TOKENS\u003C/code\u003E\u003C/a\u003E).\u003C/p\u003E\r\n\u003Cp\u003EThese results empower practitioners to make empirical decisions aligned with their specific business requirements. Whether a use case demands the highest accuracy for critical workflows or prioritizes cost-efficiency for high-volume data processing, the Pareto frontier identifies the specific model configuration required to meet those thresholds.\u003C/p\u003E\r\n\u003Ch3\u003EDeploy: promote to a governed production artifact\u003C/h3\u003E\r\n\u003Cp\u003EOnce an optimal configuration is identified, the studio promotes it to a Custom AI Function, a durable, RBAC-controlled SQL UDF. This artifact encapsulates the optimized model and prompt, ensuring that the cost-efficiency gains identified during evaluation are locked into production. Because the deployment creates a standardized SQL object, it inherits Snowflake's built-in observability and governance, making it immediately ready for downstream consumption. Furthermore, the workflow remains future-proof; as new model capabilities become available, the studio enables frictionless re-optimization, allowing practitioners to update their functions without manual re-tuning.\u003C/p\u003E\r\n\u003Ch2\u003EGetting started\u003C/h2\u003E\r\n","richText":true,":type":"snowflake-site/components/blog/blog-text"},"image_1422226906":{"id":"image-93ef034b2d","src":"https://www.snowflake.com/adobe/dynamicmedia/deliver/dm-aid--f2d50498-04b9-4e94-9a2c-815df5af53e4/figure-2.-cost-with-cortex-ai-function-studio.png?preferwebp=true&quality=85","height":"469","alt":"Figure 2. Cost With Cortex AI Function Studio","lazyEnabled":true,"width":"631",":type":"snowflake-site/components/image"},"blog_text_546681775":{"id":"blog-text-503edd517e","text":"\u003Cp\u003ECortex AI Function Studio is available today in public preview. Integration begins by invoking the \u003Ccode\u003E/cortex-ai-function-studio\u003C/code\u003E command within Cortex Code to initiate the guided create, evaluate and optimize workflows. This process applies to any task expressible through \u003Ccode\u003EAI_COMPLETE\u003C/code\u003E — from extraction and summarization to complex policy-based filtering. As model capabilities expand, re-running the optimizer against established training data allows for the continuous discovery of the updated cost-quality frontier without manual re-tuning.\u003C/p\u003E\r\n\u003Cp\u003EWith Cortex AI Function Studio, the transition from prototype designed for production is no longer an engineering burden, but a streamlined, data-driven workflow 100% within Snowflake.\u003C/p\u003E\r\n\u003Cp\u003EWe invite you to test these workflows on your own data to see how Cortex AI Function Studio can optimize your specific production requirements.\u003C/p\u003E\r\n","richText":true,":type":"snowflake-site/components/blog/blog-text"}},":itemsOrder":["blog_text","blog_text_727590611","blog_text_2052973076","code_snippet","blog_text_290615398","image","blog_text_1858018618","blog_text_1879639238","image_1422226906","blog_text_546681775"],":type":"wcm/foundation/components/responsivegrid"},"responsivegrid_premium_content_banner":{"columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{},"appliedCssClassNames":"snowflake-responsive-component-top-padding-medium",":items":{},":itemsOrder":[],":type":"wcm/foundation/components/responsivegrid"},"container_author_chip":{"layout":"RESPONSIVE_GRID","columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"author_chip":"aem-GridColumn aem-GridColumn--default--12"},"id":"container-4f1ebb89d0",":type":"snowflake-site/components/container",":items":{"author_chip":{"id":"author-chip-896db141ba","title":{"id":"title","type":"heading2","lines":["Learn more about the authors"],":type":"snowflake-site/components/title-v2"},"authors":[{"authorImage":{"id":"image-aa5a1783d6","src":"https://www.snowflake.com/adobe/dynamicmedia/deliver/dm-aid--2bc20cf3-c141-43b9-82d4-69607b435438/kyle.jpg?preferwebp=true&quality=85","height":"512","alt":"Kyle Schmaus","lazyEnabled":true,"width":"512",":type":"snowflake-site/components/image"},"authorCta":{"id":"button-3d382034cb","showOutboundIcon":false,"buttonLink":{"valid":true,"url":"/en/blog/authors/kyle-schmaus/"},"linkTargetContentType":"DOCUMENT_LEARN",":type":"snowflake-site/components/button","linkType":"SNOWFLAKE_INTERNAL","text":"Kyle Schmaus"},"authorTitle":"Senior Software Engineer, Snowflake"}],":type":"snowflake-site/components/blog/author-chip"}},":itemsOrder":["author_chip"],"appliedCssClassNames":"snowflake-responsive-component-top-padding-medium"}},":itemsOrder":["container_hero","responsivegrid_content","responsivegrid_premium_content_banner","container_author_chip"]},"flexible_column_content_container_2":{"layout":"SIMPLE","id":"container-333f021897",":type":"snowflake-site/components/flexible-column-container/flexible-column-content-container",":items":{"blog_table_of_content":{"id":"blog-table-of-content-543422e83c",":type":"snowflake-site/components/blog/blog-table-of-content","tableOfContents":[]}},":itemsOrder":["blog_table_of_content"]},":type":"snowflake-site/components/flexible-column-container","isActiveTOC":false,"isBlogPage":true},"related_content":{"id":"related-content-329473f652","relatedContent":[],":type":"snowflake-site/components/blog/related-content","isBlogPage":true}},":itemsOrder":["flexible_column_container","related_content"],"appliedCssClassNames":"snowflake-container"}},":itemsOrder":["container_breadcrumb","container_main_content"],":type":"wcm/foundation/components/responsivegrid"},"container_47873732":{"additionalClasses":"section--blog-newsletter","layout":"RESPONSIVE_GRID","columnCount":12,"gridClassNames":"aem-Grid aem-Grid--12 aem-Grid--default--12","columnClassNames":{"flexible_column_cont":"aem-GridColumn aem-GridColumn--default--12"},"id":"container-aeb24a82d0",":type":"snowflake-site/components/container",":items":{"flexible_column_cont":{"id":"flexible-column-container-deaf6b3e31","type":"1-column","alignColumns":"top","containerMaxWidth":"extra-large","topPadding":"small","bottomPadding":"none","spaceBetween":"small","reverseOnMobile":false,"carouselOnMobile":false,"propertiesCSSClasses":"section--blog-newsletter","backgroundImageOption":"none","flexible_column_content_container_1":{"layout":"SIMPLE","id":"container-f3b10ed23d",":type":"snowflake-site/components/flexible-column-container/flexible-column-content-container",":items":{"marketo_v2":{"id":"marketo-v2-d83fd54a09","marketoForm":{"hidden":null,"formId":"3320","edit":false,"successUrl":null,"script":null,"values":null},"title":{"id":"title","type":"heading3","lines":["Subscribe to our blog newsletter","Get the best, coolest and latest delivered to your inbox each week"],":type":"snowflake-site/components/title-v2"},"munchkinId":"252-RFO-227","serverInstance":"252-RFO-227.mktoweb.com","marketoConfigured":true,"formConfigured":true,":type":"snowflake-site/components/form/marketo-v2"},"text":{"id":"text-a44a2bbb50","additionalClasses":"newsletter-disclaimer","text":"\u003Cp\u003EBy submitting this form, I understand Snowflake will process my personal information in accordance with their Privacy Notice.\u003C/p\u003E\r\n","richText":true,":type":"snowflake-site/components/text"}},":itemsOrder":["marketo_v2","text"]},":type":"snowflake-site/components/flexible-column-container","isActiveTOC":false,"isBlogPage":true}},":itemsOrder":["flexible_column_cont"],"appliedCssClassNames":"snowflake-container"},"experiencefragment-pre-footer":{"id":"experiencefragment-d8ddd0af5d","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/get-started-pre-footer/get-started-pre-footer/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/get-started-pre-footer/get-started-pre-footer.xfmodel.json?callerPage=/content/snowflake-site/global/en/blog/engineering/cortex-ai-function-studio-optimization"},"markup_editor":{"id":"markup-editor-f7f9aa71d2","title":"Page CSS","cssContent":"@media screen and (min-width:768px){.snowflake-blog-author-chip-wrapper{justify-content:flex-start}.snowflake-blog-related-content-on-blog-page{max-width:1408px;margin-left:auto;margin-right:auto}.snowflake-text{font-family:Lato,sans-serif;font-weight:400;font-size:16px;line-height:24px}}.section--blog-newsletter{max-width:none;width:100%;padding-left:0;padding-right:0;margin-left:0;margin-right:0;margin-bottom:0}.section--blog-newsletter .mktoField{background-color:transparent !important}.section--blog-newsletter\u003E.container{padding-left:0;padding-right:0}@media screen and (min-width:768px){.section--blog-newsletter\u003E.container{padding-left:0;padding-right:0}}.newsletter-disclaimer p{font-size:14px !important}.section--blog-newsletter .snowflake-marketo-form-container{margin-bottom:24px;background-color:#f6f9fa;gap:48px;box-shadow:none}.section--blog-newsletter .snowflake-title p.snowflake-title-line:first-child{font-family:Texta;font-size:24px;line-height:26px;font-weight:700;margin-bottom:4px}.section--blog-newsletter .snowflake-title p.snowflake-title-line{text-transform:none;font-family:\"Lato\",sans-serif;font-size:16px;line-height:24px;font-weight:normal}@media screen and (min-width:1024px){.section--blog-newsletter .snowflake-marketo-form-container{display:flex;justify-content:center}.section--blog-newsletter .snowflake-title .snowflake-title-line{text-align:left}.section--blog-newsletter .snowflake-marketo-form .mktoFormRow:has(\u003E input[type=\"hidden\"]){flex-grow:0}.section--blog-newsletter .snowflake-marketo-form{display:flex;width:50% !important}.section--blog-newsletter .snowflake-marketo-form .mktoButtonRow{flex-grow:0;width:auto !important;margin-left:0;margin-right:0}.section--blog-newsletter .snowflake-marketo-form .mktoFormRow{flex-grow:1}.section--blog-newsletter\u003E.container{padding-left:0;padding-right:0}.section--blog-newsletter .snowflake-marketo-form-title{width:50%;margin-bottom:0 !important}.section--blog-newsletter .center .snowflake-title{align-items:flex-start}}.snowflake-sub-navigation a.snowflake-sub-navigation-primary-link{width:auto !important}.snowflake-blog-hero{align-items:stretch !important}",":type":"snowflake-site/components/markup-editor","isGSAPEnabled":false},"markup_editor-table":{"id":"markup-editor-9068f4d0ae","title":"Table Styling CSS","cssContent":"#snowflake-blog-template-main-container table{width:100%;background-color:var(--ui-background-01);border-collapse:collapse;border:2px solid var(--ui-background-09);font-family:'Lato',sans-serif;color:var(--ui-background-09)}#snowflake-blog-template-main-container table thead{background-color:var(--ui-01)}#snowflake-blog-template-main-container table th,#snowflake-blog-template-main-container table td{border:2px solid var(--ui-background-09);padding:var(--spacing-01)}",":type":"snowflake-site/components/markup-editor","isGSAPEnabled":false},"experiencefragment-footer":{"id":"experiencefragment-ee4dc38552","localizedFragmentVariationPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/footer/master/jcr:content","configured":true,":type":"snowflake-site/components/experiencefragment","xfModelPath":"/content/experience-fragments/snowflake-site/language-masters/en/site/footer/master.xfmodel.json?callerPage=/content/snowflake-site/global/en/blog/engineering/cortex-ai-function-studio-optimization"}},":itemsOrder":["experiencefragment-banner","experiencefragment-header","experiencefragment-sub-header","responsivegrid","container_47873732","experiencefragment-pre-footer","markup_editor","markup_editor-table","experiencefragment-footer"],":type":"wcm/foundation/components/responsivegrid"}},":itemsOrder":["root"],":hierarchyType":"page",":path":"/content/snowflake-site/global/en/blog/engineering/cortex-ai-function-studio-optimization","isPasswordProtected":false,"analyticsContentTags":["snowflake-site:taxonomy/blog/engineering-blog/machine-learning","snowflake-site:taxonomy/blog/engineering-blog/gen-ai"],"analyticsEnabled":true,"coveoConfig":{"pipeline":"snowflake.com","searchHub":"snowflake.com","organizationId":"snowflakecomputingproduction8neljofn","apiKey":"xx335921a6-2a0a-40f2-a167-e390b4766c3d"},"analyticsDebugMode":false,"analyticsData":{"excludeFromAnalytics":false,"subCategory":"","pageType":"homepage","templateName":"blog-page","siteName":"snowflake","pageUrl":"/content/snowflake-site/global/en/blog/engineering/cortex-ai-function-studio-optimization","language":"en","category":"general","pageName":"How Cortex AI Function Studio can help improve quality while reducing AI inference costs.","contentTags":["snowflake-site:taxonomy/blog/engineering-blog/machine-learning","snowflake-site:taxonomy/blog/engineering-blog/gen-ai"]},"locale":"en"}
  