Crates.io | duckai |
lib.rs | duckai |
version | 0.2.0 |
source | src |
created_at | 2024-10-20 13:05:02.471085 |
updated_at | 2024-11-09 04:38:17.459872 |
description | DuckDuckGo AI to OpenAI API |
homepage | |
repository | https://github.com/penumbra-x/duckai |
max_upload_size | |
id | 1416204 |
size | 147,054 |
🚀 Support my journey to full-time open-source development by sponsoring me on GitHub
DuckDuckGo AI to OpenAI API
Model mapping, unsupported models default to gpt-4o-mini
gpt-4o-mini
claude-3-haiku-20240307
meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
mistralai/Mixtral-8x7B-Instruct-v0.1
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
}'
$ duckai -h
DuckDuckGo AI to OpenAI
Usage: 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 the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
$ duckai run -h
Run server
Usage: duckai run [CONFIG_PATH]
Arguments:
[CONFIG_PATH] Configuration filepath [default: duckai.yaml]
Options:
-h, --help Print help
cargo install duckai
docker run --rm -it -p 8080:8080 ghcr.io/penumbra-x/duckai:latest run
# Required install docker
cargo install cross
cross build --target x86_64-unknown-linux-musl --release
cross build --target aarch64-unknown-linux-musl --release
duckai gt # Generate duckai.yaml file (current directory)
# Debug mode
debug: false
# Listen address
bind: 0.0.0.0:8080
# Client timeout
timeout: 60
# Client connect timeout
connect_timeout: 10
# Client tcp keepalive
tcp_keepalive: 90
# Maximum tcp connection
concurrent: 100
# Proxy pool
proxies:
- !url http://127.0.0.1:6152
- !url socks5://127.0.0.1:6153
- !cidr 2001:470:e953::/48
- !iface 192.168.1.10
# Enable TLS
tls_cert: null
tls_key: null
# API key
api_key: null
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 addressCIDR
,support IPv4
/IPv6
subnet, the premise is that the subnet routes are normally communicableIf you want to submit contributions, please open Pull Request
Your questions may have been answered in issues