Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

DuckDuckGo AI to OpenAI API

License

NotificationsYou must be signed in to change notification settings

0x676e67/duckai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crates.io Licensecrates.ioCrates.io Total Downloads

🚀 Support my journey to full-time open-source development bysponsoring me on GitHub

DuckDuckGo AI to OpenAI API

  • API authentication
  • Support IP proxy pool
  • Built-in Http connection pool
  • Streaming/non-streaming API

Model

Model mapping, unsupported models default togpt-4o-mini

  • gpt-4o-mini ->gpt-4o-mini
  • claude-3-haiku ->claude-3-haiku-20240307
  • llama-3.1-70b ->meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
  • mixtral-8x7b ->mistralai/Mixtral-8x7B-Instruct-v0.1

Chat

curl --request POST'http://127.0.0.1:8080/v1/chat/completions' \  --header'Content-Type: application/json' \  --data'{    "messages": [      {        "role": "user",        "content": "Rust example."      }    ],    "model": "gpt-4o-mini",    "stream": true  }'

Command

$ duckai -hDuckDuckGo AI to OpenAIUsage: duckai       duckai<COMMAND>Commands:  run      Run server  start    Start server daemon  restart  Restart server daemon  stop     Stop server daemon  log      Show the server daemon log  ps       Show the server daemon process  gt       Generate config template file (yaml format file)help     Print this message or thehelp of the given subcommand(s)Options:  -h, --help     Printhelp  -V, --version  Print version$ duckai run -hRun serverUsage: duckai run [CONFIG_PATH]Arguments:  [CONFIG_PATH]  Configuration filepath [default: duckai.yaml]Options:  -h, --help  Printhelp

Install

If you need more detailed installation and usage information, please check here
  1. Install
  • cargo
cargo install duckai
  • Dokcer
docker run --rm -it -p 8080:8080 ghcr.io/penumbra-x/duckai:latest run
  • Compile
# Required install dockercargo install crosscross build --target x86_64-unknown-linux-musl --releasecross build --target aarch64-unknown-linux-musl --release
  1. Generate config template file
duckai gt# Generate duckai.yaml file (current directory)
# Debug modedebug:false# Listen addressbind:0.0.0.0:8080# Client timeouttimeout:60# Client connect timeoutconnect_timeout:10# Client tcp keepalivetcp_keepalive:90# Maximum tcp connectionconcurrent:100# Proxy poolproxies:-!urlhttp://127.0.0.1:6152-!urlsocks5://127.0.0.1:6153-!cidr2001:470:e953::/48-!iface192.168.1.10# Enable TLStls_cert:nulltls_key:null# API keyapi_key:null
  1. Proxy pool

IP proxy pool type supports three types (priority:CIDR >Proxy >Interface, using round-robin strategy):

  • URL,protocol supports:http/https/socks4/socks5/socks5h
  • Interface,bind local network interface address
  • CIDR,supportIPv4/IPv6 subnet, the premise is that the subnet routes are normally communicable

Contribution

If you want to submit contributions, please openPull Request

Get help

Your questions may have been answered inissues


[8]ページ先頭

©2009-2025 Movatter.jp