---
license: apache-2.0
datasets:
- StarfleetAI/function-calling
- ajibawa-2023/Code-290k-ShareGPT
language:
- en
library_name: transformers
---

# StarfleetAI Polaris Small

> [!WARNING]  
> Even though the model is not yet meant for production usage, we still encourage you to give it a try and tell us what you think.
>
> Any feedback or suggestions are welcomed!

This model was developed by StarfleetAI with the aim of it being used for autonomous AI agent scenarios.

## Model Details

* Based on `Open-Orca/Mistral-7B-OpenOrca`
* Additionally trained on coding tasks
* Trained for function calling

## Current Features

### `v0.2`

- Improved function calling in long conversations
- Function call arguments became a JSON string to comply with OpenAI

### `v0.1.1`

- Function call response role changed to `tool` to comply with OpenAI

### `v0.1`

- Able to call functions
- Not bad at coding tasks

## Work To Do

- Needs to eliminate some hallucinations (it, for example, sometimes regressing news articles instead of calling the `get_rss_feed` function, and stuff like that)
- Correct typography (`Answer: 123` instead of `Answer:123`)
- Current date / time / timezone conversational abilities ("Schedule a call tomorrow at 6PM")
- Needs some DPO
- Need to be evaluated on relevant metrics

## Prompt Format

We wanted our prompt to:

1. Have a configurable `system` prompt part, which is meant to be changed by the end user.
2. Describe the functions available to the model (in a specific, static place in the prompt, making it easier for the model to identify them).
3. Be capable of carrying additional configuration options in the future, such as the current date/time or the user's name.

In order to fullfill these needs, we designed the prompt format, which seems to tick all the boxes.

### With Functions

```
## Configuration

Functions: enabled

## Available Functions

{ ... }
{ ... }

---

You are a helpful assistant.
```

### Without Functions

```
## Configuration

Functions: disabled

---

You are a helpful assistant.
```

## Functions Calling

In order for the model to call a function, we have introduced two new tokens: `<|fn_start|>` and `<|fn_end|>`. It's safe to assume that if the model decides to call a function, there will be no other response from it except for the function call between these special tokens. If this is not true for some of your cases, please feel free to contact us with examples.

For now, the model is only capable of calling one function at a time.

### Example Function Call

```
<|fn_start|>{"name": "generate_password", "arguments": "{\"length\": 42}"}<|fn_end|>
```

## Function Call Response

The model expects the function call response to be provided right after the function call request from a role `tool`:

```
<|im_start|>tool
{"result": "87cc47fbc865a290d7c7de4be3c893175c51a566b3"}<|im_end|>
```

There are no specific requirements on the response format. Feel free to respond with anything you want.

## Example Conversation

> Newlines after the `<|im_end|>` are included here only for ease of reading. In the actual chat template, we don't use newlines in this position.

```
<|im_start|>system
## Configuration

Functions: enabled

## Available Functions

{"name": "generate_password", "description": "Generate a random password", "parameters": {"type": "object", "properties": {"length": {"type": "integer", "description": "The length of the password"}}, "required": ["length"]}}

---

You are a helpful assistant.<|im_end|>
<|im_start|>user
Generate a password, 42 characters long<|im_end|>
<|im_start|>assistant
<|fn_start|>{"name": "generate_password", "arguments": "{\"length\": 42}"}<|fn_end|><|im_end|>
<|im_start|>tool
{"result": "87cc47fbc865a290d7c7de4be3c893175c51a566b3"}<|im_end|>
<|im_start|>assistant
Here is your random password: 87cc47fbc865a290d7c7de4be3c893175c51a566b3. Please make sure to save it in a secure place.<|im_end|>
```

### Model Description

<!-- Provide a longer summary of what this model is. -->

- **Developed by:** StarfleetAI
- **Model type:** Mistral
- **Language(s) (NLP):** English
- **License:** Apache license 2.0
- **Finetuned from model:** `Open-Orca/Mistral-7B-OpenOrca`

<!-- ## Uses -->

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

<!-- ### Direct Use -->

<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->

<!-- [More Information Needed] -->

<!-- ### Out-of-Scope Use -->

<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->

<!-- [More Information Needed] -->

<!-- ## Bias, Risks, and Limitations -->

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

<!-- [More Information Needed] -->

<!-- ### Recommendations -->

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

<!-- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. -->

<!-- ## How to Get Started with the Model -->

<!-- Use the code below to get started with the model. -->

<!-- [More Information Needed] -->

## Training Details

You can find the trainer code available [on Github](https://github.com/StarfleetAI/polaris/tree/main/small) under the Apache 2.0 license.

<!-- ### Training Data -->

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

<!-- [More Information Needed] -->

<!-- ### Training Procedure -->

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->


<!-- #### Training Hyperparameters -->

<!-- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->

<!-- ## Evaluation -->

<!-- This section describes the evaluation protocols and provides the results. -->

<!-- ### Testing Data, Factors & Metrics -->

<!-- #### Testing Data -->

<!-- This should link to a Dataset Card if possible. -->

<!-- [More Information Needed] -->

<!-- #### Factors -->

<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->

<!-- [More Information Needed] -->

<!-- #### Metrics -->

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

<!-- [More Information Needed] -->

<!-- ### Results -->

<!-- [More Information Needed] -->

<!-- #### Summary -->



<!-- ## Citation -->

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

<!-- **BibTeX:** -->

<!-- [More Information Needed] -->

<!-- **APA:** -->

<!-- [More Information Needed] -->

<!-- ## Model Card Contact -->

<!-- [More Information Needed] -->