# Environment Variables

Sakhi API service supports different environment variables to configure your instance. You can specify the following variables in the `.env` file inside the `root` folder. Refer to the [<mark style="color:purple;">**.env.example**</mark>](https://github.com/Sunbird-AIAssistant/sakhi-api-service) file.<br>

| Variable                 | Description                                            | Type                                  | Default      |
| ------------------------ | ------------------------------------------------------ | ------------------------------------- | ------------ |
| SERVICE\_ENVIRONMENT     | Name of the application instance                       | String                                | `dev`        |
| LOG\_LEVEL               | It's used to define  the level of logs to be captured. | Enum String: `error`, `info`, `debug` | `info`       |
| CONFIG\_INI\_PATH        | Path of config.ini file                                | String                                | `config.ini` |
| REDIS\_HOST              | Redis host URL                                         | String                                | `localhost`  |
| REDIS\_PORT              | Redis port number                                      | Number                                | `6379`       |
| REDIS\_DB                | Redis index                                            | Number                                | `0`          |
| TELEMETRY\_ENDPOINT\_URL | Telemetry service host URL                             | String                                | -            |
| TELEMETRY\_LOG\_ENABLED  | Used to enable/disable telemetry logging.              | Enum String: `true`, `false`          | `true`       |

### LLM

A chat model is a language model that uses chat messages as inputs and returns chat messages as outputs.\
Sakhi API service currently supports 3 LLM types:

1. [OpenAI](#openai)
2. [Azure OpenAI](#azure-openai)
3. [Ollama](#ollama)

These LLMs can be configured with the following env variables:

#### OpenAI

```markdown
LLM_TYPE=openai
OPENAI_API_KEY=<openai_key>
GPT_MODEL=<model_name>
```

#### **Azure OpenAI**

```markdown
LLM_TYPE=azure
AZURE_OPENAI_ENDPOINT=<azure_openai_endpoint_url>
AZURE_OPENAI_API_KEY=<azure_openai_key>
OPENAI_API_VERSION=<azure_openai_api_version>
AZURE_MODEL=<azure_deployment_model>
```

#### **Ollama**

```markdown
LLM_TYPE=ollama
OLLAMA_API_ENDPOINT=<ollama_endpoint_url>
LLM_MODEL=<model_name>
```

{% hint style="info" %}
If no env variables are specified, the service will throw the runtime exception.
{% endhint %}

For more information, Please refer to [LLM](/components/sakhi-api-service/pluggability-of-llm-chat-model.md) page.

### Storage

Storage is used for storing audio files when the user wants output as audio. Users should specify a configuration option, like BUCKET\_TYPE, to choose between different cloud provider services such as AWS S3, OCI, or GCP.

Here's the list of storage available to use in the Sakhi API Service:

1. [OCI](#oci-oracle)
2. [AWS](#aws-amazon)
3. [GCP](#gcp-google)

#### OCI (Oracle)

```markdown
BUCKET_TYPE=oci
BUCKET_ENDPOINT_URL=<oci_bucket_endpoint_url>
BUCKET_REGION_NAME=<oci_bucket_region_name>
BUCKET_NAME=<oci_bucket_name>
BUCKET_SECRET_ACCESS_KEY=<oci_bucket_access_key_id>
BUCKET_ACCESS_KEY_ID=<oci_bucket_access_key_id>
```

#### **AWS (Amazon)**

```markdown
BUCKET_TYPE=aws
BUCKET_REGION_NAME=<aws_bucket_region_name>
BUCKET_NAME=<aws_bucket_name>
BUCKET_SECRET_ACCESS_KEY=<aws_bucket_secret_access_key>
BUCKET_ACCESS_KEY_ID=<aws_bucket_access_key_id>
```

#### **GCP (Google)**

```markdown
BUCKET_TYPE=gcp
BUCKET_NAME=<gcp_bucket_name>
GCP_CONFIG_PATH=<gcp_application_credential_path>
```

{% hint style="info" %}
If no env variables are specified, the service will throw the runtime exception.
{% endhint %}

### Translation

Sakhi API service currently supports 3 translation services and can be configured with the following env variables:

1. [Bhashini Dhruva](#bhashini-dhruva)
2. [Ekstep Dhruva](#ekstep-dhruva)
3. [Google ](#google)

#### **Bhashini Dhruva**

```markdown
TRANSLATION_TYPE=bhashini
BHASHINI_ENDPOINT_URL=<bhashini_api_endpoint_url>
BHASHINI_API_KEY=<bhashini_api_key>
```

#### **Ekstep Dhruva**

```markdown
TRANSLATION_TYPE=dhruva
BHASHINI_ENDPOINT_URL=<bhashini_api_endpoint_url>
BHASHINI_API_KEY=<bhashini_api_key>
```

#### **Google**

```markdown
TRANSLATION_TYPE=google
GCP_CONFIG_PATH=<gcp_application_credential_path>
```

{% hint style="info" %}
If no env variables are specified, the service will throw the runtime exception.
{% endhint %}

### Vector Store

A vector store or vector database refers to a type of database system that specializes in storing and retrieving high-dimensional numerical vectors. These stores are designed for efficient management and indexing of vectors, enabling fast similarity searches.

Here is the list of vector stores/databases available to use in the Sakhi API Service:

1. [Marqo](#marqo)

#### **Marqo**

```shellscript
VECTOR_STORE_TYPE=marqo
VECTOR_STORE_ENDPOINT=http://localhost:8882
EMBEDDING_MODEL=flax-sentence-embeddings/all_datasets_v4_mpnet-base
VECTOR_COLLECTION_NAME=<vector_collection_name>
```

{% hint style="info" %}
If no env variables are specified, the service will throw the runtime exception.
{% endhint %}

For more information, Please refer to [Vector Store](/components/sakhi-api-service/pluggability-of-vector-store.md) page.


---

# 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://ai-assistant.sunbird.org/components/sakhi-api-service/environment-variables.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.
