<!-- Start of markdown source --> [LiteLLM](https://www.litellm.ai/) is an open-source LLM proxy that provides a unified OpenAI-compatible API for 100+ AI model providers. It acts as a translation layer between your local applications and remote AI models, allowing you to access different LLM providers through a single, consistent interface. By running LiteLLM locally, you can connect the **Claude Code** extension in **CCStudio™ IDE** to **GitHub Copilot** models, even though Claude Code is designed for Anthropic's Claude. LiteLLM handles the authentication, request translation, and routing, enabling you to use your existing GitHub Copilot subscription within CCStudio IDE's AI-powered development environment. This guide will walk you through setting up LiteLLM as a local proxy and configuring CCStudio IDE to access GitHub Copilot models through the Claude Code extension. --- ## Prerequisites Before you begin, ensure you have: - Active [GitHub Copilot](https://github.com/copilot) subscription. - [Python](https://www.python.org/) 3.9+ installed - [Node.js](https://nodejs.org) and [npm](https://www.npmjs.com/) installed - [CCStudio IDE](https://www.ti.com/tool/CCSTUDIO) installed (v20.5.1+) - Internet connection --- ## Table of Contents 1. [Install LiteLLM](#1-install-litellm) 2. [Configure LiteLLM](#2-configure-litellm) 3. [Start LiteLLM Proxy](#3-start-litellm-proxy) 4. [Authenticate with GitHub Copilot](#4-authenticate-with-github-copilot) 5. [Configure CCStudio IDE](#5-configure-theia-ide) 6. [Troubleshooting](#troubleshooting) --- ## 1. Install LiteLLM ### Windows (PowerShell) ```powershell # Install LiteLLM with proxy support pip install "litellm[proxy]" # Verify installation litellm --version ``` ### Ubuntu Linux ```bash # Install LiteLLM with proxy support pip install "litellm[proxy]" # Verify installation litellm --version ``` ### macOS ```bash # Install LiteLLM with proxy support pip3 install "litellm[proxy]" # Verify installation litellm --version ``` --- ## 2. Configure LiteLLM Create a configuration file for LiteLLM that defines the GitHub Copilot model. ### Windows (PowerShell) ```powershell # Create working directory mkdir $HOME\litellm-copilot cd $HOME\litellm-copilot # Create config file New-Item -Path . -Name "config.yaml" -ItemType "File" -Force # Open in Notepad notepad .\config.yaml ``` ### Ubuntu Linux ```bash # Create working directory mkdir ~/litellm-copilot cd ~/litellm-copilot # Create config file touch config.yaml # Open in nano (or use your preferred editor) nano config.yaml ``` ### macOS ```bash # Create working directory mkdir ~/litellm-copilot cd ~/litellm-copilot # Create config file touch config.yaml # Open in TextEdit (or use your preferred editor) open -a TextEdit config.yaml ``` ### Configuration Content Edit the `config.yaml` file accordingly. The content will vary depending on if the cloud GitHub Copilot service will be used or if a locally hosted model will be used. See the examples below: #### Example for Remote Cloud Based GitHub Copilot Service Using the **GitHub Copilot Free** Model ```yaml model_list: - model_name: github_copilot/gpt-4 litellm_params: model: github_copilot/gpt-4 litellm_settings: drop_params: true ``` **Note:** The `drop_params: true` setting prevents errors when Claude Code sends parameters that GitHub Copilot doesn't support. #### Example for Locally Hosted Copilot Model To use a locally hosted model (not the cloud GitHub Copilot service) with LiteLLM, configure `api_base` to point to your Copilot local server endpoint: ```yaml model_list: - model_name: local-copilot litellm_params: model: copilot api_base: http://localhost:8000 api_key: your_local_api_key litellm_settings: drop_params: true ``` **Note:** Adjust `model`, `api_base` and `api_key` according to your local setup. --- ## 3. Start LiteLLM Proxy ### Windows (PowerShell) ```powershell # Navigate to your config directory cd $HOME\litellm-copilot # Start LiteLLM proxy litellm --config config.yaml --port 4000 ``` ### Ubuntu Linux ```bash # Navigate to your config directory cd ~/litellm-copilot # Start LiteLLM proxy litellm --config config.yaml --port 4000 ``` ### macOS ```bash # Navigate to your config directory cd ~/litellm-copilot # Start LiteLLM proxy litellm --config config.yaml --port 4000 ``` **Expected Output:** `INFO: Uvicorn running on http://0.0.0.0:4000` You may see warnings like "error reading API endpoint from file" or "no existing token"—these are normal on first startup and will disappear after authentication. **Leave this terminal window open.** LiteLLM must stay running for the proxy to work. --- ## 4. Authenticate with GitHub Copilot (optional) [[b NOTE: For Cloud Based GitHub Copilot Service Only! These steps only apply when using the cloud based GitHub Copilot service. ]] If using the cloud based GitHub Copilot service, you need to authorize LiteLLM to access your GitHub Copilot subscription via OAuth device flow. ### Trigger Device Authentication Open a **second terminal window** and run: #### Windows (PowerShell) ```powershell curl.exe http://localhost:4000/v1/chat/completions ` -H "Content-Type: application/json" ` --data '{\"model\":\"github_copilot/gpt-4\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}' ``` #### Ubuntu Linux ```bash curl http://localhost:4000/v1/chat/completions \ -H "Content-Type: application/json" \ --data '{"model":"github_copilot/gpt-4","messages":[{"role":"user","content":"Hello"}]}' ``` #### macOS ```bash curl http://localhost:4000/v1/chat/completions \ -H "Content-Type: application/json" \ --data '{"model":"github_copilot/gpt-4","messages":[{"role":"user","content":"Hello"}]}' ``` ### Complete Device Authorization 1. **Watch the LiteLLM terminal** (the first window). You should see output like: `Please visit: https://github.com/login/device And enter code: ABCD-123` 2. **Open the URL** in your browser: https://github.com/login/device 3. **Enter the device code** shown in the terminal 4. **Approve the authorization** for GitHub Copilot 5. After approval, LiteLLM will save the authentication token locally 6. Your `curl` command should return a JSON response with Copilot's answer **Success!** You can now close the second terminal. Future requests won't require re-authentication. --- ## 5. Configure CCStudio IDE Now point CCStudio IDE's Claude Code extension to your local LiteLLM proxy. ### Steps 1. Open CCStudio IDE 2. Open the [AI Assistant Configurator](https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_ai.html#ai-assistant-configurator) view 3. Configure Custom Endpoint: Set the following values: ![AI Configuration](images/appnote-ccs_ai_litellm_configurator.png) 4. **Apply** settings 5. Reopen the Claude Code extension (if needed) ### Test the Connection 1. Open the Claude Code extension in CCStudio IDE 2. Send a test message 3. You should receive a response from GitHub Copilot Claude Code insde CCStudio IDE is now using GitHub Copilot models via LiteLLM. --- ## Troubleshooting ### LiteLLM won't start **Issue:** "Config cannot be None or Empty" **Solution:** Ensure `config.yaml` is not empty and contains valid YAML syntax. --- ### Connection refused to localhost:4000 **Issue:** `curl: Failed to connect to localhost port 4000` **Solution:** - Verify LiteLLM is still running (check the first terminal) - Restart LiteLLM: `litellm --config config.yaml --port 4000` - Check if another process is using port 4000: - **Windows:** `netstat -ano | findstr :4000` - **Linux/macOS:** `lsof -i :4000` --- ### "Tools array too long" error **Issue:** `Invalid 'tools': array too long. Expected maximum 128, but got [x]]` **Solution:** The GitHub Copilot Free model being used has a 128-tool limit. **Workarounds:** 1. Use a different model that supports more tools (e.g., add Claude to LiteLLM config) 2. Disable unnecessary tools in Claude Code settings 3. This limitation is specific to GitHub Copilot's API, not your setup --- ### "reasoning_effort" parameter error **Issue:** `UnsupportedParamsError: github_copilot does not support parameters: ['reasoning_effort']` **Solution:** Ensure `drop_params: true` is in your `config.yaml` under `litellm_settings`. --- ### Device code not appearing **Issue:** No device code shown after curl command **Solution:** - Check the LiteLLM terminal window (first terminal) for output - Ensure you're running the curl command in a separate terminal - Verify LiteLLM is running and listening on port 4000 --- ### Need to keep LiteLLM running **Note:** LiteLLM must stay running for CCStudio IDE to access Copilot. To run it in the background: #### Windows Use Windows Task Scheduler or run in a separate PowerShell window #### Linux/macOS ```bash # Run in background with nohup nohup litellm --config config.yaml --port 4000 > litellm.log 2>&1 & # Or use screen/tmux screen -S litellm litellm --config config.yaml --port 4000 # Press Ctrl+A, then D to detach ``` --- ## Additional Resources - [LiteLLM Documentation](https://docs.litellm.ai) - [GitHub Copilot Provider Guide](https://docs.litellm.ai/docs/providers/github_copilot) - [CCStudio IDE AI Documentation](https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_ai.html) - [LiteLLM GitHub Repository](https://github.com/BerriAI/litellm) --- ## Support If you encounter issues: - Check the [LiteLLM Troubleshooting Guide](https://docs.litellm.ai/docs/troubleshoot) - Review LiteLLM logs in your terminal - Visit the [LiteLLM GitHub Issues](https://github.com/BerriAI/litellm/issues) <!-- End of markdown source --> <div id="footer"></div>