{"id":22521771,"url":"https://github.com/al0olo/retellai-python-backend","last_synced_at":"2026-05-15T18:08:00.137Z","repository":{"id":253325761,"uuid":"764856918","full_name":"Al0olo/RetellAI-Python-Backend","owner":"Al0olo","description":"Python Server for deploying LLM Models","archived":false,"fork":false,"pushed_at":"2024-08-15T23:28:18.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T04:41:46.968Z","etag":null,"topics":["llm","openai","python","retell","server"],"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/Al0olo.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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-02-28T20:47:34.000Z","updated_at":"2024-08-15T23:28:21.000Z","dependencies_parsed_at":"2024-08-16T00:57:56.856Z","dependency_job_id":null,"html_url":"https://github.com/Al0olo/RetellAI-Python-Backend","commit_stats":null,"previous_names":["al0olo/retellai-python-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2FRetellAI-Python-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2FRetellAI-Python-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2FRetellAI-Python-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2FRetellAI-Python-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Al0olo","download_url":"https://codeload.github.com/Al0olo/RetellAI-Python-Backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245962948,"owners_count":20701212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["llm","openai","python","retell","server"],"created_at":"2024-12-07T05:12:51.381Z","updated_at":"2025-10-25T02:25:09.500Z","avatar_url":"https://github.com/Al0olo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-backend-demo\n\nThis is a sample demo repo to show how to have your own LLM plugged into Retell.\n\nThis repo currently uses `OpenAI` endpoint, and is not as stable and fast as `Azure\nOpenAI` endpoint. So expect a more varying delay. Feel free to contribute to make\nthis demo more realistic.\n\n## Steps to run in localhost\n\n1. First install dependencies\n\n```bash\npip3 install -r requirements.txt\n```\n\n2. Fill out the API keys in `.env`\n\n3. In another bash, use ngrok to expose this port to public network\n\n```bash\nngrok http 8080\n```\n\n4. Start the websocket server\n\n```bash\nuvicorn server:app --reload --port=8080\n```\n\nYou should see a fowarding address like\n`https://dc14-2601-645-c57f-8670-9986-5662-2c9a-adbd.ngrok-free.app`, and you\nare going to take the IP address, prepend it with wss, postpend with\n`llm-websocket` path and use that in the [dashboard](https://beta.retellai.com/dashboard) to create a new `agent`. Now\nthe `agent` you created should connect with your localhost.\n\nThe custom LLM URL would look like\n`wss://dc14-2601-645-c57f-8670-9986-5662-2c9a-adbd.ngrok-free.app/llm-websocket`\n\n### Optional: Phone Call Features via Twilio\n\nThe `twilio_server.py` contains helper functions you could utilize to create phone numbers, tie agent to a number,\nmake a phone call with an agent, etc. Here we assume you already created agent from last step, and have `agent id` ready.\n\nTo ues these features, follow these steps:\n\n1. Uncomment twilio client initialization and `listen_twilio_voice_webhook(agent_id_path)` in `server.py` file to set up Twilio voice webhook. What this does is that every time a number of yours in Twilio get called, it would call this webhook which internally calls the `register-call` API and sends the correct audio websocket address back to Twilio, so it can connects with Retell to start the call.\n\n2. Put your ngrok ip address into `.env`, it would be something like `https://dc14-2601-645-c57f-8670-9986-5662-2c9a-adbd.ngrok-free.app`.\n\n3. (optional) Call `create_phone_number` to get a new number and associate with an agent id. This phone number now can handle inbound calls as long as this server is running.\n\n4. (optional) Call `register_phone_agent` to register your Twilio number and associate with an agent id. This phone number now can handle inbound calls as long as this server is running.\n\n5. (optional) Call `delete_phone_number` to release a number from your Twilio pool.\n\n6. (optional) Call `transfer_call` to transfer this on-going call to a destination number.\n\n7. (optional) Call `end_call` to end this on-going call.\n\n8. Call `create_phone_call` to start a call with caller \u0026 callee number, and your agent Id. This call would use the agent id supplied, and ignore the agent id you set up in step 3 or 4. It automatically hang up if machine/voicemail/IVR is detected. To turn it off, remove \"machineDetection, asyncAmd\" params.\n\n## Run in prod\n\nTo run in prod, you probably want to customize your LLM solution, host the code\nin a cloud, and use that IP to create agent.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal0olo%2Fretellai-python-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal0olo%2Fretellai-python-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal0olo%2Fretellai-python-backend/lists"}