From cb035ac9edaaddfdd17667f579a0fc228bc09e96 Mon Sep 17 00:00:00 2001 From: utensil Date: Fri, 15 Nov 2024 20:49:10 +0800 Subject: [PATCH] Use aichat as proxy to make xai working for aider with outdated litellm dep --- .env.in | 8 ++++++++ aider | 2 +- justfile | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .env.in diff --git a/.env.in b/.env.in new file mode 100644 index 0000000..b356439 --- /dev/null +++ b/.env.in @@ -0,0 +1,8 @@ +XAI_API_KEY=xai-xxxx +GITHUB_TOKEN=github_pat_xxxx +GITHUB_API_KEY=github_pat_xxxx +AUTH=utensil:xxxx +# OPENAI_API_BASE=https://glhf.chat/api/openai/v1 +OPENAI_API_KEY=glhf_xxxx +OPENAI_API_BASE=http://0.0.0.0:4000/v1/ +HUGGINGFACE_API_KEY=hf_xxxx diff --git a/aider b/aider index d9b28e3..68cfcf7 100755 --- a/aider +++ b/aider @@ -3,4 +3,4 @@ # This is need for Mac as the default clang is too old export CC=/opt/homebrew/opt/llvm/bin/clang CXX=/opt/homebrew/opt/llvm/bin/clang++ CPATH=/opt/homebrew/opt/llvm/include LIBRARY_PATH=/opt/homebrew/opt/llvm/lib # This runs aider in a virtual environment with the specified model, configs etc. -uvx --python 3.11 --from aider-chat[help,playwright] aider --no-show-model-warnings --model github/gpt-4o --max-chat-history-tokens 8000 --dark-mode --subtree-only "$@" +uvx --python 3.11 --from 'aider-chat[help,playwright]' aider --no-show-model-warnings --model 'openai/xai:grok-beta' --max-chat-history-tokens 8000 --dark-mode --subtree-only "$@" diff --git a/justfile b/justfile index 10d1274..a0316d0 100644 --- a/justfile +++ b/justfile @@ -455,3 +455,8 @@ prep-llm: # docker pull dockerproxy.net/paulgauthier/aider-full cp -f aider /usr/local/bin +llm-proxy *PARAMS: + #!/usr/bin/env bash + # uvx --python 3.11 --from 'litellm[proxy]' litellm {{PARAMS}} + aichat --serve 0.0.0.0:4000 +