This project provides a compatibility layer that transforms OpenAI-style API requests into Argonne National Lab's Argo API format. It supports chat completions, text completions, and embeddings endpoints.
Several tools have been tested with the bridge, including IDE integrations, web UI's, and python libraries. Setup guides for these tools tools are located in the downstream_config.md.
First, create a new conda environment with Python 3.12:
conda create -n argo_bridge python=3.12
conda activate argo_bridge
Install the required Python packages using pip:
pip install -r requirements.txt
Start the server with default settings (port 7285):
python argo_bridge.py
The server supports the following command-line arguments:
--username
: Set the username for API requests (default: 'APS')--port
: Set the port number for the server (default: 7285)--dlog
: Enable debug-level logging (when set, logging is at DEBUG level; by default it is INFO level)
Example with custom settings:
python argo_bridge.py --username custom_user --port 8000 --dlog
The API exposes the following endpoints:
- Chat Completions:
/chat/completions
(POST) - Text (Legacy) Completions:
/completions
(POST) - Embeddings:
/embeddings
(POST)
The server accepts both Argo and OpenAI model identifiers.
- GPT-3.5: (
gpt35
,gpt-3.5
) - GPT-3.5 Large: (
gpt35large
) - GPT-4: (
gpt4
,gpt-4
) - GPT-4 Large: (
gpt4large
) - GPT-4 Turbo: (
gpt4turbo
,gpt-4-turbo
) - GPT-4o: (
gpt4o
,gpt-4o
,gpt-4o-mini
) - GPT-o1 Preview: (
gpto1preview
,o1-preview
) - GPT-o1 Mini: (
gpto1mini
,o1-mini
,o1mini
) - GPT-o3 Mini: (
gpto3mini
,o3-mini
,o3mini
)
- v3small: (
text-embedding-3-small
,v3small
) - v3large: (
text-embedding-3-large
,v3large
) - ada002: (
text-embedding-ada-002
,ada002
)
For personal use, the development server should be plenty, but if you wish to scale up gunicorn is included in the requirements.
gunicorn --workers 4 --bind localhost:7285 argo_bridge:app
Run the test suite using unittest:
python -m unittest test_server.py