Created
February 12, 2024 18:34
-
-
Save onlyoneaman/00f1051b2ae36bb3e819ce6007eac5be to your computer and use it in GitHub Desktop.
LLM App Worker Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Ai } from './vendor/@cloudflare/ai.js'; | |
export default { | |
async fetch(request, env) { | |
const body = await request.json(); | |
const ai = new Ai(env.AI); | |
const response = await ai.run("@hf/thebloke/llama-2-13b-chat-awq", body); | |
return new Response(JSON.stringify(response)); | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment