Code Monkey home page Code Monkey logo

llm-locally-using-ollama's Introduction

Run Large Language Models locally using Ollama

Header

Usage in Terminal

First you need to download the Ollama client from the official website ollama.com.

Open a Terminal and use ollama pull <model name> to download a Large Language Model. A complete list of all available models can be found on the Ollama website.

In the Terminal use ollama run <model name> to use the model in the console. You can also add --verbose to the command to get more statistic about the usage of the model.

Ollama1

Ollama2

Usage in Python

I've created two Python scripts to demonstrate the usage of the Ollama Server.

The script main-langchaincommunity.py uses the langchain_community package.

Ollama3

The script main-api.py uses the REST api approach by calling the api/generate endpoint on the Ollama Server.

Ollama4

Before running the Python scripts, make sure to install Python on your PC and also install the required packages by calling pip install -r requirements.txt.

Blog Post / YouTube Video

If you are more interested into details, please see the following medium.com post:

You can also watch the following video on my YouTube channel:

llm-locally-using-ollama's People

Contributors

tsjdev-apps avatar

Watchers

 avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.