// Please make sure that you run 'npm install @eachlabs/aiflow@latest'importEachfrom'@eachlabs/aiflow';const each =newEach({auth: process.env.EACH_API_KEY||'YOUR_API_KEY'});
// Please make sure that you run 'npm install @eachlabs/aiflow'importEachfrom'@eachlabs/aiflow';const each =newEach({auth: process.env.EACH_API_KEY||'YOUR_API_KEY'});const out =await each.predictions.run({model:"meta-llama-3-8b-instruct",version:"0.0.1",input:{"top_p":0.9,"prompt":"Write a paragraph about Turkish tea","max_tokens":512,"min_tokens":0,"temperature":0.6,"prompt_template":"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nYou are a helpful assistant<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n","presence_penalty":0,"frequency_penalty":0},});console.log(out)
You can improve open-source models with your own data to create new models that are better suited to specific tasks.
Image models like SDXL can generate images of a particular person, object, or style.
// Please make sure that you run 'npm install @eachlabs/aiflow'importEachfrom'@eachlabs/aiflow';const each =newEach({auth: process.env.EACH_API_KEY||'YOUR_API_KEY'});const training = each.training.create("sdxl-training:13853038482995843",{input:{"input_images": "https://example.url/pictures.zip},destination:"eftal/sdxl-finetuned-with-pictures"})console.log(training)// When Traning completed you can call your custom inference api const output = each.predictions.run("eftal/sdxl-finetuned-with-pictures",{input:{width:512,height:512,prompt:"a spaceship into the ocean, dramatic lights, hd",scheduler:"K_EULER",num_outputs:1,guidance_scale:7.5,num_inference_steps:50},})console.log(output)