{
"frequency_penalty": 0,
"grammar": "",
"jsonschema": "{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"from\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"description\": \"The email address of the sender.\"\n },\n \"to\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to send the email to.\"\n },\n \"cc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the CC field.\"\n },\n \"bcc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the BCC field.\"\n },\n \"subject\": {\n \"type\": \"string\",\n \"description\": \"The subject of the email.\"\n },\n \"body\": {\n \"type\": \"string\",\n \"description\": \"The body text of the email.\"\n }\n },\n \"required\": [\"from\", \"to\", \"subject\", \"body\"],\n \"additionalProperties\": false\n}",
"max_tokens": 500,
"mirostat_entropy": 5,
"mirostat_learning_rate": 0.1,
"mirostat_mode": "Disabled",
"presence_penalty": 0,
"prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nSend a email from andreas86@telia.se to myfriend@telia.se where you discuss the weather. In the body, describe the current weather in Stockholm as detailed as possible.\n\nRespond with json that adheres to the following jsonschema:\n\n{jsonschema}\n\n### Response:",
"repeat_penalty": 1.1,
"temperature": 0.8,
"top_k": 10,
"top_p": 0.95
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_L55**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/wizardcoder-python-34b-v1-gguf using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"andreasjansson/wizardcoder-python-34b-v1-gguf:b357a162acd41ce53c04b14a25df0f1d476c2e39d465895d28cdba87944506c6",
{
input: {
frequency_penalty: 0,
grammar: "",
jsonschema: "{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"from\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"description\": \"The email address of the sender.\"\n },\n \"to\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to send the email to.\"\n },\n \"cc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the CC field.\"\n },\n \"bcc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the BCC field.\"\n },\n \"subject\": {\n \"type\": \"string\",\n \"description\": \"The subject of the email.\"\n },\n \"body\": {\n \"type\": \"string\",\n \"description\": \"The body text of the email.\"\n }\n },\n \"required\": [\"from\", \"to\", \"subject\", \"body\"],\n \"additionalProperties\": false\n}",
max_tokens: 500,
mirostat_entropy: 5,
mirostat_learning_rate: 0.1,
mirostat_mode: "Disabled",
presence_penalty: 0,
prompt: "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nSend a email from andreas86@telia.se to myfriend@telia.se where you discuss the weather. In the body, describe the current weather in Stockholm as detailed as possible.\n\nRespond with json that adheres to the following jsonschema:\n\n{jsonschema}\n\n### Response:",
repeat_penalty: 1.1,
temperature: 0.8,
top_k: 10,
top_p: 0.95
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_L55**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/wizardcoder-python-34b-v1-gguf using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/wizardcoder-python-34b-v1-gguf:b357a162acd41ce53c04b14a25df0f1d476c2e39d465895d28cdba87944506c6",
input={
"frequency_penalty": 0,
"grammar": "",
"jsonschema": "{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"from\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"description\": \"The email address of the sender.\"\n },\n \"to\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to send the email to.\"\n },\n \"cc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the CC field.\"\n },\n \"bcc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the BCC field.\"\n },\n \"subject\": {\n \"type\": \"string\",\n \"description\": \"The subject of the email.\"\n },\n \"body\": {\n \"type\": \"string\",\n \"description\": \"The body text of the email.\"\n }\n },\n \"required\": [\"from\", \"to\", \"subject\", \"body\"],\n \"additionalProperties\": false\n}",
"max_tokens": 500,
"mirostat_entropy": 5,
"mirostat_learning_rate": 0.1,
"mirostat_mode": "Disabled",
"presence_penalty": 0,
"prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nSend a email from andreas86@telia.se to myfriend@telia.se where you discuss the weather. In the body, describe the current weather in Stockholm as detailed as possible.\n\nRespond with json that adheres to the following jsonschema:\n\n{jsonschema}\n\n### Response:",
"repeat_penalty": 1.1,
"temperature": 0.8,
"top_k": 10,
"top_p": 0.95
}
)
# The andreasjansson/wizardcoder-python-34b-v1-gguf model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/andreasjansson/wizardcoder-python-34b-v1-gguf/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_L55**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/wizardcoder-python-34b-v1-gguf using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "andreasjansson/wizardcoder-python-34b-v1-gguf:b357a162acd41ce53c04b14a25df0f1d476c2e39d465895d28cdba87944506c6",
"input": {
"frequency_penalty": 0,
"grammar": "",
"jsonschema": "{\\n \\"$schema\\": \\"http://json-schema.org/draft-07/schema#\\",\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"from\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"The email address of the sender.\\"\\n },\\n \\"to\\": {\\n \\"type\\": \\"array\\",\\n \\"items\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\"\\n },\\n \\"description\\": \\"An array of email addresses to send the email to.\\"\\n },\\n \\"cc\\": {\\n \\"type\\": \\"array\\",\\n \\"items\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\"\\n },\\n \\"description\\": \\"An array of email addresses to be included in the CC field.\\"\\n },\\n \\"bcc\\": {\\n \\"type\\": \\"array\\",\\n \\"items\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\"\\n },\\n \\"description\\": \\"An array of email addresses to be included in the BCC field.\\"\\n },\\n \\"subject\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"The subject of the email.\\"\\n },\\n \\"body\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"The body text of the email.\\"\\n }\\n },\\n \\"required\\": [\\"from\\", \\"to\\", \\"subject\\", \\"body\\"],\\n \\"additionalProperties\\": false\\n}",
"max_tokens": 500,
"mirostat_entropy": 5,
"mirostat_learning_rate": 0.1,
"mirostat_mode": "Disabled",
"presence_penalty": 0,
"prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\\n\\n### Instruction:\\nSend a email from andreas86@telia.se to myfriend@telia.se where you discuss the weather. In the body, describe the current weather in Stockholm as detailed as possible.\\n\\nRespond with json that adheres to the following jsonschema:\\n\\n{jsonschema}\\n\\n### Response:",
"repeat_penalty": 1.1,
"temperature": 0.8,
"top_k": 10,
"top_p": 0.95
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{"bcc": [],"body": "Hello myfriend,\n\nIt is currently raining in Stockholm and the temperature is around 15 degrees Celsius. The wind is strong and the sky is overcast, but it won't last long as we are expecting sunny weather this weekend. It is a good day for a picnic or a walk in the park!\n\nRegards,\nAndreas","cc": [],"from": "andreas86@telia.se","subject": "Weather Update from Stockholm","to": ["myfriend@telia.se"]} {
"id": "rlnwn6dbidyjpx4qfiizgqcd2u",
"model": "andreasjansson/wizardcoder-python-34b-v1-gguf",
"version": "b357a162acd41ce53c04b14a25df0f1d476c2e39d465895d28cdba87944506c6",
"input": {
"frequency_penalty": 0,
"grammar": "",
"jsonschema": "{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"from\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"description\": \"The email address of the sender.\"\n },\n \"to\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to send the email to.\"\n },\n \"cc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the CC field.\"\n },\n \"bcc\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"description\": \"An array of email addresses to be included in the BCC field.\"\n },\n \"subject\": {\n \"type\": \"string\",\n \"description\": \"The subject of the email.\"\n },\n \"body\": {\n \"type\": \"string\",\n \"description\": \"The body text of the email.\"\n }\n },\n \"required\": [\"from\", \"to\", \"subject\", \"body\"],\n \"additionalProperties\": false\n}",
"max_tokens": 500,
"mirostat_entropy": 5,
"mirostat_learning_rate": 0.1,
"mirostat_mode": "Disabled",
"presence_penalty": 0,
"prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nSend a email from andreas86@telia.se to myfriend@telia.se where you discuss the weather. In the body, describe the current weather in Stockholm as detailed as possible.\n\nRespond with json that adheres to the following jsonschema:\n\n{jsonschema}\n\n### Response:",
"repeat_penalty": 1.1,
"temperature": 0.8,
"top_k": 10,
"top_p": 0.95
},
"logs": "from_string grammar:\nspace ::= space_1\nspace_1 ::= [ ] |\nstring ::= [\"] string_5 [\"] space\nstring_3 ::= [^\"\\] | [\\] string_4\nstring_4 ::= [\"\\/bfnrt] | [u] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]\nstring_5 ::= string_3 string_5 |\nbcc ::= [[] space bcc_10 []] space\nbcc_7 ::= string bcc_9\nbcc_8 ::= [,] space string\nbcc_9 ::= bcc_8 bcc_9 |\nbcc_10 ::= bcc_7 |\ncc ::= [[] space cc_15 []] space\ncc_12 ::= string cc_14\ncc_13 ::= [,] space string \ncc_14 ::= cc_13 cc_14 |\ncc_15 ::= cc_12 | \nto ::= [[] space to_20 []] space \nto_17 ::= string to_19\nto_18 ::= [,] space string\nto_19 ::= to_18 to_19 | \nto_20 ::= to_17 |\nroot ::= [{] space [\"] [b] [c] [c] [\"] space [:] space bcc [,] space [\"] [b] [o] [d] [y] [\"] space [:] space string [,] space [\"] [c] [c] [\"] space [:] space cc [,] space [\"] [f] [r] [o] [m] [\"] space [:] space string [,] space [\"] [s] [u] [b] [j] [e] [c] [t] [\"] space [:] space string [,] space [\"] [t] [o] [\"] space [:] space to [}] space\nPrompt:\nBelow is an instruction that describes a task. Write a response that appropriately completes the request.\n### Instruction:\nSend a email from andreas86@telia.se to myfriend@telia.se where you discuss the weather. In the body, describe the current weather in Stockholm as detailed as possible.\nRespond with json that adheres to the following jsonschema:\n{\n\"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\"type\": \"object\",\n\"properties\": {\n\"from\": {\n\"type\": \"string\",\n\"format\": \"email\",\n\"description\": \"The email address of the sender.\"\n},\n\"to\": {\n\"type\": \"array\",\n\"items\": {\n\"type\": \"string\",\n\"format\": \"email\"\n},\n\"description\": \"An array of email addresses to send the email to.\"\n},\n\"cc\": {\n\"type\": \"array\",\n\"items\": {\n\"type\": \"string\",\n\"format\": \"email\"\n},\n\"description\": \"An array of email addresses to be included in the CC field.\"\n},\n\"bcc\": {\n\"type\": \"array\",\n\"items\": {\n\"type\": \"string\",\n\"format\": \"email\"\n},\n\"description\": \"An array of email addresses to be included in the BCC field.\"\n},\n\"subject\": {\n\"type\": \"string\",\n\"description\": \"The subject of the email.\"\n},\n\"body\": {\n\"type\": \"string\",\n\"description\": \"The body text of the email.\"\n}\n},\n\"required\": [\"from\", \"to\", \"subject\", \"body\"],\n\"additionalProperties\": false\n}\n### Response:\nLlama.generate: prefix-match hit\nllama_print_timings: load time = 323.93 ms\nllama_print_timings: sample time = 1143.80 ms / 131 runs ( 8.73 ms per token, 114.53 tokens per second)\nllama_print_timings: prompt eval time = 954.76 ms / 372 tokens ( 2.57 ms per token, 389.63 tokens per second)\nllama_print_timings: eval time = 5865.64 ms / 130 runs ( 45.12 ms per token, 22.16 tokens per second)\nllama_print_timings: total time = 8286.14 ms",
"output": [
"{\"",
"b",
"cc",
"\":",
" [],",
"\"",
"body",
"\":",
" \"",
"Hello",
" my",
"friend",
",\\",
"n",
"\\",
"n",
"It",
" is",
" currently",
" ra",
"ining",
" in",
" Stockholm",
" and",
" the",
" temperature",
" is",
" around",
" ",
"1",
"5",
" degrees",
" Cel",
"si",
"us",
".",
" The",
" wind",
" is",
" strong",
" and",
" the",
" sky",
" is",
" over",
"cast",
",",
" but",
" it",
" won",
"'",
"t",
" last",
" long",
" as",
" we",
" are",
" expecting",
" sun",
"ny",
" weather",
" this",
" week",
"end",
".",
" It",
" is",
" a",
" good",
" day",
" for",
" a",
" pic",
"nic",
" or",
" a",
" walk",
" in",
" the",
" park",
"!\\",
"n",
"\\",
"n",
"Reg",
"ards",
",\\",
"n",
"And",
"reas",
"\",\"",
"cc",
"\":",
" [],",
"\"",
"from",
"\":",
" \"",
"and",
"reas",
"8",
"6",
"@",
"t",
"elia",
".",
"se",
"\",\"",
"subject",
"\":",
" \"",
"We",
"ather",
" Update",
" from",
" Stockholm",
"\",\"",
"to",
"\":",
" [\"",
"my",
"friend",
"@",
"t",
"elia",
".",
"se",
"\"]",
"}",
" "
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-09-22T22:11:42.978818Z",
"started_at": "2023-09-22T22:11:42.933003Z",
"completed_at": "2023-09-22T22:11:51.234816Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/rlnwn6dbidyjpx4qfiizgqcd2u/cancel",
"get": "https://api.replicate.com/v1/predictions/rlnwn6dbidyjpx4qfiizgqcd2u"
},
"metrics": {
"predict_time": 8.301813,
"total_time": 8.255998
}
}