Skip to content

Instantly share code, notes, and snippets.

@mubaidr
Created August 8, 2025 07:47
Show Gist options
  • Select an option

  • Save mubaidr/11c3bd7deb251a032646985c39098ad5 to your computer and use it in GitHub Desktop.

Select an option

Save mubaidr/11c3bd7deb251a032646985c39098ad5 to your computer and use it in GitHub Desktop.
Use custom open ai api compatible endpoints with vscode copilot via local proxy
# config.yaml
# This section defines the models that your local proxy will advertise.
model_list:
- model_name: openai/gpt-oss-120b
litellm_params:
model: nvidia_nim/openai/gpt-oss-120b # The actual model name on OpenRouter
supports_function_calling: true
supports_tool_choice: true
supports_parallel_function_calling: true
supports_streaming: true
supports_chat: true
rpm: 30
- model_name: nvidia/llama-3.3-nemotron-super-49b-v1.5
litellm_params:
model: nvidia_nim/nvidia/llama-3.3-nemotron-super-49b-v1.5 # The actual model name on OpenRouter
supports_function_calling: true
supports_tool_choice: true
supports_parallel_function_calling: true
supports_streaming: true
supports_chat: true
rpm: 30
#!/usr/bin/env bash
set -euo pipefail
# Export environment variables from .env if it exists
if [ -f .env ]; then
echo "Exporting environment variables from .env"
set -a
source .env
set +a
fi
uv run litellm --config config.yaml &
LITELLM_PID=$!
echo "Started litellm with PID $LITELLM_PID"
uvx oai2ollama &
OAI2OLLAMA_PID=$!
echo "Started oai2ollama (via uvx) with PID $OAI2OLLAMA_PID"
# Forward signals and cleanup
cleanup() {
echo "\nStopping background processes..."
kill $LITELLM_PID $OAI2OLLAMA_PID 2>/dev/null
wait $LITELLM_PID $OAI2OLLAMA_PID 2>/dev/null
exit 0
}
trap cleanup SIGINT SIGTERM
# Wait for both background processes
wait $LITELLM_PID $OAI2OLLAMA_PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment