Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.streamlit/
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Streamlit",
"type": "debugpy",
"request": "launch",
"module": "streamlit",
"args": [
"run",
"${file}"
],
"justMyCode": false,
}
]
}
56 changes: 36 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@

#### Generate publication highlights using AI

### Setting Up OpenAI API Key

To use the OpenAI API, you need to set up an API key and set it as an environment variable.

1. Obtain your OpenAI API key from the [OpenAI website](https://platform.openai.com/api-keys).

2. Set the API key as an environment variable:
- On Windows:
```bash
set OPENAI_API_KEY=your_api_key_here
```
- On macOS and Linux:
```bash
export OPENAI_API_KEY=your_api_key_here
```

Replace `your_api_key_here` with your actual OpenAI API key.

### Installation

#### Clone this repository
Expand Down Expand Up @@ -59,7 +41,7 @@ To install this Python package in a virtual environment, you can use either pip

#### Using Anaconda

1. Create a virtual environment:
1. Create a virtual environment (**Note:** Support for models provided by Dartmouth requires Python 3.10 or higher.):
```bash
conda create --name highlight_env python=3.9
```
Expand All @@ -69,10 +51,44 @@ To install this Python package in a virtual environment, you can use either pip
conda activate highlight_env
```

3. Install the package from the cloned `highlight` directory:
3. Install the package from the cloned `highlight` directory.
```bash
pip install .
```
By default, only OpenAI's models are supported. You can add support for other providers by installing one ore more of the package's optional dependencies:
```bash
pip install ".[anthropic, dartmouth, google, mistral, ollama]"
```

### Configuring the LLMs
You can configure a variety of LLMs, both remote and local, to choose from in the app. To do this, edit the file `config.toml` in the root of this repo.

#### Setting Up API Keys
If any of the configured models require an API key, you need to set them up as Streamlit secrets.

First, you have to acquire the API key from the provider of your choice (e.g., [OpenAI](https://platform.openai.com/api-keys), [Google](https://ai.google.dev/gemini-api/docs/api-key), [Dartmouth](https://developer.dartmouth.edu/keys), [Mistral](https://console.mistral.ai/api-keys/), or [Anthropic](https://console.anthropic.com/settings/keys)).

Then, create a folder named `.streamlit` in the root of this repo. Inside that folder, create a file named `secrets.toml`.

Finally, store your API key(s) in the following format:

```toml
KEY_NAME = "your_api_key_here"
```

Replace `KEY_NAME` with the variable name corresponding to your provider:

| Provider | Variable name |
| -------- | ------- |
| Anthropic | `ANTHROPIC_API_KEY` |
| Dartmouth | `DARTMOUTH_API_KEY` |
| Google | `GOOGLE_API_KEY` |
| Mistral | `MISTRAL_API_KEY` |
| OpenAI | `OPENAI_API_KEY` |


Replace `your_api_key_here` with your actual API key.


### Running the App

Expand Down
Loading