Skip to content

Commit

Permalink
Use aichat as proxy to make xai working for aider with outdated litel…
Browse files Browse the repository at this point in the history
…lm dep
  • Loading branch information
utensil committed Nov 15, 2024
1 parent ae42470 commit cb035ac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .env.in
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion aider
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cb035ac

Please sign in to comment.