Monday, 31 March 2025

Mastering Basic Commands in the Ollama Shell: A Quick Guide

When working with the Ollama shell, knowing the essential commands can make your experience seamless and efficient. Whether you're exploring model details, clearing sessions, or seeking guidance, these basic commands will help you navigate with ease. Here's a breakdown:

 

1. Get Help: /?, /help

If you're unsure about available commands or need guidance, simply type:

>>> /?
Available Commands:
  /set            Set session variables
  /show           Show model information
  /load <model>   Load a session or model
  /save <model>   Save your current session
  /clear          Clear session context
  /bye            Exit
  /?, /help       Help for a command
  /? shortcuts    Help for keyboard shortcuts

Use """ to begin a multi-line message.

>>> /help
Available Commands:
  /set            Set session variables
  /show           Show model information
  /load <model>   Load a session or model
  /save <model>   Save your current session
  /clear          Clear session context
  /bye            Exit
  /?, /help       Help for a command
  /? shortcuts    Help for keyboard shortcuts

Use """ to begin a multi-line message.

This will display a list of available commands and their purposes. It’s a quick way to find your footing.

 

2. Show Model Information: /show

The /show command is a powerful way to explore details about the current model you're working with.

>>> /show
Available Commands:
  /show info         Show details for this model
  /show license      Show model license
  /show modelfile    Show Modelfile for this model
  /show parameters   Show parameters for this model
  /show system       Show system message
  /show template     Show prompt template

 

To view the model's architecture and details, run: /show info

>>> /show info
  Model
    architecture        llama     
    parameters          3.2B      
    context length      131072    
    embedding length    3072      
    quantization        Q4_K_M    

  Parameters
    stop    "<|start_header_id|>"    
    stop    "<|end_header_id|>"      
    stop    "<|eot_id|>"             

  License
    LLAMA 3.2 COMMUNITY LICENSE AGREEMENT                 
    Llama 3.2 Version Release Date: September 25, 2024 

 

The output of /show info command is divided into 3 sections.

 

Section 1. Model Details

This section provides key technical specifications of the model:

 

architecture: The architecture of the model is llama, indicating that it is based on the LLaMA (Large Language Model Meta AI) framework, designed for handling large-scale language modeling tasks.

 

parameters: The model contains 3.2 billion parameters (3.2B). Parameters are the core components of the model that it learns during training. A higher number of parameters often indicates greater complexity and capability.

 

context length: The model can process input sequences of up to 131072 tokens in length. This determines how much text the model can consider at once while generating a response or making predictions.

 

embedding length: The embedding size is 3072, which indicates the dimensionality of the vector representations used for input tokens. Larger embeddings allow the model to encode richer information about the data.

 

quantization: The model uses a quantization technique called Q4_K_M, which reduces the size of the model by representing parameters with lower precision. This improves efficiency while maintaining performance, making it suitable for running on limited hardware resources.

 

Section 2: Parameters

This section lists the stopping tokens for the model, which signal the model when to end its output generation. These are predefined markers:

 

"<|start_header_id|>"
"<|end_header_id|>"
"<|eot_id|>"

When these tokens are encountered, the model knows to terminate the output generation or transition tasks. These tokens ensure outputs are concise and contextually appropriate.

 

Section 3: License

LLAMA 3.2 COMMUNITY LICENSE AGREEMENT:

Indicates the license under which this model is distributed. Licensing dictates how you can use the model, whether it's for personal, academic, or commercial purposes.

 

Version Release Date: September 25, 2024:

The version of the model you’re using was released on this date, ensuring you're aware of the latest updates or improvements.

 

3. Clear Session Context: /clear

Want to start fresh? Use the /clear command to reset the session context. It’s particularly useful when switching tasks or models.

 

Why These Commands Matter?

1.   Efficiency: These commands streamline your workflow by providing immediate access to model information.

2.   Clarity: They help you understand the model's capabilities and limitations.

3.   Convenience: Simplified session management ensures a smooth user experience.

 

Master these basic commands, and you’ll unlock the full potential of the Ollama shell in no time!

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment