fgpt
v.0.1.7
Ini memungkinkan Anda menggunakan API GPT-3.5 tanpa perlu mendaftar untuk mendapatkan kunci API atau membayar penggunaan.
? OpenAI GPT-3.5-turbo gratis untuk digunakan, tanpa akun atau kunci API apa pun
? JANGAN GUNAKAN DALAM PRODUKSI, HANYA UNTUK PENGGUNAAN/UJI PRIBADI
cargo install fgpt
# To get answers from GPT-3.5
fgpt " How to get a domain's MX record on linux shell? "
# Output plain code -c/--code
fgpt -c " Write python code to reverse a string "
# With pipe
cat README.md | fgpt " summarize for reddit post "
# With stdin
fgpt " Convert the follow csv data to json, without any description " < contacts.csv
# With file -f/--file
fgpt -f contacts.csv " Convert the follow csv data to json, without any description "
# REPL mode
fgpt
>> Write a javascript code to reverse a string
...
Jika Anda tidak dapat terhubung, Anda dapat mencoba menggunakan proxy. Proksi HTTP dan SOCKS5 didukung. Misalnya:
# 1. pass the proxy address by -p/--proxy
fgpt -p ' socks5://127.0.0.1:9080 ' " Linux command to list files in a directory "
# 2. pass the proxy address by environment variable
export HTTPS_PROXY= ' socks5://127.0.0.1:9080 '
fgpt " Linux command to list files in a directory "
# 3. use alias to set the proxy address
alias fgpt= ' fgpt -p "socks5://127.0.0.1:9080" '
fgpt " Linux command to list files in a directory "
fgpt --stats " Linux command to list files in a directory "
docker run -it --rm shenjinti/fgpt " Linux command to list files in a directory "
Menawarkan akses API yang dihosting sendiri secara gratis ke ChatGPT. Ini berguna jika Anda ingin menggunakan OpenAI API tanpa perlu mendaftar untuk mendapatkan kunci API.
fgpt -s 127.0.0.1:4090
Server lokal Anda sekarang akan berjalan dan dapat diakses di: http://127.0.0.1:4090/v1/chat/completions
import openai
import sys
openai . api_key = 'nothing'
openai . base_url = "http://127.0.0.1:4090/v1/"
completion = openai . chat . completions . create (
model = "gpt-3.5-turbo" ,
messages = [
{ "role" : "user" , "content" : "Write a javascript simple code" },
],
stream = True ,
)
for chunk in completion :
print ( chunk . choices [ 0 ]. delta . content , end = '' )
sys . stdout . flush ()
print ()
atau uji dengan curl:
curl -X POST -H " Content-Type: application/json " -d ' {"model":"gpt-3.5-turbo",
"messages":[{"role":"user","content":"Write a javascript simple code"}],
"stream":true} '
http://127.0.0.1:4090/v1/chat/completions
curl -X POST -H " Content-Type: application/json " -d ' {"model":"gpt-3.5-turbo",
"messages":[{"role":"user","content":"Write a javascript simple code"}]} '
http://127.0.0.1:4090/v1/chat/completions