# Installation

### Setup environment

#### Create environment

```
python3 -m venv env
```

#### Activate environment

For Mac & Linux

```
source env/bin/activate
```

For Windows(Powershell)

```
env\Scripts\Activate.ps1
```

**Note:** For more information about the Python environment please visit the docs [here](https://docs.python.org/3/library/venv.html#creating-virtual-environments).

### Installation

* **Installation from pypi**

  **Install latest version**

  ```bash
  pip install genai_stack
  ```

  **Install a particular version**

  ```bash
  pip install genai_stack==0.2.5
  ```
* **Install from github**

  ```
  pip install git+https://github.com/aiplanethub/genai-stack.git
  ```

That's it your local setup is ready. Let's go ahead & test it.

### How to run LLM?

Once the installation is complete you're good to go.

**Note**: Here we will be running just an LLM model without any vector stores. We will cover vector stores in the vector store section.

#### Run in a local environment

Currently, we support the following models:

* [GPT4all](https://github.com/aiplanethub/genai-stack/blob/main/documentation/assets/gpt4all.json)
* [GPT3](https://github.com/aiplanethub/genai-stack/blob/main/documentation/assets/gpt3.json)

Import the required model(Here we will use the gpt4all model) and initialize it and predict it.

```python
from genai_stack.model import Gpt4AllModel

llm = Gpt4AllModel.from_kwargs()
model_response = llm.predict("How many countries are there in the world?")
print(model_response["result"])
```

If you directly used Python shell you will get the output if you're using a file to execute the file.

```
python3 <file_name.py>
```

```
# Response from the above command
There are currently 195 recognized independent states in the world.
```

Now you know how to use the GenAI Stack locally.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://genaistack.aiplanet.com/getting-started/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
