Perplexity: Llama 3.1 Sonar 8B

perplexity/llama-3.1-sonar-small-128k-chat

Llama 3.1 Sonar is Perplexity's latest model family. It surpasses their earlier Sonar models in cost-efficiency, speed, and performance. This is a normal offline LLM, but the [online version](/models/perplexity/llama-3.1-sonar-small-128k-online) of this model has Internet access.

Pricing

Price per input token: $0.0000002

Price per output token: $0.0000002

Usage Example

NOTE: BrainLink is compatible with the OpenAI API, which allows you to use the OpenAI SDK even with non-OpenAI models

import OpenAI from "openai";
const userAccessToken = await BrainLink.getUserToken();
const openai = new OpenAI({
    baseURL: "https://www.brainlink.dev/api/v1",
    apiKey: userAccessToken,
});
const completion = await openai.chat.completions.create({
    model: "perplexity/llama-3.1-sonar-small-128k-chat",
    messages: [
      { role: "user", content: "Hi! How are you today?" }
    ],
});