# Your Private Coding CoPilot
This guide will use the open source [Continue](https://github.com/continuedev/continue) Visual Studio Code extension configured to work with **Bionic**
1. **Install Continue extension**

2. **Configure Extension**



5. **Config File Setup**

You will find the config file in your home directory under `.continue/config.json`
Open this file and update to your own settings, see example below
```
{
"model": "granite-code:20b",
"contextLength": 8192,
"title": "granite-code",
"systemMessage": "You are an expert software developer. You give helpful and concise responses.",
"provider": "openai",
"apiKey": "yWvqi4SxrpTsoOMMA3TcBQucEESEIk",
"apiBase": "http://192.168.86.208/v1"
},
```
6. **Usage Example**

The prompt contains what appears to be a real API key exposed in plaintext within the configuration example. This is a significant privacy and security concern as it could lead to unauthorized access. The prompt also exposes a local network IP address, which could be sensitive infrastructure information.
# Categorising Credit Card Spend Assistant
You might think categorising your credit card spending would be simple, but over a 3-month period, I found over 200 different vendor entries, even when the card was used at the same location. Let's build an AI assistant to help streamline this process.

### System Prompt
```
You are a credit card spending categorisation assistant.
When provided with a description/name of where the expenditure
took place you will return one of the following categories:
Groceries & Essentials, Dining & Coffee, Transportation,
Shopping & Miscellaneous, Home & Utilities, Entertainment &
Subscriptions, Insurance & Financial Services, Travel &
Accommodations, Health & Wellness, Charity & Donations, Other.
Some examples of entries can be found below
1. Groceries & Essentials
Tesco Stores
Sainsbury’s
Lidl
Farmfoods
2. Dining & Coffee
Starbucks
Pret A Manger
Shake Shack
TGI Friday's
Pho Vietnam
3. Transportation
TFL Travel (London Underground, etc.)
Places for London TFL (Parking, other TFL-related)
4. Shopping & Miscellaneous
Marks & Spencer
Zara
Primark
WH Smith
Other retail stores (e.g., SportsDirect, Royal Cash & Carry, Halfords)
5. Home & Utilities
Southern Water Service
Home Maintenance (e.g., B & Q)
Pets at Home
6. Entertainment & Subscriptions
Netflix (via PayPal)
Amazon Prime
PayPal LinkedIn
Google Play (for apps and entertainment)
Courses or Education-related payments (e.g., Coursera)
7. Insurance & Financial Services
Admiral Insurance
Direct Debit payments (e.g., Smarty, Apple.com/Bill, AppleCare)
8. Travel & Accommodations
The Z Hotel Victoria
Taro Victoria
9. Health & Wellness
Hypnosis Clinic
Revitalize Clinic
Pharmacies (Boots, etc.)
10. Other
Amazon
Ensure you just return just the category without any explanation.
This is for another system that only expects the category.
```
Once created you can use this Assistant directly in the web front end, but what is you have a large number of rows.
For this you can use Bionic's API. Below is a Python application using Pandas to load a set of data and create a new
Category column which can then be used to visualise areas of spend.
```
import pandas as pd
import requests
import json
import matplotlib.pyplot as plt
data = pd.read_csv('/Users/xxx/card-payments.csv')
# Remove payment rows
searchfor = ['PAYMENT', 'THANK YOU', 'REVERSAL','LATE']
data = data[~data.vendor.str.contains('|'.join(searchfor))]
api_key = "xxxx"
url="http://192.168.86.208/v1/chat/completions"
def get_chat_completion(prompt):
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
data = {
"model": "llama3",
"messages": [{"role": "user", "content": prompt}],
"stream": False
}
# Send the POST request with streaming disabled
response = requests.post(url, headers=headers, json=data)
print(response.text)
# Parse the response as JSON
try:
json_response = response.json()
except json.JSONDecodeError:
print("Error: Could not decode the response as JSON.")
return None
# Extract content from the response
generated_text = ""
choices = json_response.get("choices", [])
for choice in choices:
content = choice.get("message", {}).get("content", "")
generated_text += content
return generated_text
#Call above function for each row in dataframe
data['Category'] = data['vendor'].apply(get_chat_completion)
```
The accompanying code exposes sensitive information including a local network IP address and an API key placeholder pattern. The code processes personal financial data (credit card spending) without any mention of data protection, anonymization, or privacy safeguards. The CSV file path also reveals a username.
# AI Assistants

An AI Assistant enables you to create a customised version of a large language model tailored to your specific needs. You can define a "system prompt" that guides how the model should respond to user inputs. Additionally, you can associate uploaded documents (Agentic RAG) with the AI Assistant to enhance its responses with relevant data.
For instance, if you want to create a company-specific Human Resources chatbot, you would set the system prompt to reflect its HR focus and link it to a dataset of your company’s HR documents. Any user query directed at this AI Assistant would then draw on this additional data to provide accurate and context-specific responses.
Clicking on the Chat button for any AI Assistant will open a chat session with the system prompt and with any associated documents as additional input.
## Creating an AI Assistant

Clicking the New Assistant button will show the window displayed on the right of the screen
### Assistant Tab
1. **Assistant Name** - Pick a relevant name. This will be display in the Assiatmt card.
2. **Who should be able to use this assistant?** - Assistants make use of a permissioning model where you can decide who has access to your assistant. A Private Assistant is only available to the user that created it. A **Team** Assistant is available for anyone in the same team as the creator and the **Company** assistant is available to anyone that has an account on the system.
3. **Model** - The mode that will be used for inference
4. **Description** - This description will be displayed in the Assistant card. Make it something that details exactly what the Assistant has been created to do.
Example : This assistant has been preloaded with the latest 10-K filing for the largest 10 tech companies in the US and will answer questions based on their content
5. **System Prompt** - THis is used to direct the intent of the Assistant. It should be written in a manner that directs exactly how you would like user prompts answered.
Example : You are a financial analyst specialising in the US technology sector. You have access to the 10-K filings of these companies. Use the data available to you in the prompt to answer any specific user question about the information appearing in these documents. If you do not know the answer say so.
### Datasets Tab

This tab allows you to associate Datasets with this Assistant.
See xxxx for further information on Datasets
### Examples Tab

This tab allows you to set up a number of example user prompts.
This will aid the user in the use of this assistant. These are displayed when a user clicks on the Assistant Chat button

### Advanced Tab

1. **Temperature** - the temperature is a parameter that controls the randomness of the output, with lower values leading to more focused and deterministic responses, and higher values producing more diverse and creative responses.
2. **Max Number of History Items** - defines how many previous chat messages from your session are included with the latest request, allowing the model to understand the context of your conversation.
3. **Max Tokens** - determines how much of the context window is reserved for the model's response. For smaller context windows, it's recommended to set this to half the size of the model's context window.
4. **Trim Ration** - the way Bionic counts tokens may not match the way the inference engine does. Here you can say how much of the available context to use. i.e. 80% will use 80% of the context_size - max_tokens.
5. **Maximum number of Chunks** - when a dataset(s) is associated, the user prompt is used to retrieve semantically similar information from the dataset(s). This information, along with the user prompt, is then sent to the model to generate a response. This parameter lets you define the number of "similar" chunks of information to be returned, with a default of 10. The chunks are provided in order of similarity.
# Assistants (Prompt Engineering)
Designing a high quality assistant starts with layered prompts. We outline the system, developer, and user prompt shapes we use in production and how to weave guardrails directly into the template.
Examples show how to pass scratchpad context to tools without leaking credentials, plus how to trace prompt revisions via version control.
## Minimal API Example
You can experiment with prompt engineering directly through the same `/api/chat` endpoint used elsewhere in the course. The request below layers the system prompt (“You are a finance assistant”), adds a developer instruction (“Always cite the source”), and passes the user question:
```sh
curl http://localhost:11434/api/chat \
-H "Content-Type: application/json" \
-d '{
"model": "granite4:tiny-h",
"messages": [
{"role": "system", "content": "You are a finance assistant that answers clearly and cites sources."},
{"role": "assistant", "content": "Developer note: cite the latest credit memo if mentioned."},
{"role": "user", "content": "Summarize last quarter revenue and cite the memo."}
]
}'
```
Each entry in `messages` corresponds to one layer of the prompt stack:
- The **system** message sets tone and guardrails.
- The **assistant** message can carry developer hints or scratchpad state.
- The **user** message is the live input from the analyst.
Tailor the three layers, send the request again, and compare the responses. This tight loop helps data scientists see how even small wording changes affect tool use, citations, and reasoning depth.
All prompts here were collected from publicly available sources and are
reproduced for transparency research. Browse the
healthcare category, the
full gallery of 400+ products, or read the
paper behind the AISPA standard.