# Integrating SoikaStack with SoikaAPI

**For Ubuntu/Linux**

Run the following command to get the Docker bridge IP address

```
ip addr show docker0 | grep -Po 'inet \K[\d.]+'
```

This will output something like: `172.17.0.1`

**For macOS**

Run the following command to get the network interface IP:

```
ifconfig en0 | grep inet | grep -v inet6 | awk '{print $2}'
```

This will output your local IP address, such as: `192.168.1.100`

**Using the IP Address**

Your SoikaStack server URL will be this IP address with the port, typically:

```
http://[your-ip-address]:4141
```

For example: `http://172.17.0.1:4141` or `http://192.168.1.100:4141`

### Step 2: Generate an API Key in SoikaStack <a href="#step-2-generate-an-api-key-in-soikastack" id="step-2-generate-an-api-key-in-soikastack"></a>

1. Log in to your SoikaStack UI (typically at <http://localhost:4141>)
2. Click on your profile icon or username in the top-right corner
3. Select "API Keys" from the dropdown menu
4. Click "Generate New API Key"
5. Enter a descriptive name for the key (e.g., "LLAMA3.2 Integration")
6. Set appropriate permissions
7. Click "Generate Key"
8. **Important**: Copy the displayed API key and save it securely. It will only be shown once.
9.

The API key will look something like: `sk_soika_7dJHG38djh38dJG83jdJG83jdJH83`

### Step 3: Add SoikaStack to SoikaAPI <a href="#step-3-add-soikastack-to-soikaapi" id="step-3-add-soikastack-to-soikaapi"></a>

1. Log in to your Soika Mockingjay
2. Navigate to the Models or Integrations section
3. Look for the "Add LLM" button and click it
4. Fill out the form with the following details:

![](https://soika-labs.gitbook.io/soika-mockingjay/~gitbook/image?url=https%3A%2F%2F2184813754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FBSwkgyDGOD52nsc2FrK2%252Fuploads%252Fd2kv7LsWcoVlmzxtDIom%252Fimage.png%3Falt%3Dmedia%26token%3D6772c76e-af44-4b7b-a241-1b5d67856289\&width=768\&dpr=4\&quality=100\&sign=81382eb7\&sv=2)

**Form Fields**

Field Description Example Value

Model Type

Select the type of model you want to add

LLM

Model Name

Enter a descriptive name for your model

llama3.2

Server URL

Enter your SoikaStack server URL

<http://172.17.0.1:4141>

API Key

Enter the API key you generated in Step 2

sk\_soika\_7dJHG38djh38dJG83jdJG83jdJH83

Completion mode

Select your preferred completion mode

Chat

Functional Calling

Select type of function call

Tool

1. Click "Save" to add the integration

### Step 4: Verify the Integration <a href="#step-4-verify-the-integration" id="step-4-verify-the-integration"></a>

1. After adding the integration, navigate to the "Models" or "Integrations" section
2. Find your newly added SoikaStack model in the list
3. Check that the status shows as "Connected" or "Active"
4. Click on "Test" or "Try" to test the integration with a sample prompt

### Step 5: Configure Model Settings (Optional) <a href="#step-5-configure-model-settings-optional" id="step-5-configure-model-settings-optional"></a>

You may want to adjust settings for your SoikaStack model:

1. Navigate to the model settings
2. Adjust parameters such as:
   * Temperature
   * Max tokens
   * Top P
   * Frequency penalty
   * Presence penalty
3. Save your changes


---

# 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://soika-labs.gitbook.io/soika-mockingjay/adding-llm-in-mockingjay/integrating-soikastack-with-soikaapi.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.
