Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
meta /codellama-13b-python:09b87c02
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run meta/codellama-13b-python using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"meta/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d",
{
input: {
debug: false,
top_k: 250,
top_p: 0.95,
prompt: "# function that adds 2 number inputs.",
temperature: 0.95,
max_new_tokens: 50,
min_new_tokens: -1,
repetition_penalty: 1.15,
repetition_penalty_sustain: 256,
token_repetition_penalty_decay: 128
}
}
);
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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run meta/codellama-13b-python using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"meta/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d",
input={
"debug": False,
"top_k": 250,
"top_p": 0.95,
"prompt": "# function that adds 2 number inputs.",
"temperature": 0.95,
"max_new_tokens": 50,
"min_new_tokens": -1,
"repetition_penalty": 1.15,
"repetition_penalty_sustain": 256,
"token_repetition_penalty_decay": 128
}
)
# The meta/codellama-13b-python 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/meta/codellama-13b-python/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=<paste-your-token-here>
Find your API token in your account settings.
Run meta/codellama-13b-python 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": "meta/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d",
"input": {
"debug": false,
"top_k": 250,
"top_p": 0.95,
"prompt": "# function that adds 2 number inputs.",
"temperature": 0.95,
"max_new_tokens": 50,
"min_new_tokens": -1,
"repetition_penalty": 1.15,
"repetition_penalty_sustain": 256,
"token_repetition_penalty_decay": 128
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-08-26T05:35:02.511696Z",
"created_at": "2023-08-26T05:35:00.054172Z",
"data_removed": false,
"error": null,
"id": "e62bcwdbfvqjhbul33unml46by",
"input": {
"debug": false,
"top_k": 250,
"top_p": 0.95,
"prompt": "# function that adds 2 number inputs.",
"temperature": 0.95,
"max_new_tokens": 50,
"min_new_tokens": -1,
"repetition_penalty": 1.15,
"repetition_penalty_sustain": 256,
"token_repetition_penalty_decay": 128
},
"logs": "Prompt:\n# function that adds 2 number inputs.\n** Speed: 45.03 tokens/second",
"metrics": {
"predict_time": 2.480685,
"total_time": 2.457524
},
"output": [
"\n",
" ",
" def",
" add",
"(",
"self",
",",
" input",
"1",
":",
" int",
",",
" input",
"2",
":",
" int",
")",
" ->",
" float",
":",
"\n",
" ",
" return",
" (",
"input",
"1",
" +",
" input",
"2",
" )",
"\n",
"\n",
"if",
" __",
"name",
"__",
" ==",
" \"",
"__",
"main",
"__",
"\":",
"\n",
" ",
" print",
" (\"",
"enter",
" two",
" values",
" \")"
],
"started_at": "2023-08-26T05:35:00.031011Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/e62bcwdbfvqjhbul33unml46by",
"cancel": "https://api.replicate.com/v1/predictions/e62bcwdbfvqjhbul33unml46by/cancel"
},
"version": "09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d"
}
Prompt:
# function that adds 2 number inputs.
** Speed: 45.03 tokens/second