{"id":26597200,"url":"https://github.com/oaklight/argo-proxy","last_synced_at":"2026-02-22T19:00:55.125Z","repository":{"id":283758947,"uuid":"896541935","full_name":"Oaklight/argo-proxy","owner":"Oaklight","description":"Proxy server to Argo API, OpenAI format compatible","archived":false,"fork":false,"pushed_at":"2026-02-18T08:32:44.000Z","size":1084,"stargazers_count":18,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-18T12:39:05.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://argo-proxy.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oaklight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-30T16:33:58.000Z","updated_at":"2026-02-18T08:32:48.000Z","dependencies_parsed_at":"2025-04-06T21:22:30.483Z","dependency_job_id":"1827438c-0023-4719-b917-4b58969ba67f","html_url":"https://github.com/Oaklight/argo-proxy","commit_stats":null,"previous_names":["oaklight/argo-proxy","oaklight/argo-openai-proxy"],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/Oaklight/argo-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fargo-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fargo-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fargo-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fargo-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oaklight","download_url":"https://codeload.github.com/Oaklight/argo-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fargo-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29723573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-23T17:32:00.328Z","updated_at":"2026-02-22T19:00:55.107Z","avatar_url":"https://github.com/Oaklight.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# argo-proxy\n\n[![PyPI version](https://badge.fury.io/py/argo-proxy.svg?icon=si%3Apython)](https://badge.fury.io/py/argo-proxy)\n[![GitHub version](https://badge.fury.io/gh/oaklight%2Fargo-proxy.svg?icon=si%3Agithub)](https://badge.fury.io/gh/oaklight%2Fargo-proxy)\n\nThis project is a proxy application that forwards requests to an ARGO API and optionally converts the responses to be compatible with OpenAI's API format. It can be used in conjunction with [autossh-tunnel-dockerized](https://github.com/Oaklight/autossh-tunnel-dockerized) or other secure connection tools.\n\nFor detailed information, please refer to documentation at [argo-proxy ReadtheDocs page](https://argo-proxy.readthedocs.io/en/latest/)\n\n## TL;DR\n\n```bash\npip install argo-proxy # install the package\nargo-proxy # run the proxy\n```\n\nFunction calling is available for Chat Completions endpoint starting from `v2.7.5`.\nTry with `pip install \"argo-proxy\u003e=2.7.5\"`\n\n**Now all models have native function calling in standard mode.** (Gemini native function calling support added in v2.8.0.)\n\n## NOTICE OF USAGE\n\nThe machine or server making API calls to Argo must be connected to the Argonne internal network or through a VPN on an Argonne-managed computer if you are working off-site. Your instance of the argo proxy should always be on-premise at an Argonne machine. The software is provided \"as is,\" without any warranties. By using this software, you accept that the authors, contributors, and affiliated organizations will not be liable for any damages or issues arising from its use. You are solely responsible for ensuring the software meets your requirements.\n\n- [Notice of Usage](#notice-of-usage)\n- [Deployment](#deployment)\n  - [Prerequisites](#prerequisites)\n  - [Configuration File](#configuration-file)\n  - [Running the Application](#running-the-application)\n  - [First-Time Setup](#first-time-setup)\n  - [Configuration Options Reference](#configuration-options-reference)\n  - [Streaming Modes: Real Stream vs Pseudo Stream](#streaming-modes-real-stream-vs-pseudo-stream)\n  - [`argo-proxy` CLI Available Options](#argo-proxy-cli-available-options)\n  - [Management Utilities](#management-utilities)\n- [Usage](#usage)\n  - [Endpoints](#endpoints)\n    - [OpenAI Compatible](#openai-compatible)\n    - [Not OpenAI Compatible](#not-openai-compatible)\n    - [Timeout Override](#timeout-override)\n  - [Models](#models)\n    - [Chat Models](#chat-models)\n    - [Embedding Models](#embedding-models)\n  - [Tool Calls](#tool-calls)\n    - [Tool Call Examples](#tool-call-examples)\n    - [ToolRegistry](#toolregistry)\n  - [Examples](#examples)\n    - [Raw Requests](#raw-requests)\n    - [OpenAI Client](#openai-client)\n- [Bug Reports and Contributions](#bug-reports-and-contributions)\n\n## Deployment\n\n### Prerequisites\n\n- **Python 3.10+** is required. \u003c/br\u003e\n  It is recommended to use conda, mamba, or pipx, etc., to manage an exclusive environment. \u003c/br\u003e\n  **Conda/Mamba** Download and install from: \u003chttps://conda-forge.org/download/\u003e \u003c/br\u003e\n  **pipx** Download and install from: \u003chttps://pipx.pypa.io/stable/installation/\u003e\n\n- Install dependencies:\n\n  PyPI current version: ![PyPI - Version](https://img.shields.io/pypi/v/argo-proxy)\n\n  ```bash\n  pip install argo-proxy\n  ```\n\n  To upgrade:\n\n  ```bash\n  argo-proxy --version  # Display current version\n  # Check against PyPI version\n  pip install argo-proxy --upgrade\n  ```\n\n  or, if you decide to use dev version (make sure you are at the root of the repo cloned):\n  ![GitHub Release](https://img.shields.io/github/v/release/Oaklight/argo-proxy)\n\n  ```bash\n  pip install .\n  ```\n\n### Configuration File\n\nIf you don't want to manually configure it, the [First-Time Setup](#first-time-setup) will automatically create it for you.\n\nThe application uses `config.yaml` for configuration. Here's an example:\n\n```yaml\nargo_embedding_url: \"https://apps.inside.anl.gov/argoapi/api/v1/resource/embed/\"\nargo_stream_url: \"https://apps-dev.inside.anl.gov/argoapi/api/v1/resource/streamchat/\"\nargo_url: \"https://apps-dev.inside.anl.gov/argoapi/api/v1/resource/chat/\"\nport: 44497\nhost: 0.0.0.0\nuser: \"your_username\" # set during first-time setup\nverbose: true # can be changed during setup\n```\n\n### Running the Application\n\nTo start the application:\n\n```bash\nargo-proxy [config_path]\n```\n\n- Without arguments: search for `config.yaml` under:\n  - current directory\n  - `~/.config/argoproxy/`\n  - `~/.argoproxy/`\n    The first one found will be used.\n- With path: uses specified config file, if exists. Otherwise, falls back to default search.\n\n  ```bash\n  argo-proxy /path/to/config.yaml\n  ```\n\n- With `--edit` flag: opens the config file in the default editor for modification.\n\n### First-Time Setup\n\nWhen running without an existing config file:\n\n1. The script offers to create `config.yaml` from `config.sample.yaml`\n2. Automatically selects a random available port (can be overridden)\n3. Prompts for:\n   - Your username (sets `user` field)\n   - Verbose mode preference (sets `verbose` field)\n4. Validates connectivity to configured URLs\n5. Shows the generated config in a formatted display for review before proceeding\n\nExample session:\n\n```bash\n$ argo-proxy\nNo valid configuration found.\nWould you like to create it from config.sample.yaml? [Y/n]:\nCreating new configuration...\nUse port [52226]? [Y/n/\u003cport\u003e]:\nEnter your username: your_username\nEnable verbose mode? [Y/n]\nCreated new configuration at: /home/your_username/.config/argoproxy/config.yaml\nUsing port 52226...\nValidating URL connectivity...\nCurrent configuration:\n--------------------------------------\n{\n    \"host\": \"0.0.0.0\",\n    \"port\": 52226,\n    \"user\": \"your_username\",\n    \"argo_url\": \"https://apps-dev.inside.anl.gov/argoapi/api/v1/resource/chat/\",\n    \"argo_stream_url\": \"https://apps-dev.inside.anl.gov/argoapi/api/v1/resource/streamchat/\",\n    \"argo_embedding_url\": \"https://apps.inside.anl.gov/argoapi/api/v1/resource/embed/\",\n    \"verbose\": true\n}\n--------------------------------------\n# ... proxy server starting info display ...\n```\n\n### Configuration Options Reference\n\n| Option               | Description                                                  | Default            |\n| -------------------- | ------------------------------------------------------------ | ------------------ |\n| `argo_embedding_url` | Argo Embedding API URL                                       | Prod URL           |\n| `argo_stream_url`    | Argo Stream API URL                                          | Dev URL (for now)  |\n| `argo_url`           | Argo Chat API URL                                            | Dev URL (for now)  |\n| `host`               | Host address to bind the server to                           | `0.0.0.0`          |\n| `port`               | Application port (random available port selected by default) | randomly assigned  |\n| `user`               | Your username                                                | (Set during setup) |\n| `verbose`            | Debug logging                                                | `true`             |\n| `real_stream`        | Enable real streaming mode (default since v2.7.7)            | `true`             |\n\n### Streaming Modes: Real Stream vs Pseudo Stream\n\nArgo Proxy supports two streaming modes for chat completions:\n\n#### Real Stream (Default since v2.7.7)\n\n- **Default behavior**: Enabled by default since v2.7.7 (`real_stream: true` or omitted in config)\n- **How it works**: Directly streams chunks from the upstream API as they arrive\n- **Advantages**:\n  - True real-time streaming behavior\n  - Lower latency for streaming responses\n  - More responsive user experience\n  - **Recommended for production use**\n\n#### Pseudo Stream\n\n- **Enable via**: Set `real_stream: false` in config file or use `--pseudo-stream` CLI flag\n- **How it works**: Receives the complete response from upstream, then simulates streaming by sending chunks to the client\n- **Status**: Available for compatibility with previous behavior and function calling\n\n#### Configuration Examples\n\n**Via config file:**\n\n```yaml\n# Enable real streaming (experimental)\nreal_stream: true\n\n# Or explicitly use pseudo streaming (default)\nreal_stream: false\n```\n\n**Via CLI flag:**\n\n```bash\n# Use default real streaming (since v2.7.7)\nargo-proxy\n\n# Enable legacy pseudo streaming\nargo-proxy --pseudo-stream\n```\n\n#### Function Calling Behavior\n\nWhen using function calling (tool calls):\n\n- **Native function calling support**: Available for OpenAI and Anthropic models. Gemini models is in development\n- **Real streaming compatible**: Native function calling works with both streaming modes\n- **OpenAI format**: All input and output remains in OpenAI format regardless of underlying model\n- **Legacy support**: Prompting-based function calling available via `--tool-prompting` flag\n\n### `argo-proxy` CLI Available Options\n\n```bash\n$ argo-proxy -h\nusage: argo-proxy [-h] [--host HOST] [--port PORT] [--verbose | --quiet]\n                  [--real-stream | --pseudo-stream] [--tool-prompting]\n                  [--edit] [--validate] [--show] [--version]\n                  [config]\n\nArgo Proxy CLI\n\npositional arguments:\n  config                Path to the configuration file\n\noptions:\n  -h, --help            show this help message and exit\n  --host HOST, -H HOST  Host address to bind the server to\n  --port PORT, -p PORT  Port number to bind the server to\n  --verbose, -v         Enable verbose logging, override if `verbose` set False in config\n  --quiet, -q           Disable verbose logging, override if `verbose` set True in config\n  --real-stream, -rs    Enable real streaming (default behavior), override if `real_stream` set False in config\n  --pseudo-stream, -ps  Enable pseudo streaming, override if `real_stream` set True or omitted in config\n  --tool-prompting      Enable prompting-based tool calls/function calling, otherwise use native tool calls/function calling\n  --edit, -e            Open the configuration file in the system's default editor for editing\n  --validate, -vv       Validate the configuration file and exit\n  --show, -s            Show the current configuration during launch\n  --version, -V         Show the version and check for updates\n```\n\n### Management Utilities\n\nThe following options help manage the configuration file:\n\n- `--edit, -e`: Open the configuration file in the system's default editor for editing.\n  - If no config file is specified, it will search in default locations (~/.config/argoproxy/, ~/.argoproxy/, or current directory)\n  - Tries common editors like nano, vi, vim (unix-like systems) or notepad (Windows)\n\n- `--validate, -vv`: Validate the configuration file and exit without starting the server.\n  - Useful for checking config syntax and connectivity before deployment\n\n- `--show, -s`: Show the current configuration during launch.\n  - Displays the fully resolved configuration including defaults\n  - Can be used with `--validate` to just display configuration without starting the server\n\n```bash\n# Example usage:\nargo-proxy --edit  # Edit config file\nargo-proxy --validate --show  # Validate and display config\nargo-proxy --show  # Show config at startup\n```\n\n## Usage\n\n### Endpoints\n\n#### OpenAI Compatible\n\nThese endpoints convert responses from the ARGO API to be compatible with OpenAI's format:\n\n- **`/v1/responses`**: Available from v2.7.0. Response API.\n- **`/v1/chat/completions`**: Chat Completions API.\n- **`/v1/completions`**: Legacy Completions API.\n- **`/v1/embeddings`**: Embedding API.\n- **`/v1/models`**: Lists available models in OpenAI-compatible format.\n\n#### Not OpenAI Compatible\n\nThese endpoints interact directly with the ARGO API and do not convert responses to OpenAI's format:\n\n- **`/v1/chat`**: Proxies requests to the ARGO API without conversion.\n- **`/v1/embed`**: Proxies requests to the ARGO Embedding API without conversion.\n\n#### Utility Endpoints\n\n- **`/health`**: Health check endpoint. Returns `200 OK` if the server is running.\n- **`/version`**: Returns the version of the ArgoProxy server. Notifies if a new version is available. Available from 2.7.0.post1.\n\n#### Timeout Override\n\nYou can override the default timeout with a `timeout` parameter in your request. This parameter is optional for client request. Proxy server will keep the connection open until it finishes or client disconnects.\n\nDetails of how to make such override in different query flavors: [Timeout Override Examples](timeout_examples.md)\n\n### Models\n\n#### Chat Models\n\n##### OpenAI Series\n\n| Original ARGO Model Name | Argo Proxy Name                          |\n| ------------------------ | ---------------------------------------- |\n| `gpt35`                  | `argo:gpt-3.5-turbo`                     |\n| `gpt35large`             | `argo:gpt-3.5-turbo-16k`                 |\n| `gpt4`                   | `argo:gpt-4`                             |\n| `gpt4large`              | `argo:gpt-4-32k`                         |\n| `gpt4turbo`              | `argo:gpt-4-turbo`                       |\n| `gpt4o`                  | `argo:gpt-4o`                            |\n| `gpt4olatest`            | `argo:gpt-4o-latest`                     |\n| `gpto1preview`           | `argo:gpt-o1-preview`, `argo:o1-preview` |\n| `gpto1mini`              | `argo:gpt-o1-mini`, `argo:o1-mini`       |\n| `gpto3mini`              | `argo:gpt-o3-mini`, `argo:o3-mini`       |\n| `gpto1`                  | `argo:gpt-o1`, `argo:o1`                 |\n| `gpto3`                  | `argo:gpt-o3`, `argo:o3`                 |\n| `gpto4mini`              | `argo:gpt-o4-mini`, `argo:o4-mini`       |\n| `gpt41`                  | `argo:gpt-4.1`                           |\n| `gpt41mini`              | `argo:gpt-4.1-mini`                      |\n| `gpt41nano`              | `argo:gpt-4.1-nano`                      |\n\n##### Google Gemini Series\n\n| Original ARGO Model Name | Argo Proxy Name         |\n| ------------------------ | ----------------------- |\n| `gemini25pro`            | `argo:gemini-2.5-pro`   |\n| `gemini25flash`          | `argo:gemini-2.5-flash` |\n\n##### Anthropic Claude Series\n\n| Original ARGO Model Name | Argo Proxy Name                                    |\n| ------------------------ | -------------------------------------------------- |\n| `claudeopus4`            | `argo:claude-opus-4`, `argo:claude-4-opus`         |\n| `claudesonnet4`          | `argo:claude-sonnet-4`, `argo:claude-4-sonnet`     |\n| `claudesonnet37`         | `argo:claude-sonnet-3.7`, `argo:claude-3.7-sonnet` |\n| `claudesonnet35v2`       | `argo:claude-sonnet-3.5`, `argo:claude-3.5-sonnet` |\n\n#### Embedding Models\n\n| Original ARGO Model Name | Argo Proxy Name               |\n| ------------------------ | ----------------------------- |\n| `ada002`                 | `argo:text-embedding-ada-002` |\n| `v3small`                | `argo:text-embedding-3-small` |\n| `v3large`                | `argo:text-embedding-3-large` |\n\n### Tool Calls\n\nThe tool calls (function calling) interface has been available since version v2.7.5.alpha1, now with **native function calling support**.\n\n#### Native Function Calling Support\n\n- **OpenAI models**: Full native function calling support\n- **Anthropic models**: Full native function calling support\n- **Gemini models**: Full native function calling support (added in v2.8.0)\n- **OpenAI format**: All input and output remains in OpenAI format regardless of underlying model\n\n#### Availability\n\n- Available on both streaming and non-streaming **chat completion** endpoints\n- Only supported on `/v1/chat/completions` endpoint\n- Argo passthrough endpoint (`/v1/chat`) and response endpoint (`/v1/chat/response`) not yet implemented due to limited development time\n- Legacy completion endpoints (`/v1/completions`) do not support tool calling\n\n#### Tool Call Examples\n\n- **Function Calling OpenAI Client**: [function_calling_chat.py](examples/openai_client/function_calling_chat.py)\n- **Function Calling Raw Request**: [function_calling_chat.py](examples/raw_requests/function_calling_chat.py)\n\nFor more usage details, refer to the [OpenAI documentation](https://platform.openai.com/docs/guides/function-calling).\n\n#### ToolRegistry\n\nA lightweight yet powerful Python helper library is available for various tool handling: [ToolRegistry](https://github.com/Oaklight/ToolRegistry). It works with any OpenAI-compatible API, including Argo Proxy starting from version v2.7.5.alpha1.\n\n### Examples\n\n#### Raw Requests\n\nFor examples of how to use the raw request utilities (e.g., `httpx`, `requests`), refer to:\n\n##### Direct Access to ARGO\n\n- **Direct Chat Example**: [argo_chat.py](examples/raw_requests/argo_chat.py)\n- **Direct Chat Stream Example**: [argo_chat_stream.py](examples/raw_requests/argo_chat_stream.py)\n- **Direct Embedding Example**: [argo_embed.py](examples/raw_requests/argo_embed.py)\n\n##### OpenAI Compatible Requests\n\n- **Chat Completions Example**: [chat_completions.py](examples/raw_requests/chat_completions.py)\n- **Chat Completions Stream Example**: [chat_completions_stream.py](examples/raw_requests/chat_completions_stream.py)\n- **Legacy Completions Example**: [legacy_completions.py](examples/raw_requests/legacy_completions.py)\n- **Legacy Completions Stream Example**: [legacy_completions_stream.py](examples/raw_requests/legacy_completions_stream.py)\n- **Responses Example**: [responses.py](examples/raw_requests/responses.py)\n- **Responses Stream Example**: [responses_stream.py](examples/raw_requests/responses_stream.py)\n- **Embedding Example**: [embedding.py](examples/raw_requests/embedding.py)\n- **o1 Mini Chat Completions Example**: [o1_mini_chat_completions.py](examples/raw_requests/o1_mini_chat_completions.py)\n\n#### OpenAI Client\n\nFor examples demonstrating the use case of the OpenAI client (`openai.OpenAI`), refer to:\n\n- **Chat Completions Example**: [chat_completions.py](examples/openai_client/chat_completions.py)\n- **Chat Completions Stream Example**: [chat_completions_stream.py](examples/openai_client/chat_completions_stream.py)\n- **Legacy Completions Example**: [legacy_completions.py](examples/openai_client/legacy_completions.py)\n- **Legacy Completions Stream Example**: [legacy_completions_stream.py](examples/openai_client/legacy_completions_stream.py)\n- **Responses Example**: [responses.py](examples/openai_client/responses.py)\n- **Responses Stream Example**: [responses_stream.py](examples/openai_client/responses_stream.py)\n- **Embedding Example**: [embedding.py](examples/openai_client/embedding.py)\n- **O3 Mini Simple Chatbot Example**: [o3_mini_simple_chatbot.py](examples/openai_client/o3_mini_simple_chatbot.py)\n\n## Bug Reports and Contributions\n\nThis project is developed in my spare time. Bugs and issues may exist. If you encounter any or have suggestions for improvements, please [open an issue](https://github.com/Oaklight/argo-proxy/issues/new) or [submit a pull request](https://github.com/Oaklight/argo-proxy/compare). Your contributions are highly appreciated!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foaklight%2Fargo-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foaklight%2Fargo-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foaklight%2Fargo-proxy/lists"}