40 lines
5 KiB
Markdown
40 lines
5 KiB
Markdown
import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
|
|
|
|
# ReplicateLLM
|
|
|
|
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.core.models import Models
|
|
from continuedev.libs.llm.replicate import ReplicateLLM
|
|
|
|
config = ContinueConfig(
|
|
...
|
|
models=Models(
|
|
default=ReplicateLLM(
|
|
model="replicate/codellama-13b-instruct:da5676342de1a5a335b848383af297f592b816b950a43d251a0a9edd0113604b",
|
|
api_key="my-replicate-api-key")
|
|
)
|
|
)
|
|
```
|
|
|
|
If you don't specify the `model` parameter, it will default to `replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781`.
|
|
|
|
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/replicate.py)
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
### Inherited Properties
|
|
|
|
<ClassPropertyRef name='api_key' details='{"title": "Api Key", "description": "Replicate API key", "type": "string"}' required={true} default=""/>
|
|
<ClassPropertyRef name='title' details='{"title": "Title", "description": "A title that will identify this model in the model selection dropdown", "type": "string"}' required={false} default=""/>
|
|
<ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "description": "The unique ID of the user.", "type": "string"}' required={false} default=""/>
|
|
<ClassPropertyRef name='model' details='{"title": "Model", "description": "The name of the model to be used (e.g. gpt-4, codellama)", "default": "replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781", "type": "string"}' required={false} default="replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781"/>
|
|
<ClassPropertyRef name='system_message' details='{"title": "System Message", "description": "A system message that will always be followed by the LLM", "type": "string"}' required={false} default=""/>
|
|
<ClassPropertyRef name='context_length' details='{"title": "Context Length", "description": "The maximum context length of the LLM in tokens, as counted by count_tokens.", "default": 2048, "type": "integer"}' required={false} default="2048"/>
|
|
<ClassPropertyRef name='completion_options' details='{"title": "Completion Options", "description": "Options for the completion endpoint. Read more about the completion options in the documentation.", "default": {"temperature": null, "top_p": null, "top_k": null, "presence_penalty": null, "frequency_penalty": null, "stop": null, "max_tokens": 600}, "allOf": [{"$ref": "#/definitions/BaseCompletionOptions"}]}' required={false} default="{'temperature': None, 'top_p': None, 'top_k': None, 'presence_penalty': None, 'frequency_penalty': None, 'stop': None, 'max_tokens': 600}"/>
|
|
<ClassPropertyRef name='request_options' details='{"title": "Request Options", "description": "Options for the HTTP request to the LLM.", "default": {"timeout": 300, "verify_ssl": null, "ca_bundle_path": null, "proxy": null, "headers": null}, "allOf": [{"$ref": "#/definitions/RequestOptions"}]}' required={false} default="{'timeout': 300, 'verify_ssl': None, 'ca_bundle_path': None, 'proxy': None, 'headers': None}"/>
|
|
<ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "description": "A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \"edit\" key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.", "default": {}, "type": "object"}' required={false} default="{}"/>
|
|
<ClassPropertyRef name='api_base' details='{"title": "Api Base", "description": "The base URL of the LLM API.", "type": "string"}' required={false} default=""/>
|