FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
yawnxyz
yawnxyzai
Public
Like
2
ai
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
2
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
main.tsx
https://yawnxyz--e5dd47ee279211f09d52569c3dd06744.web.val.run
README.md

An http and class wrapper for Vercel's AI SDK

Usage:

  • Groq: https://yawnxyz-ai.web.val.run/generate?prompt="tell me a beer joke"&provider=groq&model=llama3-8b-8192
  • Perplexity: https://yawnxyz-ai.web.val.run/generate?prompt="what's the latest phage directory capsid & tail article about?"&provider=perplexity
  • Mistral: https://yawnxyz-ai.web.val.run/generate?prompt="tell me a joke?"&provider=mistral&model="mistral-small-latest"
async function calculateEmbeddings(text) {
    const url = `https://yawnxyz-ai.web.val.run/generate?embed=true&value=${encodeURIComponent(text)}`;
    
    try {
        const response = await fetch(url);
        const data = await response.json();
        return data;
    } catch (error) {
        console.error('Error calculating embeddings:', error);
        return null;
    }
}

Migrated from folder: Libraries/ai/ai

HTTP
  • main.tsx
    yawnxyz--e5…44.web.val.run
Code
README.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.