MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / main

Function main

scripts/llm_mock.py:338–355  ·  view source on GitHub ↗

Start mock server

()

Source from the content-addressed store, hash-verified

336
337
338def 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
358if __name__ == "__main__":

Callers 1

llm_mock.pyFile · 0.70

Calls 2

infoMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected