{"id":18233270,"url":"https://github.com/jkfran/azure-openai-deployment-mock","last_synced_at":"2026-01-28T08:38:36.381Z","repository":{"id":260912767,"uuid":"874857458","full_name":"jkfran/azure-openai-deployment-mock","owner":"jkfran","description":"A mock Azure OpenAI API for seamless testing and development, supporting both streaming and non-streaming responses. Easily emulate OpenAI completions with token-based streaming in a local or Dockerized environment.","archived":false,"fork":false,"pushed_at":"2024-11-03T14:40:32.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-03T07:25:51.797Z","etag":null,"topics":["ai-deployment","api-testing","azure","azure-openai-api","fastapi","local-development","mock-api","openai","streaming-api"],"latest_commit_sha":null,"homepage":"","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/jkfran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["jkfran"],"buy_me_a_coffee":"jkfran","custom":["https://paypal.me/jkfran"]}},"created_at":"2024-10-18T15:32:24.000Z","updated_at":"2025-10-10T15:25:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7a11974-5032-422b-8f6c-9801b9c522e1","html_url":"https://github.com/jkfran/azure-openai-deployment-mock","commit_stats":null,"previous_names":["jkfran/azure-openai-deployment-mock"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jkfran/azure-openai-deployment-mock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkfran%2Fazure-openai-deployment-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkfran%2Fazure-openai-deployment-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkfran%2Fazure-openai-deployment-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkfran%2Fazure-openai-deployment-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkfran","download_url":"https://codeload.github.com/jkfran/azure-openai-deployment-mock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkfran%2Fazure-openai-deployment-mock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28842868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ai-deployment","api-testing","azure","azure-openai-api","fastapi","local-development","mock-api","openai","streaming-api"],"created_at":"2024-11-04T15:03:34.811Z","updated_at":"2026-01-28T08:38:36.371Z","avatar_url":"https://github.com/jkfran.png","language":"Python","funding_links":["https://github.com/sponsors/jkfran","https://buymeacoffee.com/jkfran","https://paypal.me/jkfran"],"categories":[],"sub_categories":[],"readme":"# Azure OpenAI Deployment Mock\n\nThis project emulates or mocks Azure OpenAI API deployments for testing and development purposes.\n\n## Features\n\n- Mock both streaming and non-streaming responses.\n- Simulate token-based streaming for testing real-time API behaviors.\n\n## Requirements\n\n- Docker\n- Python 3.12 (for local development)\n\n## Setup and Usage\n\n### Running with Docker\n\nTo run this mock API using Docker, you can either pull the pre-built image directly from Docker Hub or build it locally:\n\n#### Option 1: Run with Pre-Built Image\n\nPull and run the Docker container from Docker Hub:\n\n```bash\ndocker run -p 8000:8000 jkfran/azure-openai-mock-api\n```\n\nThe API will be available at `http://localhost:8000`.\n\n#### Option 2: Build and Run Locally\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/jkfran/azure-openai-deployment-mock.git\n   cd azure-openai-deployment-mock\n   ```\n\n2. **Build the Docker image:**\n\n   ```bash\n   docker build -t azure-openai-mock-api .\n   ```\n\n3. **Run the Docker container:**\n\n   ```bash\n   docker run -p 8000:8000 azure-openai-mock-api\n   ```\n\n### Access the API\n\nThe API will be available at `http://localhost:8000`. You can interact with it using tools like Postman or curl.\n\n### API Endpoints\n\n#### POST `/openai/deployments/{model_name}/chat/completions`\n\nThis endpoint simulates an OpenAI completion request.\n\n##### Request Headers:\n\n- `api-key`: A required header to authenticate requests. You can use `MOCK-AZURE-OPENAI-API-KEY-1234567890` as the valid key.\n\n##### Request Body:\n\n- **stream**: Set to `true` to enable streaming responses. Default is `false`.\n\n#### Example Request:\n\n```bash\ncurl -X POST \"http://localhost:8000/openai/deployments/mock-deployment/chat/completions\" \\\n     -H \"api-key: MOCK-AZURE-OPENAI-API-KEY-1234567890\" \\\n     -d '{ \"stream\": true }'\n```\n\n### Local Development\n\nTo run the API locally without Docker, install the required Python dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\nRun the FastAPI server:\n\n```bash\nuvicorn mock_api:app --reload --host 0.0.0.0 --port 8000\n```\n\n### Contributing\n\nContributions are welcome! If you'd like to improve the mock API or add more features, feel free to fork the repository, make your changes, and open a pull request.\n\n1. Fork the project.\n2. Create a feature branch.\n3. Submit a pull request.\n\n### License\n\nThis project is open source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkfran%2Fazure-openai-deployment-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkfran%2Fazure-openai-deployment-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkfran%2Fazure-openai-deployment-mock/lists"}