Close Menu
    Trending
    • Save on Business Supplies with 60% off Sam’s Club Deal
    • Kaggle Playground Series — Season 5, Episode 5 (Predict Calorie Expenditure) | by S R U | Medium
    • How to Master Mental Clarity and Find Your Focus
    • Building an AI-Powered Restaurant Call System: A Deep Dive | by Sinan Aslam | May, 2025
    • Klarna CEO Reverses Course By Hiring More Humans, Not AI
    • From Signal Flows to Hyper-Vectors: Building a Lean LMU-RWKV Classifier with On-the-Fly Hyper-Dimensional Hashing | by Robert McMenemy | May, 2025
    • Here’s How Scaling a Business Really Works
    • A Review of AccentFold: One of the Most Important Papers on African ASR
    Finance StarGate
    • Home
    • Artificial Intelligence
    • AI Technology
    • Data Science
    • Machine Learning
    • Finance
    • Passive Income
    Finance StarGate
    Home»Artificial Intelligence»Build Your Own AI Coding Assistant in JupyterLab with Ollama and Hugging Face
    Artificial Intelligence

    Build Your Own AI Coding Assistant in JupyterLab with Ollama and Hugging Face

    FinanceStarGateBy FinanceStarGateMarch 24, 2025No Comments9 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Jupyter AI brings generative AI capabilities proper into the interface. Having a neighborhood AI assistant ensures privateness, reduces latency, and gives offline performance, making it a strong instrument for builders. On this article, we’ll learn to arrange a neighborhood AI coding assistant in JupyterLab utilizing Jupyter AI, Ollama and Hugging Face. By the tip of this text, you’ll have a totally useful coding assistant in JupyterLab able to autocompleting code, fixing errors, creating new notebooks from scratch, and rather more, as proven within the screenshot beneath.

    Coding assistant in Jupyter Lab through Jupyter AI | Picture by Writer

    ⚠️ Jupyter AI continues to be below heavy growth, so some options could break. As of writing this text, I’ve examined the setup to substantiate it really works, however count on potential changes because the mission evolves. Additionally the efficiency of the assistant depends upon the mannequin that you choose so be sure you select the one that’s match to your use case.

    First issues first — what’s Jupyter AI? Because the title suggests, Jupyter AI is a JupyterLab extension for generative AI. This highly effective instrument transforms your normal Jupyter notebooks or JupyterLab setting right into a generative AI playground. One of the best half? It additionally works seamlessly in environments like Google Colaboratory and Visible Studio Code. This extension does all of the heavy lifting, offering entry to a wide range of mannequin suppliers (each open and closed supply) proper inside your Jupyter setting. 

    Movement diagram of the set up course of | Picture by Writer

    Establishing the setting includes three predominant parts:

    • JupyterLab
    • The Jupyter AI extension
    • Ollama (for Native Mannequin Serving)
    • [Optional] Hugging Face (for GGUF fashions)

    Actually, getting the assistant to resolve coding errors is the simple half. What is hard is making certain all of the installations have been carried out accurately. It’s due to this fact important you comply with the steps accurately.

    1. Putting in the Jupyter AI Extension

    It’s beneficial to create a new environment particularly for Jupyter AI to maintain your current setting clear and organised. As soon as carried out comply with the following steps. Jupyter AI requires JupyterLab 4.x or Jupyter Pocket book 7+, so be sure you have the newest model of Jupyter Lab put in​. You’ll be able to set up/improve JupyterLab with pip or conda:

    # Set up JupyterLab 4 utilizing pip
    pip set up jupyterlab~=4.0

    Subsequent, set up the Jupyter AI extension as follows.

    pip set up "jupyter-ai[all]"

    That is the best technique for set up because it contains all supplier dependencies (so it helps Hugging Face, Ollama, and many others., out of the field). Up to now, Jupyter AI helps the next model providers : 

    Supported Mannequin suppliers in Jupyter AI together with the dependencies | Created by Writer from the documentation

    In case you encounter errors in the course of the Jupyter AI set up, manually set up Jupyter AI utilizing pip with out the [all] optionally available dependency group. This manner you may management which fashions can be found in your Jupyter AI setting. For instance, to put in Jupyter AI with solely added help for Ollama fashions, use the next:

    pip set up jupyter-ai langchain-ollama

    The dependencies depend on the mannequin suppliers (see desk above).  Subsequent, restart your JupyterLab occasion. In case you see a chat icon on the left sidebar, this implies every little thing has been put in completely. With Jupyter AI, you may chat with fashions or use inline magic instructions straight inside your notebooks.

    Native chat UI in JupyterLab | Picture by Writer

    2. Setting Up Ollama for Native Fashions

    Now that Jupyter AI is put in, we have to configure it with a mannequin. Whereas Jupyter AI integrates with Hugging Face fashions straight, some fashions may not work properly. As a substitute, Ollama gives a extra dependable approach to load fashions regionally.

    Ollama is a helpful instrument for operating Large Language Models regionally. It helps you to obtain pre-configured AI fashions from its library. Ollama helps all main platforms (macOS, Home windows, Linux)​, so select the strategy to your OS and obtain and set up it from the official website. After set up, confirm that it’s arrange accurately by operating:

    Ollama --version
    ------------------------------
    ollama model is 0.6.2

    Additionally, be sure that your Ollama server should be operating which you’ll test by calling ollama serve on the terminal:

    $ ollama serve
    Error: pay attention tcp 127.0.0.1:11434: bind: handle already in use

    If the server is already energetic, you will notice an error like above confirming that Ollama is operating and in use.


    Choice 1: Utilizing Pre-Configured Fashions

    Ollama gives a library of pre-trained fashions that you could obtain and run regionally. To start out utilizing a mannequin, obtain it utilizing the pull command. For instance, to make use of qwen2.5-coder:1.5b, run:

    ollama pull qwen2.5-coder:1.5b

    This can obtain the mannequin in your native setting. To verify if the mannequin has been downloaded, run:

    ollama record

    This can record all of the fashions you’ve downloaded and saved regionally in your system utilizing Ollama.

    Choice 2: Loading a Customized Mannequin

    If the mannequin you want isn’t out there in Ollama’s library, you may load a customized mannequin by making a Model File that specifies the mannequin’s supply.For detailed directions on this course of, consult with the Ollama Import Documentation.

    Choice 3: Operating GGUF Fashions straight from Hugging Face

    Ollama now helps GGUF models directly from the Hugging Face Hub, together with each private and non-private fashions. This implies if you wish to use GGUF mannequin straight from Hugging Face Hub you are able to do so with out requiring a customized Mannequin File as talked about in Choice 2 above.

    For instance, to load a 4-bit quantized Qwen2.5-Coder-1.5B-Instruct mannequin from Hugging Face:

    1. First, allow Ollama below your Local Apps settings.

    allow Ollama below your Local Apps settings on Hugging Face | Picture by Writer

    2. On the mannequin web page, select Ollama from the Use this mannequin dropdown as proven beneath.

    Accessing GGUF mannequin from HuggingFace Hub through Ollama | Picture by Writer

    We’re virtually there. In JupyterLab, open the Jupyter AI chat interface on the sidebar. On the high of the chat panel or in its settings (gear icon), there’s a dropdown or discipline to pick the Mannequin supplier and mannequin ID. Select Ollama because the supplier, and enter the mannequin title precisely as proven by Ollama record within the terminal (e.g. qwen2.5-coder:1.5b). Jupyter AI will connect with the native Ollama server and cargo that mannequin for queries​. No API keys are wanted since that is native.

    • Set Language mannequin, Embedding mannequin and inline completions fashions primarily based on the fashions of your selection.
    • Save the settings and return to the chat interface.
    Configure Jupyter AI with Ollama | Picture by Writer

    This configuration hyperlinks Jupyter AI to the regionally operating mannequin through Ollama. Whereas inline completions ought to be enabled by this course of, if that doesn’t occur, you are able to do it manually by clicking on the Jupyternaut icon, which is situated within the backside bar of the JupyterLab interface to the left of the Mode indicator (e.g., Mode: Command). This opens a dropdown menu the place you may choose Allow completions by Jupyternaut to activate the characteristic.

    Enabling code completions in pocket book | Picture by Writer

    As soon as arrange, you should utilize the AI coding assistant for numerous duties like code autocompletion, debugging assist, and producing new code from scratch. It’s necessary to notice right here that you could work together with the assistant both by the chat sidebar or straight in pocket book cells utilizing %%ai magic instructions. Let’s have a look at each the methods.

    Coding assistant through Chat interface

    That is fairly simple. You’ll be able to merely chat with the mannequin to carry out an motion. For example, right here is how we are able to ask the mannequin to elucidate the error within the code after which subsequently repair the error by choosing code within the pocket book.

    Debugging Help Instance utilizing Jupyter AI through Chat | Picture by Writer

    It’s also possible to ask the AI to generate code for a job from scratch, simply by describing what you want in pure language. Here’s a Python perform that returns all prime numbers as much as a given constructive integer N, generated by Jupyternaut.

    Producing New Code from Prompts utilizing Jupyter AI through Chat | Picture by Writer

    Coding assistant through pocket book cell or IPython shell:

    It’s also possible to work together with fashions straight inside a Jupyter pocket book. First, load the IPython extension:

    %load_ext jupyter_ai_magics

    Now, you should utilize the %%ai cell magic to work together along with your chosen language mannequin utilizing a specified immediate. Let’s replicate the above instance however this time throughout the pocket book cells.

    Producing New Code from Prompts utilizing Jupyter AI within the pocket book | Picture by Writer

    For extra particulars and choices you may consult with the official documentation.

    As you may gauge from this text, Jupyter AI makes it simple to arrange a coding assistant, offered you’ve got the precise installations and setup in place. I used a comparatively small mannequin, however you may select from a wide range of fashions supported by Ollama or Hugging Face. The important thing benefit right here is that utilizing a neighborhood mannequin provides important advantages: it enhances privateness, reduces latency, and reduces dependence on proprietary mannequin suppliers. Nonetheless, operating large fashions regionally with Ollama might be resource-intensive so guarantee that you’ve ample RAM. With the fast tempo at which open-source fashions are enhancing, you may obtain comparable efficiency even with these options.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleWhen each human is a line of the dataset | by 侧成峰 | Mar, 2025
    Next Article Hyundai Announces $20 Billion US Investment, New Plant
    FinanceStarGate

    Related Posts

    Artificial Intelligence

    A Review of AccentFold: One of the Most Important Papers on African ASR

    May 10, 2025
    Artificial Intelligence

    Log Link vs Log Transformation in R — The Difference that Misleads Your Entire Data Analysis

    May 10, 2025
    Artificial Intelligence

    What My GPT Stylist Taught Me About Prompting Better

    May 10, 2025
    Add A Comment

    Comments are closed.

    Top Posts

    Building an AI-Powered Restaurant Call System: A Deep Dive | by Sinan Aslam | May, 2025

    May 10, 2025

    How to Grow Your Small Business Without Breaking the Bank

    February 4, 2025

    Does ESG Create Real Value, or Is It Just Smart Marketing?

    March 4, 2025

    How to Build Brand Loyalty Through Micro-Influencers

    April 20, 2025

    Myths vs. Data: Does an Apple a Day Keep the Doctor Away?

    February 6, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    Most Popular

    Google Antitrust Case: ‘Illegal Monopoly,’ Federal Judge Rules

    April 18, 2025

    Movie Recommendation & Rating Prediction using KNN | by Akanksha Gupta | Feb, 2025

    February 26, 2025

    Instant, Explainable Data Insights with Agentic AI

    March 13, 2025
    Our Picks

    Ecologists find computer vision models’ blind spots in retrieving wildlife images | MIT News

    February 9, 2025

    Feature Comparison: Leading RPA Workflow Tools

    March 12, 2025

    Trump Extends TikTok Sale Deadline for 75 Days Again

    April 4, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 Financestargate.com All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.