Skip to content

This script allows for the management of a server and models for the "Ollama" application. It provides features such as starting, stopping, updating, and launching various models through an interactive menu. Convenient for easily managing Ollama via the command line.

License

Notifications You must be signed in to change notification settings

Superjulien/Ollama_control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ollama Control

Version bash Version sh License Shell

Description

These scripts are designed to provide a user-friendly command-line interface for controlling Ollama servers. This repository contains two scripts for controlling Ollama servers: one written in Bash (ollama_control_forbash) and the other written in sh (ollama_control_forsh). These scripts provide common tasks such as starting, stopping, updating, and launching specific models with Ollama servers, thus simplifying system management.

Features

  • Start Ollama Server: This option starts the Ollama service if it is not already running. The script first checks if the service is already active before attempting to start it.

  • Stop Ollama Server: Stopping the Ollama service is done by first checking if the service is currently running. If it is, the script stops the service; otherwise, it reports that the service is already stopped.

  • Update and Install Ollama: This feature updates and installs the latest version of Ollama by downloading the official installation script from https://ollama.ai/install.sh and executing it via sh. However, this operation can only be performed when the Ollama service is stopped to avoid disruption during the update.

  • List Installed Models: When the Ollama service is active, the script displays a list of models currently installed on the server. It uses the ollama list command to obtain this information.

  • Launch Specific Models: This feature allows the user to select an installed model and launch it with the Ollama server. The script retrieves the list of installed models, then prompts the user to choose a specific model. Once selected, the model is launched with the ollama run command.

  • Check Ollama Server Status: The script can check whether the Ollama service is currently active or stopped using the systemctl is-active command.

Prerequisites

  • Operating System: The script is designed to work on Linux systems.
  • Ollama Installed: Make sure you have installed and configured the Ollama server on your system before using this script. Visit https://ollama.com/ for more information.

Installation

  1. Clone the Repository:

    git clone https://github.com/Superjulien/Ollama_control.git
  2. Navigate to the Project Directory:

    cd Ollama_control
  3. Give Execution Rights to the Script:

    chmod +x ollama_control_forsh.sh

    or

    chmod +x ollama_control_forbash.sh

Usage

  • Run the Script:

    sudo sh ollama_control_forsh.sh

    or

    sudo bash ollama_control_forbash.sh
  • Follow the on-screen instructions to choose from the available options.

Mechanisms

  • Main Loop: The script uses a while true loop to display the menu and wait for user input until they choose to quit.

  • Option Handling: The script uses a case structure to handle the different options selected by the user.

  • Service Status Check: Before performing certain actions, such as starting or stopping the Ollama service, the script first checks whether the service is already active or stopped.

  • Interaction with Ollama: For operations such as listing installed models and launching specific models, the script uses appropriate Ollama commands, such as ollama list and ollama run.

Sponsoring

This software is provided to you free of charge, with the hope that if you find it valuable, you'll consider making a donation to a charitable organization of your choice :

  • SPA (Society for the Protection of Animals): The SPA is one of the oldest and most recognized organizations in France for the protection of domestic animals. It provides shelters, veterinary care, and works towards responsible adoption.

    SPA

  • French Popular Aid: This organization aims to fight against poverty and exclusion by providing food aid, clothing, and organizing recreational activities for disadvantaged individuals.

    SPF

  • Doctors Without Borders (MSF): MSF provides emergency medical assistance to populations in danger around the world, particularly in conflict zones and humanitarian crises.

    MSF

  • Restaurants of the Heart : Restaurants of the Heart provides meals, emergency accommodation, and social services to the underprivileged.

    RDC

  • French Red Cross: The Red Cross offers humanitarian aid, emergency relief, first aid training, as well as social and medical activities for vulnerable individuals.

    CRF

Every small gesture matters and contributes to making a real difference.

License

Ollama Control is open-source software released under the MIT License. This license allows users of this software to use it, modify it, distribute it, and share it freely while preserving transparency and collaboration.

Support

For support email :

Gmail: superjulien Tutanota: superjulien

About

This script allows for the management of a server and models for the "Ollama" application. It provides features such as starting, stopping, updating, and launching various models through an interactive menu. Convenient for easily managing Ollama via the command line.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages