new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

friendliai/options

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

FriendliAI regex structured output option

FriendliAI supports regex option to control the format of LLM output by specifying patterns. This is available with both generateText and streamText functions and can be passed as a parameter in the model configuration, for example: friendli('meta-llama-3.1-8b-instruct', { regex: new RegExp('[\n ,.?!0-9\uac00-\ud7af]*') })

FriendliAI built-in tools option

FriendliAI supports built-in tools (currently in beta) via the tools option in the model configuration. Tools include 'web:search' and 'math:calculator'. Example: friendli('meta-llama-3.3-70b-instruct', { tools: [{ type: 'web:search' }, { type: 'math:calculator' }] })

FriendliAI Dedicated Endpoints support

FriendliAI supports custom models via Dedicated Endpoints. You can use the friendli instance with the endpoint ID, for example: friendli('YOUR_ENDPOINT_ID'). You can force requests to dedicated endpoints by passing endpoint: 'dedicated' in the model configuration.

FriendliAI regex structured output example

import { friendli } from '@friendliai/ai-provider'; import { generateText } from 'ai'; const { text } = await generateText({ model: friendli('meta-llama-3.1-8b-instruct', { regex: new RegExp('[\n ,.?!0-9\uac00-\ud7af]*'), }), prompt: 'Who is the first king of the Joseon Dynasty?', }); console.log(text);

FriendliAI built-in tools example

import { friendli } from '@friendliai/ai-provider'; import { streamText } from 'ai'; const result = streamText({ model: friendli('meta-llama-3.3-70b-instruct', { tools: [{ type: 'web:search' }, { type: 'math:calculator' }], }), prompt: 'Find the current USD to CAD exchange rate and calculate how much $5,000 USD would be in Canadian dollars.', }); for await (const textPart of result.textStream) { console.log(textPart); }

FriendliAI Dedicated Endpoints example

import { friendli } from '@friendliai/ai-provider'; import { generateText } from 'ai'; const { text } = await generateText({ model: friendli('YOUR_ENDPOINT_ID', { endpoint: 'dedicated', }), prompt: 'What is the meaning of life?', }); console.log(text);

Give your agent this brain