Start mock server
()
| 336 | |
| 337 | |
| 338 | def main(): |
| 339 | """Start mock server""" |
| 340 | global API_URL # Declare that we are modifying global variables |
| 341 | |
| 342 | parser = argparse.ArgumentParser(description="LLM Mock Service for AI Studio Proxy") |
| 343 | parser.add_argument( |
| 344 | "--main-server-port", |
| 345 | type=int, |
| 346 | default=DEFAULT_MAIN_SERVER_PORT, |
| 347 | help=f"Port of the main AI Studio Proxy server (default: {DEFAULT_MAIN_SERVER_PORT})", |
| 348 | ) |
| 349 | args = parser.parse_args() |
| 350 | |
| 351 | API_URL = f"http://localhost:{args.main_server_port}/v1/chat/completions" |
| 352 | |
| 353 | logger.info(f"Mock Ollama and API proxy server will forward requests to: {API_URL}") |
| 354 | logger.info("Starting Mock Ollama and API proxy server at: http://localhost:11434") |
| 355 | app.run(host="0.0.0.0", port=11434, debug=False) |
| 356 | |
| 357 | |
| 358 | if __name__ == "__main__": |
no test coverage detected