nateraw / codellama-7b-instruct

  • Public
  • 18 runs
  • L40S

Run nateraw/codellama-7b-instruct with an API

Use one of our client libraries to get started quickly.

Set the REPLICATE_API_TOKEN environment variable

export REPLICATE_API_TOKEN=<paste-your-token-here>

Learn more about authentication

Install Replicate’s Node.js client library

npm install replicate
Learn more about setup

Run nateraw/codellama-7b-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

import Replicate from "replicate";
const replicate = new Replicate();

const input = {
    top_p: 0.95,
    message: "Write a python function that reads an html file from the internet and extracts the text content of all the h1 elements",
    temperature: 0.8,
    max_new_tokens: 1024
};

for await (const event of replicate.stream("nateraw/codellama-7b-instruct:6a9502976b5d020c6dd421d5790d988cd77013b642ea1276669550603a81989f", { input })) {
  process.stdout.write(`${event}`)
  //=> ""
};
process.stdout.write("\n");
Learn more