Strong typing (#533)

* refactor: ♻️ get rid of continuedev.src.continuedev structure

* refactor: ♻️ switching back to server folder

* feat: ✨ make config.py imports shorter

* feat: 🔖 publish as pre-release vscode extension

* refactor: ♻️ refactor and add more completion params to ui

* build: 🏗️ download from preview S3
This commit is contained in:
Nate Sesti 2023-10-04 23:47:59 -07:00 • committed by GitHub
parent 257cef697c
commit 279593a848
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
210 changed files with 870 additions and 343 deletions

View file

@ -165,6 +165,11 @@ jobs:
cd extension
npm ci
- name: Add a copy of continuedev to the extension
run: |
cd extension
cp -r ../server/continuedev continuedev
- name: Install react-app Dependencies
run: |
cd extension/react-app

298
.github/workflows/preview.yaml vendored Normal file
View file

@ -0,0 +1,298 @@
name: Publish Preview Extension
on:
push:
branches:
- preview
jobs:
pyinstaller:
strategy:
matrix:
os: [windows-latest, ubuntu-20.04, macos-latest]
runs-on: ${{ matrix.os }}
steps:
# Install Python requirements and build+upload binaries for each platform
- name: Check-out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10.8"
- name: Install Pyinstaller
run: |
pip install pyinstaller
- name: Install Dependencies
run: |
pip install -r continuedev/requirements.txt
- name: Build PyInstaller Executable
run: pyinstaller run.spec
- name: Set permissions
run: |
chmod 777 dist/run
# - name: Test Python Server
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
# run: |
# cd continuedev
# pip install -r dev_requirements.txt
# cd src
# python -m pytest
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}Build
path: dist/*
test-and-package:
needs: pyinstaller
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
# Download corresponding binary artifact for the platform
- name: Create server directory
run: mkdir -p ~/.continue/server/exe
- name: Download Linux build
uses: actions/download-artifact@v2
with:
name: LinuxBuild
path: ~/.continue/server/exe
if: matrix.os == 'ubuntu-20.04'
- name: Download macOS build
uses: actions/download-artifact@v2
with:
name: macOSBuild
path: ~/.continue/server/exe
if: matrix.os == 'macos-latest'
- name: Download Windows build
uses: actions/download-artifact@v2
with:
name: WindowsBuild
path: ~/.continue/server/exe
if: matrix.os == 'windows-latest'
- name: Set permissions
shell: bash
run: |
chmod -R 777 ~/.continue/server/exe
# Setup Node.js and install dependencies
- name: Use Node.js 19.0.0
uses: actions/setup-node@v3
with:
node-version: 19.0.0
- name: Cache extension node_modules
uses: actions/cache@v2
with:
path: extension/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extension/package-lock.json') }}
- name: Cache react-app node_modules
uses: actions/cache@v2
with:
path: extension/react-app/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extension/react-app/package-lock.json') }}
- name: Install extension Dependencies
run: |
cd extension
npm ci
- name: Add a copy of continuedev to the extension
run: |
cd extension
cp -r ../server/continuedev continuedev
- name: Install react-app Dependencies
run: |
cd extension/react-app
npm ci --legacy-peer-deps
# Run tests
- name: Prepare the extension
run: |
cd extension
npm run prepackage
- name: Install Xvfb for Linux and run tests
run: |
sudo apt-get install -y xvfb # Install Xvfb
Xvfb :99 & # Start Xvfb
export DISPLAY=:99 # Export the display number to the environment
cd extension
npm run test
if: matrix.os == 'ubuntu-20.04'
- name: Run extension tests
run: |
cd extension
npm run test
if: matrix.os != 'ubuntu-20.04'
# Create and upload .vsix artifact
- name: Package the extension
run: |
cd extension
npm run package
- name: Upload .vsix as an artifact
uses: actions/upload-artifact@v2
with:
name: vsix-artifact
path: extension/build/*
if: matrix.os == 'ubuntu-20.04'
- name: Upload continue.log
uses: actions/upload-artifact@v2
with:
name: continue-log
path: /home/runner/.continue/continue.log
if: always()
publish:
needs: test-and-package
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
# Checkout and download .vsix artifact
- name: Checkout
uses: actions/checkout@v2
- name: Set up Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Pull latest changes
run: git pull origin preview
- name: Download .vsix artifact
uses: actions/download-artifact@v2
with:
name: vsix-artifact
path: extension/build
# Publish the extension and commit/push the version change
- name: Use Node.js 19.0.0
uses: actions/setup-node@v3
with:
node-version: 19.0.0
- name: Cache extension node_modules
uses: actions/cache@v2
with:
path: extension/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extension/package-lock.json') }}
- name: Install extension Dependencies
run: |
cd extension
npm ci
- name: Publish (Open VSX Registry)
run: |
cd extension
npx ovsx publish -p ${{ secrets.VSX_REGISTRY_TOKEN }} --packagePath ./build/*.vsix --pre-release
- name: Publish
run: |
cd extension
npx vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath ./build/*.vsix --pre-release
- name: Update version in package.json
run: |
cd extension
npm version patch
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "ci: 💚 Update package.json version [skip ci]"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
# Download binaries and upload to S3
- name: Download Linux build
uses: actions/download-artifact@v2
with:
name: LinuxBuild
path: exe/linux
- name: Download macOS build
uses: actions/download-artifact@v2
with:
name: macOSBuild
path: exe/mac
- name: Download Windows build
uses: actions/download-artifact@v2
with:
name: WindowsBuild
path: exe/windows
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload binaries to S3 (continue-server-binaries)
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: continue-server-binaries
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-west-1"
SOURCE_DIR: "exe"
DEST_DIR: "preview"
- name: Upload binaries to S3 (s3.continue.dev)
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: s3.continue.dev
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-west-1"
SOURCE_DIR: "exe"
DEST_DIR: "preview"

10
.vscode/launch.json vendored
View file

@ -20,7 +20,7 @@
"name": "Pytest",
"type": "python",
"request": "launch",
"program": "continuedev/src/continuedev/tests/llm_test.py",
"program": "server/tests/llm_test.py",
"console": "integratedTerminal",
"justMyCode": true,
"subProcess": true
@ -29,14 +29,14 @@
"name": "Reference",
"type": "python",
"request": "launch",
"module": "continuedev.src.continuedev.models.reference.generate",
"module": "server.continuedev.models.reference.generate",
"justMyCode": true
},
{
"name": "Server",
"type": "python",
"request": "launch",
"module": "continuedev.src.continuedev.__main__",
"module": "server.continuedev.__main__",
"args": [
"--port",
"8001"
@ -51,8 +51,8 @@
"name": "Headless",
"type": "python",
"request": "launch",
"module": "continuedev.headless",
"args": ["--config", "continuedev/config.py"],
"module": "server.continuedev.headless",
"args": ["--config", "server/continuedev/config.py"],
"justMyCode": false,
"subProcess": false
},

View file

@ -1,3 +1,3 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/continuedev/.venv/bin/python3"
"python.defaultInterpreterPath": "${workspaceFolder}/server/.venv/bin/python3"
}

View file

@ -1,22 +0,0 @@
# A Dockerfile for quickly building and testing the pyinstaller binary
FROM python:3.9
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install pyinstaller
RUN pip install -r /app/continuedev/requirements.txt
RUN pyinstaller run.spec
RUN chmod +x /app/dist/run
CMD ["/app/dist/run"]

View file

@ -1,4 +0,0 @@
notes.md
config.json
run.build
run.dist

View file

@ -1,5 +0,0 @@
from .src.continuedev.server.main import run_server
def main():
run_server()

View file

@ -1,4 +0,0 @@
main.build
main.dist
run.build
run.dist

View file

@ -1 +0,0 @@
.continue

View file

@ -22,7 +22,7 @@ Setup instructions are below for each (showing the import and config object). Yo
Type '@issue' to reference the title and contents of a GitHub issue.
```python
from continuedev.src.continuedev.plugins.context_providers.github import GitHubIssuesContextProvider
from continuedev.plugins.context_providers.github import GitHubIssuesContextProvider
```
```python
@ -37,7 +37,7 @@ GitHubIssuesContextProvider(
Type '@search' to reference the results of codebase search, just like the results you would get from VS Code search.
```python
from continuedev.src.continuedev.plugins.context_providers.search import SearchContextProvider
from continuedev.plugins.context_providers.search import SearchContextProvider
```
```python
@ -49,7 +49,7 @@ SearchContextProvider() # No arguments necessary
Type '@url' to reference the contents of a URL. You can either reference preset URLs, or reference one dynamically by typing '@url https://example.com'. The text contents of the page will be fetched and used as context.
```python
from continuedev.src.continuedev.plugins.context_providers.url import URLContextProvider
from continuedev.plugins.context_providers.url import URLContextProvider
```
```python
@ -61,7 +61,7 @@ URLContextProvider(preset_urls=["https://continue.dev/docs/customization"])
Type '@diff' to reference all of the changes you've made to your current branch. This is useful if you want to summarize what you've done or ask for a general review of your work before committing.
```python
from continuedev.src.continuedev.plugins.context_providers.diff import DiffContextProvider
from continuedev.plugins.context_providers.diff import DiffContextProvider
```
```python
@ -73,7 +73,7 @@ DiffContextProvider()
Type '@tree' to reference the contents of your current workspace. The LLM will be able to see the nested directory structure of your project.
```python
from continuedev.src.continuedev.plugins.context_providers.filetree import FileTreeContextProvider
from continuedev.plugins.context_providers.filetree import FileTreeContextProvider
```
```python
@ -85,7 +85,7 @@ FileTreeContextProvider()
Type '@google' to reference the results of a Google search. For example, type "@google python tutorial" if you want to search and discuss ways of learning Python.
```python
from continuedev.src.continuedev.plugins.context_providers.google import GoogleContextProvider
from continuedev.plugins.context_providers.google import GoogleContextProvider
```
```python
@ -101,7 +101,7 @@ Note: You can get an API key for free at [serper.dev](https://serper.dev).
Type '@terminal' to reference the contents of your IDE's terminal.
```python
from continuedev.src.continuedev.plugins.context_providers.terminal import TerminalContextProvider
from continuedev.plugins.context_providers.terminal import TerminalContextProvider
```
```python
@ -169,7 +169,7 @@ This example is a situation where you request all of the data (issues in this ca
There are other scenarios where you might want to just get information on demand, for example by typing '@url https://continue.dev/docs/context-providers' and having the ContextProvider fetch the contents of that URL dynamically. For this case, you can implement the `DynamicContextProvider` class like this:
```python
from continuedev.src.continuedev.plugins.context_providers.dynamic import DynamicContextProvider
from continuedev.plugins.context_providers.dynamic import DynamicContextProvider
class ExampleDynamicProvider(DynamicProvider):
title = "example"

View file

@ -27,7 +27,7 @@ Open-Source Models (not local)
In `config.py`, you'll find the `models` property:
```python
from continuedev.src.continuedev.core.models import Models
from continuedev.core.models import Models
config = ContinueConfig(
...
@ -53,7 +53,7 @@ If by chance the provider has the exact same API interface as OpenAI, the `OpenA
If you'd like to use OpenAI models but are concerned about privacy, you can use the Azure OpenAI service, which is GDPR and HIPAA compliant. After applying for access [here](https://azure.microsoft.com/en-us/products/ai-services/openai-service), you will typically hear back within only a few days. Once you have access, instantiate the model like so:
```python
from continuedev.src.continuedev.libs.llm.openai import OpenAI
from continuedev.libs.llm.openai import OpenAI
config = ContinueConfig(
...
@ -100,8 +100,8 @@ def template_alpaca_messages(msgs: List[Dict[str, str]]) -> str:
It can then be used like this:
```python
from continuedev.src.continuedev.libs.llm.chat import template_alpaca_messages
from continuedev.src.continuedev.libs.llm.ollama import Ollama
from continuedev.libs.llm.chat import template_alpaca_messages
from continuedev.libs.llm.ollama import Ollama
...
config=ContinueConfig(
...
@ -114,7 +114,7 @@ config=ContinueConfig(
)
```
This exact function and a few other default implementations are available in [`continuedev.src.continuedev.libs.llm.prompts.chat`](https://github.com/continuedev/continue/blob/main/continuedev/src/continuedev/libs/llm/prompts/chat.py).
This exact function and a few other default implementations are available in [`continuedev.libs.llm.prompts.chat`](https://github.com/continuedev/continue/blob/main/continuedev/src/continuedev/libs/llm/prompts/chat.py).
## Customizing the /edit Prompt
@ -139,7 +139,7 @@ Output nothing except for the code. No code block, no English explanation, no st
It can then be used like this:
```python
from continuedev.src.continuedev.libs.llm.ollama import Ollama
from continuedev.libs.llm.ollama import Ollama
...
config=ContinueConfig(
...
@ -154,4 +154,4 @@ config=ContinueConfig(
)
```
A few pre-made templates are available in [`continuedev.src.continuedev.libs.llm.prompts.edit`](https://github.com/continuedev/continue/blob/main/continuedev/src/continuedev/libs/llm/prompts/edit.py).
A few pre-made templates are available in [`continuedev.libs.llm.prompts.edit`](https://github.com/continuedev/continue/blob/main/continuedev/src/continuedev/libs/llm/prompts/edit.py).

View file

@ -5,7 +5,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Import the `AnthropicLLM` class and set it as the default model:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.anthropic import AnthropicLLM
from continuedev.libs.llm.anthropic import AnthropicLLM
config = ContinueConfig(
...
@ -27,12 +27,16 @@ Claude 2 is not yet publicly released. You can request early access [here](https
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;The API key for the LLM provider.&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;claude-2&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="claude-2"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -7,7 +7,7 @@ See our [5 minute quickstart](https://github.com/continuedev/ggml-server-example
Once the model is running on localhost:8000, change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.ggml import GGML
from continuedev.libs.llm.ggml import GGML
config = ContinueConfig(
...
@ -29,12 +29,16 @@ config = ContinueConfig(
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to use (optional for the GGML class)&quot;, &quot;default&quot;: &quot;ggml&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="ggml"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -5,8 +5,8 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
The Google PaLM API is currently in public preview, so production applications are not supported yet. However, you can [create an API key in Google MakerSuite](https://makersuite.google.com/u/2/app/apikey) and begin trying out the `chat-bison-001` model. Change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.hf_inference_api import GooglePaLMAPI
from continuedev.core.models import Models
from continuedev.libs.llm.hf_inference_api import GooglePaLMAPI
config = ContinueConfig(
...
@ -28,12 +28,16 @@ config = ContinueConfig(
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;Google PaLM API key&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;chat-bison-001&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="chat-bison-001"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -5,8 +5,8 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Hugging Face Inference API is a great option for newly released language models. Sign up for an account and add billing [here](https://huggingface.co/settings/billing), access the Inference Endpoints [here](https://ui.endpoints.huggingface.co), click on “New endpoint”, and fill out the form (e.g. select a model like [WizardCoder-Python-34B-V1.0](https://huggingface.co/WizardLM/WizardCoder-Python-34B-V1.0)), and then deploy your model by clicking “Create Endpoint”. Change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.hf_inference_api import HuggingFaceInferenceAPI
from continuedev.core.models import Models
from continuedev.libs.llm.hf_inference_api import HuggingFaceInferenceAPI
config = ContinueConfig(
...
@ -29,12 +29,16 @@ config = ContinueConfig(
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to use (optional for the HuggingFaceInferenceAPI class)&quot;, &quot;default&quot;: &quot;Hugging Face Inference API&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="Hugging Face Inference API"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -14,12 +14,16 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;huggingface-tgi&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="huggingface-tgi"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -11,7 +11,7 @@ Run the llama.cpp server binary to start the API server. If running on a remote
After it's up and running, change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.llamacpp import LlamaCpp
from continuedev.libs.llm.llamacpp import LlamaCpp
config = ContinueConfig(
...
@ -34,12 +34,16 @@ config = ContinueConfig(
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;llamacpp&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="llamacpp"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -5,7 +5,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
[Ollama](https://ollama.ai/) is an application for Mac and Linux that makes it easy to locally run open-source models, including Llama-2. Download the app from the website, and it will walk you through setup in a couple of minutes. You can also read more in their [README](https://github.com/jmorganca/ollama). Continue can then be configured to use the `Ollama` LLM class:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.ollama import Ollama
from continuedev.libs.llm.ollama import Ollama
config = ContinueConfig(
...
@ -25,12 +25,16 @@ config = ContinueConfig(
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;llama2&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="llama2"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -7,7 +7,7 @@ The OpenAI class can be used to access OpenAI models like gpt-4 and gpt-3.5-turb
If you are locally serving a model that uses an OpenAI-compatible server, you can simply change the `api_base` in the `OpenAI` class like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.openai import OpenAI
from continuedev.libs.llm.openai import OpenAI
config = ContinueConfig(
...
@ -43,11 +43,15 @@ Options for serving models locally with an OpenAI-compatible server include:
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;OpenAI API key&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -36,11 +36,15 @@ These classes support any models available through the OpenAI API, assuming your
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -7,7 +7,7 @@ QueuedLLM exists to make up for LLM servers that cannot handle multiple requests
If you are already using another LLM class and are experiencing this problem, you can just wrap it with the QueuedLLM class like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.queued import QueuedLLM
from continuedev.libs.llm.queued import QueuedLLM
config = ContinueConfig(
...
@ -27,12 +27,16 @@ config = ContinueConfig(
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;queued&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="queued"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -5,8 +5,8 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Replicate is a great option for newly released language models or models that you've deployed through their platform. Sign up for an account [here](https://replicate.ai/), copy your API key, and then select any model from the [Replicate Streaming List](https://replicate.com/collections/streaming-language-models). Change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.replicate import ReplicateLLM
from continuedev.core.models import Models
from continuedev.libs.llm.replicate import ReplicateLLM
config = ContinueConfig(
...
@ -30,12 +30,16 @@ If you don't specify the `model` parameter, it will default to `replicate/llama-
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;Replicate API key&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -5,7 +5,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
TextGenUI is a comprehensive, open-source language model UI and local server. You can set it up with an OpenAI-compatible server plugin, but if for some reason that doesn't work, you can use this class like so:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.text_gen_interface import TextGenUI
from continuedev.libs.llm.text_gen_interface import TextGenUI
config = ContinueConfig(
...
@ -28,12 +28,16 @@ config = ContinueConfig(
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;text-gen-ui&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="text-gen-ui"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -5,8 +5,8 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
The Together API is a cloud platform for running large AI models. You can sign up [here](https://api.together.xyz/signup), copy your API key on the initial welcome screen, and then hit the play button on any model from the [Together Models list](https://docs.together.ai/docs/models-inference). Change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.together import TogetherLLM
from continuedev.core.models import Models
from continuedev.libs.llm.together import TogetherLLM
config = ContinueConfig(
...
@ -30,12 +30,16 @@ config = ContinueConfig(
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;Together API key&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;togethercomputer/RedPajama-INCITE-7B-Instruct&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="togethercomputer/RedPajama-INCITE-7B-Instruct"/>
<ClassPropertyRef name='max_tokens' details='{&quot;title&quot;: &quot;Max Tokens&quot;, &quot;description&quot;: &quot;The maximum number of tokens to generate.&quot;, &quot;default&quot;: 1024, &quot;type&quot;: &quot;integer&quot;}' required={false} default="1024"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -11,7 +11,7 @@ Continue can be deeply customized by editing the `ContinueConfig` object in `~/.
<ClassPropertyRef name='steps_on_startup' details='{&quot;title&quot;: &quot;Steps On Startup&quot;, &quot;description&quot;: &quot;Steps that will be automatically run at the beginning of a new session&quot;, &quot;default&quot;: [], &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;$ref&quot;: &quot;#/definitions/Step&quot;}}' required={false} default="[]"/>
<ClassPropertyRef name='disallowed_steps' details='{&quot;title&quot;: &quot;Disallowed Steps&quot;, &quot;description&quot;: &quot;Steps that are not allowed to be run, and will be skipped if attempted&quot;, &quot;default&quot;: [], &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default="[]"/>
<ClassPropertyRef name='allow_anonymous_telemetry' details='{&quot;title&quot;: &quot;Allow Anonymous Telemetry&quot;, &quot;description&quot;: &quot;If this field is set to True, we will collect anonymous telemetry as described in the documentation page on telemetry. If set to False, we will not collect any data.&quot;, &quot;default&quot;: true, &quot;type&quot;: &quot;boolean&quot;}' required={false} default="True"/>
<ClassPropertyRef name='models' details='{&quot;title&quot;: &quot;Models&quot;, &quot;description&quot;: &quot;Configuration for the models used by Continue. Read more about how to configure models in the documentation.&quot;, &quot;default&quot;: {&quot;default&quot;: {&quot;title&quot;: null, &quot;system_message&quot;: null, &quot;context_length&quot;: 2048, &quot;model&quot;: &quot;gpt-4&quot;, &quot;max_tokens&quot;: 1024, &quot;stop_tokens&quot;: null, &quot;timeout&quot;: 300, &quot;verify_ssl&quot;: null, &quot;ca_bundle_path&quot;: null, &quot;proxy&quot;: null, &quot;prompt_templates&quot;: {}, &quot;api_key&quot;: null, &quot;llm&quot;: null, &quot;class_name&quot;: &quot;OpenAIFreeTrial&quot;}, &quot;summarize&quot;: {&quot;title&quot;: null, &quot;system_message&quot;: null, &quot;context_length&quot;: 2048, &quot;model&quot;: &quot;gpt-3.5-turbo&quot;, &quot;max_tokens&quot;: 1024, &quot;stop_tokens&quot;: null, &quot;timeout&quot;: 300, &quot;verify_ssl&quot;: null, &quot;ca_bundle_path&quot;: null, &quot;proxy&quot;: null, &quot;prompt_templates&quot;: {}, &quot;api_key&quot;: null, &quot;llm&quot;: null, &quot;class_name&quot;: &quot;OpenAIFreeTrial&quot;}, &quot;edit&quot;: null, &quot;chat&quot;: null, &quot;saved&quot;: []}, &quot;allOf&quot;: [{&quot;$ref&quot;: &quot;#/definitions/Models&quot;}]}' required={false} default="{&#x27;default&#x27;: {&#x27;title&#x27;: None, &#x27;system_message&#x27;: None, &#x27;context_length&#x27;: 2048, &#x27;model&#x27;: &#x27;gpt-4&#x27;, &#x27;max_tokens&#x27;: 1024, &#x27;stop_tokens&#x27;: None, &#x27;timeout&#x27;: 300, &#x27;verify_ssl&#x27;: None, &#x27;ca_bundle_path&#x27;: None, &#x27;proxy&#x27;: None, &#x27;prompt_templates&#x27;: {}, &#x27;api_key&#x27;: None, &#x27;llm&#x27;: None, &#x27;class_name&#x27;: &#x27;OpenAIFreeTrial&#x27;}, &#x27;summarize&#x27;: {&#x27;title&#x27;: None, &#x27;system_message&#x27;: None, &#x27;context_length&#x27;: 2048, &#x27;model&#x27;: &#x27;gpt-3.5-turbo&#x27;, &#x27;max_tokens&#x27;: 1024, &#x27;stop_tokens&#x27;: None, &#x27;timeout&#x27;: 300, &#x27;verify_ssl&#x27;: None, &#x27;ca_bundle_path&#x27;: None, &#x27;proxy&#x27;: None, &#x27;prompt_templates&#x27;: {}, &#x27;api_key&#x27;: None, &#x27;llm&#x27;: None, &#x27;class_name&#x27;: &#x27;OpenAIFreeTrial&#x27;}, &#x27;edit&#x27;: None, &#x27;chat&#x27;: None, &#x27;saved&#x27;: []}"/>
<ClassPropertyRef name='models' details='{&quot;title&quot;: &quot;Models&quot;, &quot;description&quot;: &quot;Configuration for the models used by Continue. Read more about how to configure models in the documentation.&quot;, &quot;default&quot;: {&quot;default&quot;: {&quot;title&quot;: null, &quot;model&quot;: &quot;gpt-4&quot;, &quot;system_message&quot;: null, &quot;context_length&quot;: 2048, &quot;stop_tokens&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;timeout&quot;: 300, &quot;verify_ssl&quot;: null, &quot;ca_bundle_path&quot;: null, &quot;proxy&quot;: null, &quot;prompt_templates&quot;: {}, &quot;api_key&quot;: null, &quot;llm&quot;: null, &quot;class_name&quot;: &quot;OpenAIFreeTrial&quot;}, &quot;summarize&quot;: {&quot;title&quot;: null, &quot;model&quot;: &quot;gpt-3.5-turbo&quot;, &quot;system_message&quot;: null, &quot;context_length&quot;: 2048, &quot;stop_tokens&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;timeout&quot;: 300, &quot;verify_ssl&quot;: null, &quot;ca_bundle_path&quot;: null, &quot;proxy&quot;: null, &quot;prompt_templates&quot;: {}, &quot;api_key&quot;: null, &quot;llm&quot;: null, &quot;class_name&quot;: &quot;OpenAIFreeTrial&quot;}, &quot;edit&quot;: null, &quot;chat&quot;: null, &quot;saved&quot;: []}, &quot;allOf&quot;: [{&quot;$ref&quot;: &quot;#/definitions/Models&quot;}]}' required={false} default="{&#x27;default&#x27;: {&#x27;title&#x27;: None, &#x27;model&#x27;: &#x27;gpt-4&#x27;, &#x27;system_message&#x27;: None, &#x27;context_length&#x27;: 2048, &#x27;stop_tokens&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;timeout&#x27;: 300, &#x27;verify_ssl&#x27;: None, &#x27;ca_bundle_path&#x27;: None, &#x27;proxy&#x27;: None, &#x27;prompt_templates&#x27;: {}, &#x27;api_key&#x27;: None, &#x27;llm&#x27;: None, &#x27;class_name&#x27;: &#x27;OpenAIFreeTrial&#x27;}, &#x27;summarize&#x27;: {&#x27;title&#x27;: None, &#x27;model&#x27;: &#x27;gpt-3.5-turbo&#x27;, &#x27;system_message&#x27;: None, &#x27;context_length&#x27;: 2048, &#x27;stop_tokens&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;timeout&#x27;: 300, &#x27;verify_ssl&#x27;: None, &#x27;ca_bundle_path&#x27;: None, &#x27;proxy&#x27;: None, &#x27;prompt_templates&#x27;: {}, &#x27;api_key&#x27;: None, &#x27;llm&#x27;: None, &#x27;class_name&#x27;: &#x27;OpenAIFreeTrial&#x27;}, &#x27;edit&#x27;: None, &#x27;chat&#x27;: None, &#x27;saved&#x27;: []}"/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature parameter for sampling from the LLM. Higher temperatures will result in more random output, while lower temperatures will result in more predictable output. This value ranges from 0 to 1.&quot;, &quot;default&quot;: 0.5, &quot;type&quot;: &quot;number&quot;}' required={false} default="0.5"/>
<ClassPropertyRef name='custom_commands' details='{&quot;title&quot;: &quot;Custom Commands&quot;, &quot;description&quot;: &quot;An array of custom commands that allow you to reuse prompts. Each has name, description, and prompt properties. When you enter /&lt;name&gt; in the text input, it will act as a shortcut to the prompt.&quot;, &quot;default&quot;: [{&quot;name&quot;: &quot;test&quot;, &quot;prompt&quot;: &quot;Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don&#x27;t edit any file.&quot;, &quot;description&quot;: &quot;This is an example custom command. Use /config to edit it and create more&quot;}], &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;$ref&quot;: &quot;#/definitions/CustomCommand&quot;}}' required={false} default="[{&#x27;name&#x27;: &#x27;test&#x27;, &#x27;prompt&#x27;: &quot;Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don&#x27;t edit any file.&quot;, &#x27;description&#x27;: &#x27;This is an example custom command. Use /config to edit it and create more&#x27;}]"/>
<ClassPropertyRef name='slash_commands' details='{&quot;title&quot;: &quot;Slash Commands&quot;, &quot;description&quot;: &quot;An array of slash commands that let you map custom Steps to a shortcut.&quot;, &quot;default&quot;: [], &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;$ref&quot;: &quot;#/definitions/SlashCommand&quot;}}' required={false} default="[]"/>

View file

@ -46,8 +46,6 @@ config=ContinueConfig(
6. When you open a workspace, Continue will generate the embeddings. You can then enter '/codebase \<QUESTION\>' to ask a question with embeddings-based retrieval.
7. Please share feedback in [Discord](https://discord.gg/NWtdYexhMs)!
> Note: There is a known bug that requires different imports for the PyPI package. If you encounter "No module named 'continuedev.src', you should replace all instances of 'continuedev.src.continuedev' in `config.py` with just 'continuedev'.
## Parameters
After retrieving the top `n_retrieve` results from the vector database, an additional re-reranking step uses 2 LLM calls to select the top `n_final` results to use to answer the question. If you want to increase the speed of the query at the cost of relevancy, you can skip the re-ranking step by setting `use_reranking` to `False`. Then the top `n_final` results will just be directly calculated from the vector database.

View file

@ -12,8 +12,8 @@ If you haven't already installed Continue, you can do that [here](https://market
4. Update your Continue config file to look like this:
```python
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.together import TogetherLLM
from continuedev.core.models import Models
from continuedev.libs.llm.together import TogetherLLM
config = ContinueConfig(
...
@ -33,7 +33,7 @@ config = ContinueConfig(
3. Change your Continue config file to look like this:
```python
from continuedev.src.continuedev.libs.llm.ollama import Ollama
from continuedev.libs.llm.ollama import Ollama
config = ContinueConfig(
...
@ -53,8 +53,8 @@ config = ContinueConfig(
2. Change your Continue config file to look like this:
```python
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.replicate import ReplicateLLM
from continuedev.core.models import Models
from continuedev.libs.llm.replicate import ReplicateLLM
config = ContinueConfig(
...

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "0.0.410",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "0.0.410",
"version": "0.0.412",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",

View file

@ -1,7 +1,7 @@
{
"name": "continue",
"icon": "media/terminal-continue.png",
"version": "0.0.410",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
@ -209,7 +209,8 @@
"build-test": "tsc && node esbuild.test.mjs",
"test": "npm run build-test && node ./out/test-runner/runTestOnVSCodeHost.js",
"prepackage": "node scripts/prepackage.js",
"package": "node scripts/package.js"
"package": "node scripts/package.js",
"package:pre-release": "node scripts/package.js --pre-release"
},
"devDependencies": {
"@nestjs/common": "^8.4.7",

View file

@ -3,7 +3,7 @@ import { LLM } from "../../../schema/LLM";
import {
Label,
Select,
TextInput,
Input,
defaultBorderRadius,
lightGray,
vscForeground,
@ -58,7 +58,7 @@ function ModelSettings(props: { llm: any | undefined; role: string }) {
{typeof modelOptions.api_key !== undefined && (
<>
<Label fontSize={getFontSize()}>API Key</Label>
<TextInput
<Input
type="text"
defaultValue={props.llm.api_key}
placeholder="API Key"
@ -69,7 +69,7 @@ function ModelSettings(props: { llm: any | undefined; role: string }) {
{modelOptions.model && (
<>
<Label fontSize={getFontSize()}>Model</Label>
<TextInput
<Input
type="text"
defaultValue={props.llm.model}
placeholder="Model"

View file

@ -1,5 +1,5 @@
import { useContext } from "react";
import { Button, TextInput } from "..";
import { Button, Input } from "..";
import { GUIClientContext } from "../../App";
import { useDispatch } from "react-redux";
import {
@ -27,7 +27,7 @@ function AddContextGroupDialog({
return (
<div className="p-4">
<TextInput
<Input
defaultValue="My Context Group"
type="text"
ref={(input) => {

View file

@ -1,6 +1,6 @@
import React, { useContext } from "react";
import styled from "styled-components";
import { Button, TextInput } from "..";
import { Button, Input } from "..";
import { useNavigate } from "react-router-dom";
import { GUIClientContext } from "../../App";
import { useDispatch } from "react-redux";
@ -37,7 +37,7 @@ function FTCDialog() {
OpenAIFreeTrial object.
</p>
<TextInput
<Input
type="text"
placeholder="Enter your OpenAI API key"
value={apiKey}

View file

@ -92,7 +92,7 @@ export const H3 = styled.h3`
width: fit-content;
`;
export const TextInput = styled.input.attrs({ type: "text" })`
export const Input = styled.input`
width: 100%;
padding: 8px 12px;
margin: 8px 0;
@ -106,6 +106,10 @@ export const TextInput = styled.input.attrs({ type: "text" })`
&:focus {
background: ${secondaryDark};
}
&:invalid {
outline: 1px solid red;
}
`;
export const NumberInput = styled.input.attrs({ type: "number" })`

View file

@ -1,5 +1,5 @@
import styled from "styled-components";
import { TextInput, defaultBorderRadius, lightGray } from "../components";
import { Input, defaultBorderRadius, lightGray } from "../components";
import { FullState } from "../../../schema/FullState";
import {
useEffect,
@ -58,7 +58,7 @@ const TopGuiDiv = styled.div`
}
`;
const TitleTextInput = styled(TextInput)`
const TitleTextInput = styled(Input)`
border: none;
outline: none;

View file

@ -3,7 +3,7 @@ import ModelCard from "../components/ModelCard";
import styled from "styled-components";
import { ArrowLeftIcon } from "@heroicons/react/24/outline";
import {
TextInput,
Input,
defaultBorderRadius,
lightGray,
vscBackground,
@ -151,22 +151,28 @@ function ModelConfig() {
<>
<h3 className="mb-2">Enter required parameters</h3>
{modelInfo?.collectInputFor?.map((d) => {
return (
<div>
<label htmlFor={d.key}>{d.key}</label>
<TextInput
id={d.key}
className="border-2 border-gray-200 rounded-md p-2 m-2"
placeholder={d.key}
defaultValue={d.defaultValue}
{...formMethods.register(d.key, {
required: true,
})}
/>
</div>
);
})}
{modelInfo?.collectInputFor
?.filter((d) => d.required)
.map((d) => {
return (
<div>
<label htmlFor={d.key}>{d.key}</label>
<Input
type={d.inputType}
id={d.key}
className="border-2 border-gray-200 rounded-md p-2 m-2"
placeholder={d.key}
defaultValue={d.defaultValue}
min={d.min}
max={d.max}
step={d.step}
{...formMethods.register(d.key, {
required: true,
})}
/>
</div>
);
})}
</>
)}
@ -182,11 +188,15 @@ function ModelConfig() {
return (
<div>
<label htmlFor={d.key}>{d.key}</label>
<TextInput
<Input
type={d.inputType}
id={d.key}
className="border-2 border-gray-200 rounded-md p-2 m-2"
placeholder={d.key}
defaultValue={d.defaultValue}
min={d.min}
max={d.max}
step={d.step}
{...formMethods.register(d.key, {
required: false,
})}
@ -216,7 +226,7 @@ function ModelConfig() {
formParams[d.key] =
d.inputType === "text"
? formMethods.watch(d.key)
: parseInt(formMethods.watch(d.key));
: parseFloat(formMethods.watch(d.key));
}
client?.addModelForRole("*", modelInfo.class, {
@ -239,7 +249,7 @@ function ModelConfig() {
formParams[d.key] =
d.inputType === "text"
? formMethods.watch(d.key)
: parseInt(formMethods.watch(d.key));
: parseFloat(formMethods.watch(d.key));
}
client?.addModelForRole("*", modelInfo.class, {

View file

@ -14,6 +14,7 @@ MODEL_PROVIDER_TAG_COLORS[ModelProviderTag["Free"]] = "#ffff00";
export enum CollectInputType {
"text" = "text",
"number" = "number",
"range" = "range",
}
export interface InputDescriptor {
@ -38,6 +39,64 @@ const contextLengthInput: InputDescriptor = {
defaultValue: 2048,
required: false,
};
const temperatureInput: InputDescriptor = {
inputType: CollectInputType.number,
key: "temperature",
label: "Temperature",
defaultValue: undefined,
required: false,
min: 0.0,
max: 1.0,
step: 0.01,
};
const topPInput: InputDescriptor = {
inputType: CollectInputType.number,
key: "top_p",
label: "Top-P",
defaultValue: undefined,
required: false,
min: 0,
max: 1,
step: 0.01,
};
const topKInput: InputDescriptor = {
inputType: CollectInputType.number,
key: "top_k",
label: "Top-K",
defaultValue: undefined,
required: false,
min: 0,
max: 1,
step: 0.01,
};
const presencePenaltyInput: InputDescriptor = {
inputType: CollectInputType.number,
key: "presence_penalty",
label: "Presence Penalty",
defaultValue: undefined,
required: false,
min: 0,
max: 1,
step: 0.01,
};
const FrequencyPenaltyInput: InputDescriptor = {
inputType: CollectInputType.number,
key: "frequency_penalty",
label: "Frequency Penalty",
defaultValue: undefined,
required: false,
min: 0,
max: 1,
step: 0.01,
};
const completionParamsInputs = [
contextLengthInput,
temperatureInput,
topKInput,
topPInput,
presencePenaltyInput,
FrequencyPenaltyInput,
];
const serverUrlInput = {
inputType: CollectInputType.text,
@ -210,6 +269,7 @@ export const MODEL_INFO: { [key: string]: ModelInfo } = {
placeholder: "Enter your OpenAI API key",
required: true,
},
...completionParamsInputs,
],
},
anthropic: {
@ -229,6 +289,7 @@ export const MODEL_INFO: { [key: string]: ModelInfo } = {
placeholder: "Enter your Anthropic API key",
required: true,
},
...completionParamsInputs,
],
packages: [
{
@ -261,7 +322,7 @@ export const MODEL_INFO: { [key: string]: ModelInfo } = {
refUrl: "https://ollama.ai/library/llama2",
})),
],
collectInputFor: [contextLengthInput],
collectInputFor: [...completionParamsInputs],
},
together: {
title: "TogetherAI",
@ -285,6 +346,7 @@ export const MODEL_INFO: { [key: string]: ModelInfo } = {
placeholder: "Enter your TogetherAI API key",
required: true,
},
...completionParamsInputs,
],
packages: [
...codeLlamaPackages.map((p) => {
@ -330,7 +392,7 @@ export const MODEL_INFO: { [key: string]: ModelInfo } = {
server_url: "http://localhost:1234",
},
packages: [llama2FamilyPackage],
collectInputFor: [contextLengthInput],
collectInputFor: [...completionParamsInputs],
},
replicate: {
title: "Replicate",
@ -348,6 +410,7 @@ export const MODEL_INFO: { [key: string]: ModelInfo } = {
placeholder: "Enter your Replicate API key",
required: true,
},
...completionParamsInputs,
],
icon: "replicate.png",
tags: [
@ -385,7 +448,7 @@ After it's up and running, you can start using Continue.`,
icon: "llamacpp.png",
tags: [ModelProviderTag.Local, ModelProviderTag["Open-Source"]],
packages: [llama2FamilyPackage],
collectInputFor: [contextLengthInput],
collectInputFor: [...completionParamsInputs],
},
palm: {
title: "Google PaLM API",
@ -428,7 +491,7 @@ After it's up and running, you can start using Continue.`,
tags: [ModelProviderTag.Local, ModelProviderTag["Open-Source"]],
packages: [llama2FamilyPackage],
collectInputFor: [
contextLengthInput,
...completionParamsInputs,
{ ...serverUrlInput, defaultValue: "http://localhost:8080" },
],
},
@ -451,7 +514,7 @@ After it's up and running, you can start using Continue.`,
...serverUrlInput,
defaultValue: "http://localhost:8000",
},
contextLengthInput,
...completionParamsInputs,
],
icon: "openai.svg",
tags: [ModelProviderTag.Local, ModelProviderTag["Open-Source"]],
@ -467,5 +530,6 @@ After it's up and running, you can start using Continue.`,
icon: "openai.svg",
tags: [ModelProviderTag.Free],
packages: [gpt4, gpt35turbo],
collectInputFor: [...completionParamsInputs],
},
};

View file

@ -55,6 +55,10 @@ export type UniqueId = string;
* The name of the model to be used (e.g. gpt-4, codellama)
*/
export type Model = string;
/**
* The maximum number of tokens to generate.
*/
export type MaxTokens = number;
/**
* Tokens that will stop the completion.
*/
@ -222,6 +226,7 @@ export interface LLM {
context_length?: ContextLength;
unique_id?: UniqueId;
model: Model;
max_tokens?: MaxTokens;
stop_tokens?: StopTokens;
timeout?: Timeout;
verify_ssl?: VerifySsl;

View file

@ -26,6 +26,10 @@ export type UniqueId = string;
* The name of the model to be used (e.g. gpt-4, codellama)
*/
export type Model = string;
/**
* The maximum number of tokens to generate.
*/
export type MaxTokens = number;
/**
* Tokens that will stop the completion.
*/
@ -57,6 +61,7 @@ export interface LLM1 {
context_length?: ContextLength;
unique_id?: UniqueId;
model: Model;
max_tokens?: MaxTokens;
stop_tokens?: StopTokens;
timeout?: Timeout;
verify_ssl?: VerifySsl;

View file

@ -26,6 +26,10 @@ export type UniqueId = string;
* The name of the model to be used (e.g. gpt-4, codellama)
*/
export type Model = string;
/**
* The maximum number of tokens to generate.
*/
export type MaxTokens = number;
/**
* Tokens that will stop the completion.
*/
@ -70,6 +74,7 @@ export interface LLM {
context_length?: ContextLength;
unique_id?: UniqueId;
model: Model;
max_tokens?: MaxTokens;
stop_tokens?: StopTokens;
timeout?: Timeout;
verify_ssl?: VerifySsl;

View file

@ -1,11 +1,18 @@
const { exec } = require("child_process");
const fs = require("fs");
const args = process.argv.slice(2);
const isPreRelease = args.includes("--pre-release");
if (!fs.existsSync("build")) {
fs.mkdirSync("build");
}
exec("vsce package --out ./build patch", (error) => {
const command = isPreRelease
? "vsce package --out ./build patch --pre-release"
: "vsce package --out ./build patch";
exec(command, (error) => {
if (error) throw error;
console.log("vsce package completed");
});

View file

@ -22,6 +22,29 @@ function getExtensionVersionInt(versionString: string): number {
return parseInt(versionString.replace(/\./g, ""));
}
function addPythonPathForConfig() {
// Add to python.analysis.extraPaths global setting so config.py gets LSP
const pythonConfig = vscode.workspace.getConfiguration("python");
const analysisPaths = pythonConfig.get<string[]>("analysis.extraPaths");
const autoCompletePaths = pythonConfig.get<string[]>(
"autoComplete.extraPaths"
);
const pathToAdd = extensionContext?.extensionPath;
if (analysisPaths && pathToAdd && !analysisPaths.includes(pathToAdd)) {
analysisPaths.push(pathToAdd);
pythonConfig.update("analysis.extraPaths", analysisPaths);
}
if (
autoCompletePaths &&
pathToAdd &&
!autoCompletePaths.includes(pathToAdd)
) {
autoCompletePaths.push(pathToAdd);
pythonConfig.update("autoComplete.extraPaths", autoCompletePaths);
}
}
export async function activateExtension(context: vscode.ExtensionContext) {
extensionContext = context;
console.log("Using Continue version: ", getExtensionVersion());
@ -66,6 +89,7 @@ export async function activateExtension(context: vscode.ExtensionContext) {
registerAllCodeLensProviders(context);
registerAllCommands(context);
registerQuickFixProvider();
addPythonPathForConfig();
// Start the server
const sessionIdPromise = (async () => {

View file

@ -146,6 +146,17 @@ function ensureDirectoryExistence(filePath: string) {
fs.mkdirSync(dirname);
}
function isPreviewExtension() {
// If the extension minor version is odd, it is a preview version
const extensionVersion = getExtensionVersion();
if (!extensionVersion || extensionVersion === "") {
return false;
}
const extensionVersionSplit = extensionVersion.split(".");
const extensionMinorVersion = extensionVersionSplit[1];
return parseInt(extensionMinorVersion) % 2 === 1;
}
export async function downloadFromS3(
bucket: string,
fileName: string,
@ -263,7 +274,7 @@ export async function startContinuePythonServer(redownload: boolean = true) {
try {
await downloadFromS3(
bucket,
fileName,
`${isPreviewExtension() ? "preview/" : ""}${fileName}`,
destination,
"us-west-1",
false
@ -285,7 +296,7 @@ export async function startContinuePythonServer(redownload: boolean = true) {
try {
await downloadFromS3(
bucket,
fileName,
`${isPreviewExtension() ? "preview/" : ""}${fileName}`,
destination,
"us-west-1",
true

View file

@ -10,7 +10,7 @@ a = Analysis(
pathex=[],
binaries=[],
datas=[
('continuedev', 'continuedev'),
('server/continuedev', 'server/continuedev'),
(certifi.where(), 'ca_bundle'),
] + copy_metadata('replicate'),
hiddenimports=['anthropic', 'github', 'ripgrepy', 'bs4', 'redbaron'],

View file

@ -10,7 +10,7 @@ a = Analysis(
pathex=[],
binaries=[],
datas=[
('continuedev', 'continuedev'),
('server/continuedev', 'server/continuedev'),
(certifi.where(), 'ca_bundle')
] + copy_metadata('replicate'),
hiddenimports=['anthropic', 'github', 'ripgrepy', 'bs4', 'redbaron'],

View file

@ -1,6 +1,6 @@
{
"title": "ContextItem",
"$ref": "#/definitions/src__continuedev__core__main__ContextItem",
"$ref": "#/definitions/continuedev__core__main__ContextItem",
"definitions": {
"ContextItemId": {
"title": "ContextItemId",
@ -44,7 +44,7 @@
"id"
]
},
"src__continuedev__core__main__ContextItem": {
"continuedev__core__main__ContextItem": {
"title": "ContextItem",
"description": "A ContextItem is a single item that is stored in the ContextManager.",
"type": "object",

View file

@ -1,6 +1,6 @@
{
"title": "ContinueConfig",
"$ref": "#/definitions/src__continuedev__core__config__ContinueConfig",
"$ref": "#/definitions/continuedev__core__config__ContinueConfig",
"definitions": {
"FunctionCall": {
"title": "FunctionCall",
@ -126,6 +126,12 @@
"description": "The name of the model to be used (e.g. gpt-4, codellama)",
"type": "string"
},
"max_tokens": {
"title": "Max Tokens",
"description": "The maximum number of tokens to generate.",
"default": 1024,
"type": "integer"
},
"stop_tokens": {
"title": "Stop Tokens",
"description": "Tokens that will stop the completion.",
@ -171,7 +177,7 @@
"model"
]
},
"src__continuedev__core__models__ContinueSDK": {
"continuedev__core__models__ContinueSDK": {
"title": "ContinueSDK",
"type": "object",
"properties": {}
@ -202,7 +208,7 @@
}
},
"sdk": {
"$ref": "#/definitions/src__continuedev__core__models__ContinueSDK"
"$ref": "#/definitions/continuedev__core__models__ContinueSDK"
}
},
"required": [
@ -265,7 +271,7 @@
"type": "object",
"properties": {}
},
"src__continuedev__core__context__ContinueSDK": {
"continuedev__core__context__ContinueSDK": {
"title": "ContinueSDK",
"description": "To avoid circular imports",
"type": "object",
@ -356,7 +362,7 @@
"description": "The ContinueSDK instance accessible by the ContextProvider",
"allOf": [
{
"$ref": "#/definitions/src__continuedev__core__context__ContinueSDK"
"$ref": "#/definitions/continuedev__core__context__ContinueSDK"
}
]
},
@ -398,7 +404,7 @@
"dynamic"
]
},
"src__continuedev__core__config__ContinueConfig": {
"continuedev__core__config__ContinueConfig": {
"title": "ContinueConfig",
"description": "Continue can be deeply customized by editing the `ContinueConfig` object in `~/.continue/config.py` (`%userprofile%\\.continue\\config.py` for Windows) on your machine. This class is instantiated from the config file for every new session.",
"type": "object",
@ -436,6 +442,7 @@
"system_message": null,
"context_length": 2048,
"model": "gpt-4",
"max_tokens": 1024,
"stop_tokens": null,
"timeout": 300,
"verify_ssl": null,
@ -451,6 +458,7 @@
"system_message": null,
"context_length": 2048,
"model": "gpt-3.5-turbo",
"max_tokens": 1024,
"stop_tokens": null,
"timeout": 300,
"verify_ssl": null,

View file

@ -1,6 +1,6 @@
{
"title": "FileEdit",
"$ref": "#/definitions/src__continuedev__models__filesystem_edit__FileEdit",
"$ref": "#/definitions/continuedev__models__filesystem_edit__FileEdit",
"definitions": {
"Position": {
"title": "Position",
@ -37,7 +37,7 @@
"end"
]
},
"src__continuedev__models__filesystem_edit__FileEdit": {
"continuedev__models__filesystem_edit__FileEdit": {
"title": "FileEdit",
"type": "object",
"properties": {

View file

@ -1,6 +1,6 @@
{
"title": "FileEditWithFullContents",
"$ref": "#/definitions/src__continuedev__models__filesystem_edit__FileEditWithFullContents",
"$ref": "#/definitions/continuedev__models__filesystem_edit__FileEditWithFullContents",
"definitions": {
"Position": {
"title": "Position",
@ -59,7 +59,7 @@
"replacement"
]
},
"src__continuedev__models__filesystem_edit__FileEditWithFullContents": {
"continuedev__models__filesystem_edit__FileEditWithFullContents": {
"title": "FileEditWithFullContents",
"type": "object",
"properties": {

View file

@ -1,6 +1,6 @@
{
"title": "FullState",
"$ref": "#/definitions/src__continuedev__core__main__FullState",
"$ref": "#/definitions/continuedev__core__main__FullState",
"definitions": {
"FunctionCall": {
"title": "FunctionCall",
@ -332,7 +332,7 @@
"requires_query"
]
},
"src__continuedev__core__main__FullState": {
"continuedev__core__main__FullState": {
"title": "FullState",
"description": "A full state of the program, including the history",
"type": "object",

View file

@ -1,6 +1,6 @@
{
"title": "History",
"$ref": "#/definitions/src__continuedev__core__main__History",
"$ref": "#/definitions/continuedev__core__main__History",
"definitions": {
"FunctionCall": {
"title": "FunctionCall",
@ -218,7 +218,7 @@
"depth"
]
},
"src__continuedev__core__main__History": {
"continuedev__core__main__History": {
"title": "History",
"description": "A history of steps taken and their results",
"type": "object",

View file

@ -1,6 +1,6 @@
{
"title": "HistoryNode",
"$ref": "#/definitions/src__continuedev__core__main__HistoryNode",
"$ref": "#/definitions/continuedev__core__main__HistoryNode",
"definitions": {
"FunctionCall": {
"title": "FunctionCall",
@ -171,7 +171,7 @@
"content"
]
},
"src__continuedev__core__main__HistoryNode": {
"continuedev__core__main__HistoryNode": {
"title": "HistoryNode",
"description": "A point in history, a list of which make up History",
"type": "object",

View file

@ -1,8 +1,8 @@
{
"title": "LLM",
"$ref": "#/definitions/src__continuedev__libs__llm__LLM",
"$ref": "#/definitions/continuedev__libs__llm__LLM",
"definitions": {
"src__continuedev__libs__llm__LLM": {
"continuedev__libs__llm__LLM": {
"title": "LLM",
"type": "object",
"properties": {
@ -32,6 +32,12 @@
"description": "The name of the model to be used (e.g. gpt-4, codellama)",
"type": "string"
},
"max_tokens": {
"title": "Max Tokens",
"description": "The maximum number of tokens to generate.",
"default": 1024,
"type": "integer"
},
"stop_tokens": {
"title": "Stop Tokens",
"description": "Tokens that will stop the completion.",

View file

@ -1,6 +1,6 @@
{
"title": "Models",
"$ref": "#/definitions/src__continuedev__core__models__Models",
"$ref": "#/definitions/continuedev__core__models__Models",
"definitions": {
"LLM": {
"title": "LLM",
@ -32,6 +32,12 @@
"description": "The name of the model to be used (e.g. gpt-4, codellama)",
"type": "string"
},
"max_tokens": {
"title": "Max Tokens",
"description": "The maximum number of tokens to generate.",
"default": 1024,
"type": "integer"
},
"stop_tokens": {
"title": "Stop Tokens",
"description": "Tokens that will stop the completion.",
@ -82,7 +88,7 @@
"type": "object",
"properties": {}
},
"src__continuedev__core__models__Models": {
"continuedev__core__models__Models": {
"title": "Models",
"description": "Main class that holds the current model configuration",
"type": "object",

View file

@ -1,8 +1,8 @@
{
"title": "Position",
"$ref": "#/definitions/src__continuedev__models__main__Position",
"$ref": "#/definitions/continuedev__models__main__Position",
"definitions": {
"src__continuedev__models__main__Position": {
"continuedev__models__main__Position": {
"title": "Position",
"type": "object",
"properties": {

View file

@ -1,6 +1,6 @@
{
"title": "Range",
"$ref": "#/definitions/src__continuedev__models__main__Range",
"$ref": "#/definitions/continuedev__models__main__Range",
"definitions": {
"Position": {
"title": "Position",
@ -20,7 +20,7 @@
"character"
]
},
"src__continuedev__models__main__Range": {
"continuedev__models__main__Range": {
"title": "Range",
"description": "A range in a file. 0-indexed.",
"type": "object",

View file

@ -1,6 +1,6 @@
{
"title": "RangeInFile",
"$ref": "#/definitions/src__continuedev__models__filesystem__RangeInFile",
"$ref": "#/definitions/continuedev__models__filesystem__RangeInFile",
"definitions": {
"Position": {
"title": "Position",
@ -37,7 +37,7 @@
"end"
]
},
"src__continuedev__models__filesystem__RangeInFile": {
"continuedev__models__filesystem__RangeInFile": {
"title": "RangeInFile",
"type": "object",
"properties": {

View file

@ -1,8 +1,8 @@
{
"title": "SessionInfo",
"$ref": "#/definitions/src__continuedev__core__main__SessionInfo",
"$ref": "#/definitions/continuedev__core__main__SessionInfo",
"definitions": {
"src__continuedev__core__main__SessionInfo": {
"continuedev__core__main__SessionInfo": {
"title": "SessionInfo",
"type": "object",
"properties": {

View file

@ -1,6 +1,6 @@
{
"title": "Traceback",
"$ref": "#/definitions/src__continuedev__models__main__Traceback",
"$ref": "#/definitions/continuedev__models__main__Traceback",
"definitions": {
"TracebackFrame": {
"title": "TracebackFrame",
@ -29,7 +29,7 @@
"function"
]
},
"src__continuedev__models__main__Traceback": {
"continuedev__models__main__Traceback": {
"title": "Traceback",
"type": "object",
"properties": {

View file

@ -1,8 +1,8 @@
{
"title": "TracebackFrame",
"$ref": "#/definitions/src__continuedev__models__main__TracebackFrame",
"$ref": "#/definitions/continuedev__models__main__TracebackFrame",
"definitions": {
"src__continuedev__models__main__TracebackFrame": {
"continuedev__models__main__TracebackFrame": {
"title": "TracebackFrame",
"type": "object",
"properties": {

View file

@ -10,7 +10,7 @@ The Continue server acts as a bridge between the Continue React app and your IDE
Start it by running the following commands:
1. `cd continuedev`
1. `cd server`
2. Make sure packages are installed with `poetry install`
- If poetry is not installed, you can install with
```bash
@ -18,8 +18,7 @@ Start it by running the following commands:
```
(official instructions [here](https://python-poetry.org/docs/#installing-with-the-official-installer))
3. `poetry shell` to activate the virtual environment
4. `cd ..`
5. `python3 -m continuedev.src.continuedev.server.main` to start the server
4. `python3 -m continuedev.server.main` to start the server
Once you've validated that this works, you'll often want to use a debugger, in which case we've provided a launch configuration for VS Code in `.vscode/launch.json`. To start the debugger in VS Code, ensure that the workspace directory is the root of the `continue` repo, then press F5.
@ -37,7 +36,7 @@ Once you've validated that this works, you'll often want to use a debugger, in w
## Writing Steps
See the `src/continuedev/libs/steps` folder for examples of writing a Continue step. See our documentation for tutorials.
See the `continuedev/libs/steps` folder for examples of writing a Continue step. See our documentation for tutorials.
## How to contribute
@ -71,9 +70,10 @@ cd continue/extension/scripts && python3 install_from_source.py
> [!IMPORTANT]
> Ensure you have a Java Runtime Environment (JRE) installed. Verify this by typing `java
> -version` in your command prompt or terminal. If a version number appears, you're set.
-version` in your command prompt or terminal. If a version number appears, you're set.
> If not, download and install a JRE from Oracle's website or through a package manager,
> for example Homebrew.
>
> ```sh
> brew install openjdk@11
> ```
@ -83,6 +83,6 @@ cd continue/extension/scripts && python3 install_from_source.py
- [Continue Server README](./README.md): learn about the core of Continue, which can be downloaded as a [PyPI package](https://pypi.org/project/continuedev/)
- [VS Code Extension README](../extension/README.md): learn about the capabilities of our extension—the first implementation of Continue's IDE Protocol—which makes it possible to use use Continue in VS Code and GitHub Codespaces
- [Continue GUI README](../extension/react-app/): learn about the React app that lets users interact with the server and is placed adjacent to the text editor in any supported IDE
- [Schema README](../schema/README.md): learn about the JSON Schema types generated from Pydantic models, which we use across the `continuedev/` and `extension/` directories
- [Schema README](../schema/README.md): learn about the JSON Schema types generated from Pydantic models, which we use across the `server/` and `extension/` directories
- [Continue Docs README](../docs/README.md): learn how our [docs](https://continue.dev/docs) are written and built
- [How to debug the VS Code Extension README](../extension/src/README.md): learn how to set up the VS Code extension, so you can debug it

View file

@ -30,12 +30,6 @@ from ..models.main import ContinueBaseModel
from ..plugins.context_providers.file import FileContextProvider
from ..plugins.context_providers.highlighted_code import HighlightedCodeContextProvider
from ..plugins.policies.default import DefaultPolicy
from ..plugins.steps.core.core import (
DisplayErrorStep,
ManualEditStep,
ReversibleStep,
UserInputStep,
)
from ..plugins.steps.on_traceback import DefaultOnTracebackStep
from ..server.ide_protocol import AbstractIdeProtocolServer
from ..server.meilisearch_server import get_meilisearch_url, stop_meilisearch
@ -54,6 +48,7 @@ from .main import (
)
from .observation import InternalErrorObservation, Observation
from .sdk import ContinueSDK
from .steps import DisplayErrorStep, ManualEditStep, ReversibleStep, UserInputStep
def get_error_title(e: Exception) -> str:

View file

@ -2,8 +2,8 @@ from typing import List, Optional
from pydantic import BaseModel
from ..libs.llm import LLM
from ..libs.llm.anthropic import AnthropicLLM
from ..libs.llm.base import LLM
from ..libs.llm.ggml import GGML
from ..libs.llm.google_palm_api import GooglePaLMAPI
from ..libs.llm.hf_inference_api import HuggingFaceInferenceAPI

View file

@ -2,7 +2,7 @@ import os
import traceback
from typing import Coroutine, List, Optional, Union
from ..libs.llm import LLM
from ..libs.llm.base import LLM
from ..libs.util.devdata import dev_data_logger
from ..libs.util.logging import logger
from ..libs.util.paths import (
@ -21,14 +21,6 @@ from ..models.filesystem_edit import (
FileSystemEdit,
)
from ..models.main import Range
from ..plugins.steps.core.core import (
DefaultModelEditCodeStep,
FileSystemEditStep,
MessageStep,
RangeInFileWithContents,
ShellCommandsStep,
WaitForUserConfirmationStep,
)
from ..server.ide_protocol import AbstractIdeProtocolServer
from .abstract_sdk import AbstractContinueSDK
from .config import ContinueConfig
@ -43,6 +35,14 @@ from .main import (
)
from .models import Models
from .observation import Observation
from .steps import (
DefaultModelEditCodeStep,
FileSystemEditStep,
MessageStep,
RangeInFileWithContents,
ShellCommandsStep,
WaitForUserConfirmationStep,
)
class Autopilot:

View file

@ -4,20 +4,18 @@ import subprocess
from textwrap import dedent
from typing import Coroutine, List, Optional, Union
from ....core.main import ChatMessage, ContinueCustomException, Step
from ....core.observation import Observation, TextObservation, UserInputObservation
from ....libs.llm import LLM
from ....libs.llm.openai_free_trial import OpenAIFreeTrial
from ....libs.util.count_tokens import DEFAULT_MAX_TOKENS
from ....libs.util.devdata import dev_data_logger
from ....libs.util.strings import (
from ..libs.llm.base import LLM
from ..libs.llm.openai_free_trial import OpenAIFreeTrial
from ..libs.util.count_tokens import DEFAULT_MAX_TOKENS
from ..libs.util.devdata import dev_data_logger
from ..libs.util.strings import (
dedent_and_get_common_whitespace,
remove_quotes_and_escapes,
)
from ....libs.util.telemetry import posthog_logger
from ....libs.util.templating import render_prompt_template
from ....models.filesystem import FileSystem, RangeInFile, RangeInFileWithContents
from ....models.filesystem_edit import (
from ..libs.util.telemetry import posthog_logger
from ..libs.util.templating import render_prompt_template
from ..models.filesystem import FileSystem, RangeInFile, RangeInFileWithContents
from ..models.filesystem_edit import (
EditDiff,
FileEdit,
FileEditWithFullContents,
@ -25,7 +23,9 @@ from ....models.filesystem_edit import (
)
# from ....libs.llm.replicate import ReplicateLLM
from ....models.main import Range
from ..models.main import Range
from .main import ChatMessage, ContinueCustomException, Step
from .observation import Observation, TextObservation, UserInputObservation
class ContinueSDK:

View file

@ -5,20 +5,20 @@ This is the Continue configuration file.
See https://continue.dev/docs/customization to for documentation of the available options.
\"\"\"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.core.config import CustomCommand, SlashCommand, ContinueConfig
from continuedev.src.continuedev.plugins.context_providers.github import GitHubIssuesContextProvider
from continuedev.src.continuedev.libs.llm.openai_free_trial import OpenAIFreeTrial
from continuedev.core.models import Models
from continuedev.core.config import CustomCommand, SlashCommand, ContinueConfig
from continuedev.plugins.context_providers.github import GitHubIssuesContextProvider
from continuedev.libs.llm.openai_free_trial import OpenAIFreeTrial
from continuedev.src.continuedev.plugins.steps.open_config import OpenConfigStep
from continuedev.src.continuedev.plugins.steps.clear_history import ClearHistoryStep
from continuedev.src.continuedev.plugins.steps.comment_code import CommentCodeStep
from continuedev.src.continuedev.plugins.steps.share_session import ShareSessionStep
from continuedev.src.continuedev.plugins.steps.main import EditHighlightedCodeStep
from continuedev.src.continuedev.plugins.steps.cmd import GenerateShellCommandStep
from continuedev.src.continuedev.plugins.context_providers.diff import DiffContextProvider
from continuedev.src.continuedev.plugins.context_providers.url import URLContextProvider
from continuedev.src.continuedev.plugins.context_providers.terminal import TerminalContextProvider
from continuedev.plugins.steps.open_config import OpenConfigStep
from continuedev.plugins.steps.clear_history import ClearHistoryStep
from continuedev.plugins.steps.comment_code import CommentCodeStep
from continuedev.plugins.steps.share_session import ShareSessionStep
from continuedev.plugins.steps.main import EditHighlightedCodeStep
from continuedev.plugins.steps.cmd import GenerateShellCommandStep
from continuedev.plugins.context_providers.diff import DiffContextProvider
from continuedev.plugins.context_providers.url import URLContextProvider
from continuedev.plugins.context_providers.terminal import TerminalContextProvider
config = ContinueConfig(
allow_anonymous_telemetry=True,

View file

@ -0,0 +1,14 @@
from .anthropic import AnthropicLLM # noqa: F401
from .ggml import GGML # noqa: F401
from .google_palm_api import GooglePaLMAPI # noqa: F401
from .hf_inference_api import HuggingFaceInferenceAPI # noqa: F401
from .hf_tgi import HuggingFaceTGI # noqa: F401
from .llamacpp import LlamaCpp # noqa: F401
from .ollama import Ollama # noqa: F401
from .openai import OpenAI # noqa: F401
from .openai_free_trial import OpenAIFreeTrial # noqa: F401
from .proxy_server import ProxyServer # noqa: F401
from .queued import QueuedLLM # noqa: F401
from .replicate import ReplicateLLM # noqa: F401
from .text_gen_interface import TextGenUI # noqa: F401
from .together import TogetherLLM # noqa: F401

View file

@ -2,7 +2,7 @@ from typing import Any, Callable, Coroutine
from anthropic import AI_PROMPT, HUMAN_PROMPT, AsyncAnthropic
from ..llm import LLM, CompletionOptions
from .base import LLM, CompletionOptions
from .prompts.chat import anthropic_template_messages
@ -11,7 +11,7 @@ class AnthropicLLM(LLM):
Import the `AnthropicLLM` class and set it as the default model:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.anthropic import AnthropicLLM
from continuedev.libs.llm.anthropic import AnthropicLLM
config = ContinueConfig(
...

View file

@ -6,7 +6,6 @@ import certifi
from pydantic import Field, validator
from ...core.main import ChatMessage
from ...libs.util.devdata import dev_data_logger
from ...models.main import ContinueBaseModel
from ..util.count_tokens import (
DEFAULT_ARGS,
@ -16,6 +15,7 @@ from ..util.count_tokens import (
format_chat_messages,
prune_raw_prompt_from_top,
)
from ..util.devdata import dev_data_logger
class CompletionOptions(ContinueBaseModel):
@ -36,7 +36,7 @@ class CompletionOptions(ContinueBaseModel):
top_p: Optional[float] = Field(None, description="The top_p of the completion.")
top_k: Optional[int] = Field(None, description="The top_k of the completion.")
presence_penalty: Optional[float] = Field(
None, description="The presence penalty of the completion."
None, description="The presence penalty Aof the completion."
)
frequency_penalty: Optional[float] = Field(
None, description="The frequency penalty of the completion."
@ -57,6 +57,12 @@ class LLM(ContinueBaseModel):
None,
description="A title that will identify this model in the model selection dropdown",
)
unique_id: Optional[str] = Field(None, description="The unique ID of the user.")
model: str = Field(
..., description="The name of the model to be used (e.g. gpt-4, codellama)"
)
system_message: Optional[str] = Field(
None, description="A system message that will always be followed by the LLM"
)
@ -66,18 +72,20 @@ class LLM(ContinueBaseModel):
description="The maximum context length of the LLM in tokens, as counted by count_tokens.",
)
unique_id: Optional[str] = Field(None, description="The unique ID of the user.")
model: str = Field(
..., description="The name of the model to be used (e.g. gpt-4, codellama)"
)
max_tokens: int = Field(
DEFAULT_MAX_TOKENS, description="The maximum number of tokens to generate."
)
stop_tokens: Optional[List[str]] = Field(
None, description="Tokens that will stop the completion."
)
temperature: Optional[float] = Field(
None, description="The temperature of the completion."
)
top_p: Optional[float] = Field(None, description="The top_p of the completion.")
top_k: Optional[int] = Field(None, description="The top_k of the completion.")
presence_penalty: Optional[float] = Field(
None, description="The presence penalty Aof the completion."
)
frequency_penalty: Optional[float] = Field(
None, description="The frequency penalty of the completion."
)
timeout: Optional[int] = Field(
300,
@ -149,6 +157,22 @@ class LLM(ContinueBaseModel):
"description": "Path to a custom CA bundle to use when making the HTTP request"
},
"proxy": {"description": "Proxy URL to use when making the HTTP request"},
"stop_tokens": {"description": "Tokens that will stop the completion."},
"temperature": {
"description": "The sampling temperature used for generation."
},
"top_p": {
"description": "The top_p sampling parameter used for generation."
},
"top_k": {
"description": "The top_k sampling parameter used for generation."
},
"presence_penalty": {
"description": "The presence penalty used for completions."
},
"frequency_penalty": {
"description": "The frequency penalty used for completions."
},
}
def dict(self, **kwargs):
@ -235,13 +259,13 @@ class LLM(ContinueBaseModel):
"""Yield completion response, either streamed or not."""
options = CompletionOptions(
model=model or self.model,
temperature=temperature,
top_p=top_p,
top_k=top_k,
presence_penalty=presence_penalty,
frequency_penalty=frequency_penalty,
temperature=temperature or self.temperature,
top_p=top_p or self.top_p,
top_k=top_k or self.top_k,
presence_penalty=presence_penalty or self.presence_penalty,
frequency_penalty=frequency_penalty or self.frequency_penalty,
stop=stop or self.stop_tokens,
max_tokens=max_tokens or self.max_tokens,
max_tokens=max_tokens,
functions=functions,
)
@ -286,13 +310,13 @@ class LLM(ContinueBaseModel):
"""Yield completion response, either streamed or not."""
options = CompletionOptions(
model=model or self.model,
temperature=temperature,
top_p=top_p,
top_k=top_k,
presence_penalty=presence_penalty,
frequency_penalty=frequency_penalty,
temperature=temperature or self.temperature,
top_p=top_p or self.top_p,
top_k=top_k or self.top_k,
presence_penalty=presence_penalty or self.presence_penalty,
frequency_penalty=frequency_penalty or self.frequency_penalty,
stop=stop or self.stop_tokens,
max_tokens=max_tokens or self.max_tokens,
max_tokens=max_tokens,
functions=functions,
)
@ -335,13 +359,13 @@ class LLM(ContinueBaseModel):
"""Yield completion response, either streamed or not."""
options = CompletionOptions(
model=model or self.model,
temperature=temperature,
top_p=top_p,
top_k=top_k,
presence_penalty=presence_penalty,
frequency_penalty=frequency_penalty,
temperature=temperature or self.temperature,
top_p=top_p or self.top_p,
top_k=top_k or self.top_k,
presence_penalty=presence_penalty or self.presence_penalty,
frequency_penalty=frequency_penalty or self.frequency_penalty,
stop=stop or self.stop_tokens,
max_tokens=max_tokens or self.max_tokens,
max_tokens=max_tokens,
functions=functions,
)

View file

@ -4,9 +4,8 @@ from typing import Any, Callable, Coroutine, Dict, List, Optional
from pydantic import Field
from ...core.main import ChatMessage
from ..llm import LLM
from ..util.logging import logger
from . import CompletionOptions
from .base import LLM, CompletionOptions
from .openai import CHAT_MODELS
from .prompts.chat import llama2_template_messages
from .prompts.edit import simplified_edit_prompt
@ -19,7 +18,7 @@ class GGML(LLM):
Once the model is running on localhost:8000, change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.ggml import GGML
from continuedev.libs.llm.ggml import GGML
config = ContinueConfig(
...

View file

@ -4,7 +4,7 @@ import requests
from pydantic import Field
from ...core.main import ChatMessage
from ..llm import LLM
from .base import LLM
class GooglePaLMAPI(LLM):
@ -12,8 +12,8 @@ class GooglePaLMAPI(LLM):
The Google PaLM API is currently in public preview, so production applications are not supported yet. However, you can [create an API key in Google MakerSuite](https://makersuite.google.com/u/2/app/apikey) and begin trying out the `chat-bison-001` model. Change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.hf_inference_api import GooglePaLMAPI
from continuedev.core.models import Models
from continuedev.libs.llm.hf_inference_api import GooglePaLMAPI
config = ContinueConfig(
...

View file

@ -3,7 +3,7 @@ from typing import Callable, Dict, List, Union
from huggingface_hub import InferenceClient
from pydantic import Field
from ..llm import LLM, CompletionOptions
from .base import LLM, CompletionOptions
from .prompts.chat import llama2_template_messages
from .prompts.edit import simplified_edit_prompt
@ -13,8 +13,8 @@ class HuggingFaceInferenceAPI(LLM):
Hugging Face Inference API is a great option for newly released language models. Sign up for an account and add billing [here](https://huggingface.co/settings/billing), access the Inference Endpoints [here](https://ui.endpoints.huggingface.co), click on “New endpoint”, and fill out the form (e.g. select a model like [WizardCoder-Python-34B-V1.0](https://huggingface.co/WizardLM/WizardCoder-Python-34B-V1.0)), and then deploy your model by clicking “Create Endpoint”. Change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.hf_inference_api import HuggingFaceInferenceAPI
from continuedev.core.models import Models
from continuedev.libs.llm.hf_inference_api import HuggingFaceInferenceAPI
config = ContinueConfig(
...

View file

@ -4,7 +4,7 @@ from typing import Any, Callable, List
from pydantic import Field
from ...core.main import ChatMessage
from ..llm import LLM, CompletionOptions
from .base import LLM, CompletionOptions
from .prompts.chat import llama2_template_messages
from .prompts.edit import simplified_edit_prompt

View file

@ -3,7 +3,7 @@ from typing import Any, Callable, Dict
from pydantic import Field
from ..llm import LLM
from .base import LLM
from .prompts.chat import llama2_template_messages
from .prompts.edit import simplified_edit_prompt
@ -19,7 +19,7 @@ class LlamaCpp(LLM):
After it's up and running, change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.llamacpp import LlamaCpp
from continuedev.libs.llm.llamacpp import LlamaCpp
config = ContinueConfig(
...

View file

@ -4,8 +4,8 @@ from typing import Callable
import aiohttp
from pydantic import Field
from ..llm import LLM
from ..util.logging import logger
from .base import LLM
from .prompts.chat import llama2_template_messages
from .prompts.edit import simplified_edit_prompt
@ -15,7 +15,7 @@ class Ollama(LLM):
[Ollama](https://ollama.ai/) is an application for Mac and Linux that makes it easy to locally run open-source models, including Llama-2. Download the app from the website, and it will walk you through setup in a couple of minutes. You can also read more in their [README](https://github.com/jmorganca/ollama). Continue can then be configured to use the `Ollama` LLM class:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.ollama import Ollama
from continuedev.libs.llm.ollama import Ollama
config = ContinueConfig(
...

View file

@ -5,7 +5,7 @@ import openai
from pydantic import Field
from ...core.main import ChatMessage
from ..llm import LLM
from .base import LLM
CHAT_MODELS = {
"gpt-3.5-turbo",
@ -33,7 +33,7 @@ class OpenAI(LLM):
If you are locally serving a model that uses an OpenAI-compatible server, you can simply change the `api_base` in the `OpenAI` class like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.openai import OpenAI
from continuedev.libs.llm.openai import OpenAI
config = ContinueConfig(
...

View file

@ -1,7 +1,7 @@
from typing import Callable, List, Optional
from ...core.main import ChatMessage
from . import LLM
from .base import LLM
from .openai import OpenAI
from .proxy_server import ProxyServer

View file

@ -5,8 +5,8 @@ from typing import List
import aiohttp
from ...core.main import ChatMessage
from ..llm import LLM
from ..util.telemetry import posthog_logger
from .base import LLM
# SERVER_URL = "http://127.0.0.1:8080"
SERVER_URL = "https://proxy-server-l6vsfbzhba-uw.a.run.app"

View file

@ -4,7 +4,7 @@ from typing import Any, List, Union
from pydantic import Field
from ...core.main import ChatMessage
from . import LLM, CompletionOptions
from .base import LLM, CompletionOptions
class QueuedLLM(LLM):
@ -14,7 +14,7 @@ class QueuedLLM(LLM):
If you are already using another LLM class and are experiencing this problem, you can just wrap it with the QueuedLLM class like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.libs.llm.queued import QueuedLLM
from continuedev.libs.llm.queued import QueuedLLM
config = ContinueConfig(
...

View file

@ -5,7 +5,7 @@ import replicate
from pydantic import Field
from ...core.main import ChatMessage
from . import LLM
from .base import LLM
from .prompts.edit import simplified_edit_prompt
@ -14,8 +14,8 @@ class ReplicateLLM(LLM):
Replicate is a great option for newly released language models or models that you've deployed through their platform. Sign up for an account [here](https://replicate.ai/), copy your API key, and then select any model from the [Replicate Streaming List](https://replicate.com/collections/streaming-language-models). Change `~/.continue/config.py` to look like this:
```python title="~/.continue/config.py"
from continuedev.src.continuedev.core.models import Models
from continuedev.src.continuedev.libs.llm.replicate import ReplicateLLM
from continuedev.core.models import Models
from continuedev.libs.llm.replicate import ReplicateLLM
config = ContinueConfig(
...

Some files were not shown because too many files have changed in this diff Show more