LocalAI: Difference between revisions

From DWIKI
mNo edit summary
Line 1: Line 1:
=Links=
=Links=
*[https://localai.io LocalAI homepage]
*[https://localai.io LocalAI homepage]
==Audio to text==
*https://localai.io/features/audio-to-text/
*https://docs.llamaindex.ai/en/stable/examples/llm/localai/


=Scripts=
=Scripts=

Revision as of 15:35, 31 March 2024

Links


Audio to text

Scripts

Talk to the chat interface

#!/bin/bash
echo -n "Ask me anything: "
read A
curl -s http://localhost:8080/v1/chat/completions \
   -H "Content-Type: application/json" \
   -d '{ "model": "gpt-4", "messages": [{"role": "user", "content": "'"$A"'", "temperature": 0.1}] }' |\
    jq     '.choices[].message.content' | sed 's/\\n/\n/g' | sed 's/\\"/"/g'