Public
Readme
This is an AI code assistant powered by Cerebras, running llama3.3-70b.
Inspired by Hassan's Llama Coder.
- Sign up for Cerebras
- Get a Cerebras API Key
- Save it in a Val Town environment variable called
CEREBRAS_API_KEY
I'm looking for collaborators to help. Fork & send me PRs!
- Experiment with two prompt chain (started here)
Code
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
import { STARTER_PROMPTS } from "https://esm.town/v/stevekrouse/cerebras_coder_prompts";
// random 3 prompts from STARTER_PROMPTS
const prompts = STARTER_PROMPTS.sort(() => Math.random() - 0.5).slice(0, 4);
type PromptItem = typeof prompts[number];
const PoweredBy = ({ className }: { className?: string }) => (
<a
href="https://inference.cerebras.ai/"
target="_blank"
className={"p-[1px] text-gray-400 bg-[linear-gradient(90deg,_#0EAEE9_0%,_#22C55E_29%,_#D948EF_59%,_#8B5CF6_100%)] hover:bg-[linear-gradient(180deg,_#0EAEE9_0%,_#22C55E_29%,_#D948EF_59%,_#8B5CF6_100%)] transition-all w-fit mx-auto rounded-full hover:text-gray-200"
+ " " + className}
>
<div className="text-xs font-dm-mono rounded-full bg-[var(--dark)] px-4 py-2">
Powered by Llama3.3-70B on Cerebras
</div>
</a>
);
function Hero({
prompt,
setPrompt,
handleSubmit,
handleStarterPromptClick,
}: {
prompt: string;
setPrompt: React.Dispatch<React.SetStateAction<string>>;
handleSubmit: (e: React.FormEvent) => void;
handleStarterPromptClick: (promptItem: PromptItem) => void;
}) {
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
leandrioortiz-cerebras_coder.web.val.run
Updated: December 18, 2024