Skip to content
Public template

About

A simple Streamlit in Snowflake (SiS) app that demonstrates Snowflake Cortex AI functions for text generation using large language models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Simple Streamlit App

A simple Streamlit in Snowflake (SiS) app that demonstrates Snowflake Cortex AI functions for text generation using large language models.

Overview

This app showcases how to call Cortex AI functions directly from a Streamlit app running inside Snowflake. It uses the ai_complete() function to generate text completions powered by LLMs (e.g. claude-4-sonnet).

Repository Structure

simple-streamlit-app/
├── streamlit_app.py        # Main app: prompt pills, editable prompt, ai_complete() call, response + JSON output
├── requirements.txt        # Python dependencies (snowflake-snowpark-python)
├── README.md               # This file
└── .streamlit/
    └── config.toml         # Streamlit theme / app configuration

Requirements

  • A Snowflake account with Cortex AI enabled
  • The snowflake-snowpark-python package (listed in requirements.txt)

Deploying to Streamlit in Snowflake

  1. Open Snowsight and navigate to Projects → Streamlit.
  2. Click + Streamlit App and give it a name (e.g. CORTEX_DEMO).
  3. Select a warehouse, database, and schema for the app.
  4. In the editor, upload or paste the contents of streamlit_app.py as the main file.
  5. In the Packages panel, add snowflake-snowpark-python (or leave it at the default — it is pre-installed in SiS).
  6. Click Run to launch the app.

Note: The app uses st.connection("snowflake") which resolves automatically when running inside Snowflake — no extra credentials or secrets are needed.

Running Locally (Optional)

To run against a Snowflake account from your local machine:

  1. Create a .streamlit/secrets.toml file with your Snowflake connection details:

    [connections.snowflake]
    account   = "<your_account>"
    user      = "<your_user>"
    password  = "<your_password>"
    warehouse = "<your_warehouse>"
    database  = "<your_database>"
    schema    = "<your_schema>"
  2. Install dependencies:

    pip install streamlit snowflake-snowpark-python
  3. Run the app:

    streamlit run streamlit_app.py

Further Reading

About

A simple Streamlit in Snowflake (SiS) app that demonstrates Snowflake Cortex AI functions for text generation using large language models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages