Skip to content

Commit

Permalink
Try copilot-more
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Dec 8, 2024
1 parent 6e68daa commit 547a3ab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 4 additions & 2 deletions aider
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ elif [ -n "$DEEPSEEK_API_KEY" ]; then
elif [[ "$OPENAI_API_BASE" == *"glhf.chat"* ]]; then
# inspired by https://www.youtube.com/watch?v=AFiH_aErDBA&ab_channel=AICodeKing
export MODELS="--architect --model openai/hf:Qwen/QwQ-32B-Preview --editor-model openai/hf:Qwen/Qwen2.5-Coder-32B-Instruct"
elif [[ "$OPENAI_API_BASE" == *"localhost:15432"* ]]; then
export MODELS='--model openai/claude-3.5-sonnet'
elif [[ "$OPENAI_API_BASE" == *"0.0.0.0:4000"* ]]; then
export MODELS='--model openai/xai:grok-beta'
elif [ -n "$ANTHROPIC_API_KEY" ]; then
# explicitly set the default
export MODELS="--model sonnet --weak-model haiku"
elif [[ "$OPENAI_API_BASE" == *"0.0.0.0"* ]]; then
export MODELS='--model openai/xai:grok-beta'
else
echo "No model available in the environment, please check .env file"
exit 1
Expand Down
17 changes: 16 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,29 @@ prep-llm:
# docker pull dockerproxy.net/paulgauthier/aider-full
cp -f aider /usr/local/bin

aider PARAMS: prep-llm
aider *PARAMS: prep-llm
aider {{PARAMS}}

llm-proxy *PARAMS:
#!/usr/bin/env bash
# uvx --python 3.11 --from 'litellm[proxy]' litellm {{PARAMS}}
aichat --serve 0.0.0.0:4000
cpm:
#!/usr/bin/env bash
# if env var REFRESH_TOKEN is not set, prompt for it
if [ -z "$REFRESH_TOKEN" ]; then
# curl https://github.com/login/device/code -X POST -d 'client_id=01ab8ac9400c4e429b23&scope=user:email'
# curl https://github.com/login/oauth/access_token -X POST -d 'client_id=01ab8ac9400c4e429b23&scope=user:email&device_code=YOUR_DEVICE_CODE&grant_type=urn:ietf:params:oauth:grant-type:device_code'
echo "Please follow https://github.com/jjleng/copilot-more to set up REFRESH_TOKEN"
fi
if [ ! -d ../copilot-more ]; then
(cd .. && git clone https://github.com/jjleng/copilot-more.git)
fi
cd ../copilot-more
uvx peotry install
uvx poetry run uvicorn copilot_more.server:app --port 15432
# works only for Ubuntu
[linux]
prep-cortex:
Expand Down

0 comments on commit 547a3ab

Please sign in to comment.