In this tutorial, we will guide you through the steps to create a Chainlit application integrated with LiteLLM ProxyThe benefits of using LiteLLM Proxy with Chainlit is:
Use Virtual Keys to set budget limits and track usage
see LLM API calls in a step in the UI, and you can explore them in the prompt playground.
You shouldn’t configure this integration if you’re already using another
integration like Langchain or LlamaIndex. Both integrations would
record the same generation and create duplicate steps in the UI.
To start your app, open a terminal and navigate to the directory containing app.py. Then run the following command:
chainlit run app.py -w
The -w flag tells Chainlit to enable auto-reloading, so you don’t need to restart the server every time you make changes to your application. Your chatbot UI should now be accessible at http://localhost:8000.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Chainlit","colors":{"primary":"#F80061","light":"#FFE7EB","dark":"#980039"},"logo":{"light":"https://mintcdn.com/chainlit-43/bY2N4qUEa_bGPLfY/logo/light.svg?fit=max\u0026auto=format\u0026n=bY2N4qUEa_bGPLfY\u0026q=85\u0026s=1b972cff6fb5980cf9bfb5c54d6b6821","dark":"https://mintcdn.com/chainlit-43/bY2N4qUEa_bGPLfY/logo/dark.svg?fit=max\u0026auto=format\u0026n=bY2N4qUEa_bGPLfY\u0026q=85\u0026s=2a67b9dc2c050be4fc5095c69d4adbb0","href":"https://github.com/Chainlit/chainlit"},"favicon":"https://mintcdn.com/chainlit-43/b2WeFP1vh0enOZXn/favicon.svg?fit=max\u0026auto=format\u0026n=b2WeFP1vh0enOZXn\u0026q=85\u0026s=513b4ccbfc1227b2ee36e6d5bb798e8e","appearance":{"default":"dark","strict":false},"background":{"color":{"dark":"#111010"}},"navbar":{"links":[{"href":"https://github.com/Chainlit/chainlit","label":"Github"}],"primary":{"type":"button","label":"Join Discord","href":"https://discord.gg/k73SQ3FyUh"}},"footer":{"socials":{"github":"https://github.com/Chainlit/chainlit","discord":"https://discord.gg/k73SQ3FyUh","x":"https://x.com/chainlit_io","linkedin":"https://www.linkedin.com/company/chainlit"}},"banner":{"content":"Chainlit is archived and no longer maintained. No bug fixes, security updates, or support are provided. [Read the project status](/get-started/project-status).","dismissible":false},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Chainlit Help","icon":"comment","href":"https://help.chainlit.io"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"chainlit-43","hasAudioNarration":false,"actualSubdomain":"chainlit-43","customDomains":["docs.chainlit.io"],"gitSource":{"type":"github","owner":"chainlit","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adb25e2a0e78eb4aee8763a","collectionId":"50ed0ff5-a69b-41c0-b43c-04c8a1ce621f","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adb25e2a0e78eb4aee8763a"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6adb25e2a0e78eb4aee8763a","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"Documentation","count":74},{"language":"default","tag":"API Reference","count":44},{"language":"default","tag":"Get Started","count":13},{"language":"default","tag":"Elements","count":11},{"language":"default","tag":"Integrations","count":11},{"language":"default","tag":"Deploy","count":10},{"language":"default","tag":"Examples","count":10},{"language":"default","tag":"Input Widgets","count":9},{"language":"default","tag":"Basic Concepts","count":9},{"language":"default","tag":"Platforms","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"integrations/litellm","slug":"/integrations/litellm","pageMetadata":{"title":"LiteLLM","description":null,"href":"/integrations/litellm"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`In this tutorial, we will guide you through the steps to create a Chainlit application integrated with `,_jsx(_components.a,{href:`https://docs.litellm.ai/docs/simple_proxy`,children:`LiteLLM Proxy`})]}),`\n`,_jsx(_components.p,{children:`The benefits of using LiteLLM Proxy with Chainlit is:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`You can `,_jsx(_components.a,{href:`https://docs.litellm.ai/docs/providers`,children:`call 100+ LLMs in the OpenAI API format`})]}),`\n`,_jsx(_components.li,{children:`Use Virtual Keys to set budget limits and track usage`}),`\n`,_jsx(_components.li,{children:`see LLM API calls in a step in the UI, and you can explore them in the prompt playground.`}),`\n`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`You shouldn’t configure this integration if you’re already using another\nintegration like Langchain or LlamaIndex. Both integrations would\nrecord the same generation and create duplicate steps in the UI.`})}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsx(_components.p,{children:`Before getting started, make sure you have the following:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`A working installation of Chainlit`}),`\n`,_jsx(_components.li,{children:`The OpenAI package installed`}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.litellm.ai/docs/proxy/deploy`,children:`LiteLLM Proxy Running`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.litellm.ai/docs/proxy/virtual_keys`,children:`A LiteLLM Proxy API Key`})}),`\n`,_jsx(_components.li,{children:`Basic understanding of Python programming`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-1-create-a-python-file`,children:`Step 1: Create a Python file`}),`\n`,_jsxs(_components.p,{children:[`Create a new Python file named `,_jsx(_components.code,{children:`app.py`}),` in your project directory. This file will contain the main logic for your LLM application.`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-2-write-the-application-logic`,children:`Step 2: Write the Application Logic`}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.code,{children:`app.py`}),`, import the necessary packages and define one function to handle messages incoming from the UI.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`32`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`32`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncOpenAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` chainlit `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cl`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AsyncOpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"anything\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# litellm proxy virtual key`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http://0.0.0.0:4000\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # litellm proxy base_url`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Instrument the OpenAI client`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`cl.instrument_openai()`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`settings `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-3.5-turbo\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# model you want to send litellm proxy`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"temperature\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # ... more settings`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@cl.on_message`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` on_message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: cl.Message):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful bot, you always reply in Spanish\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: message.content,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` **`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`settings`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cl.Message(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content).send()`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`step-3-run-the-application`,children:`Step 3: Run the Application`}),`\n`,_jsxs(_components.p,{children:[`To start your app, open a terminal and navigate to the directory containing `,_jsx(_components.code,{children:`app.py`}),`. Then run the following command:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`chainlit`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` app.py`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -w`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`-w`}),` flag tells Chainlit to enable auto-reloading, so you don’t need to restart the server every time you make changes to your application. Your chatbot UI should now be accessible at `,_jsx(_components.a,{href:`http://localhost:8000`,children:`http://localhost:8000`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"LiteLLM","description":null,"href":"/integrations/litellm"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Step 1: Create a Python file","slug":"step-1-create-a-python-file","depth":2,"children":[]},{"title":"Step 2: Write the Application Logic","slug":"step-2-write-the-application-logic","depth":2,"children":[]},{"title":"Step 3: Run the Application","slug":"step-3-run-the-application","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"chainlit-43","siteName":"Chainlit","title":"LiteLLM - Chainlit","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T09:16:26.063Z","originalFileLocation":"integrations/litellm.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Chainlit\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"LiteLLM - Chainlit\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Chainlit\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.chainlit.io/integrations/litellm\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://chainlit-43.mintlify.app/_mintlify/api/og/v2?division=Integrations\u0026amp;title=LiteLLM\u0026amp;theme=526b67ea84a41d792424ad38\u0026amp;signature=0c93a80708899daa3d42c5a55d99df3cd683692b42df4fc44cfb6a1c1d384dfa\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"LiteLLM - Chainlit\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://chainlit-43.mintlify.app/_mintlify/api/og/v2?division=Integrations\u0026amp;title=LiteLLM\u0026amp;theme=526b67ea84a41d792424ad38\u0026amp;signature=0c93a80708899daa3d42c5a55d99df3cd683692b42df4fc44cfb6a1c1d384dfa\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/chainlit-43/dEvNex89E1YeuZx8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Chainlit\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#F80061\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.chainlit.io/integrations/litellm\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integrations/litellm.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.chainlit.io/#organization\",\"name\":\"Chainlit\",\"url\":\"https://docs.chainlit.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/chainlit-43/bY2N4qUEa_bGPLfY/logo/light.svg?fit=max\u0026auto=format\u0026n=bY2N4qUEa_bGPLfY\u0026q=85\u0026s=1b972cff6fb5980cf9bfb5c54d6b6821\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.chainlit.io#website\",\"name\":\"Chainlit\",\"url\":\"https://docs.chainlit.io\",\"publisher\":{\"@id\":\"https://docs.chainlit.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.chainlit.io/integrations/litellm#webpage\",\"url\":\"https://docs.chainlit.io/integrations/litellm\",\"name\":\"LiteLLM\",\"dateModified\":\"2026-10-23T09:16:26.063Z\",\"isPartOf\":{\"@id\":\"https://docs.chainlit.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.chainlit.io/integrations/litellm#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.chainlit.io/integrations/litellm#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Get Started\",\"item\":\"https://docs.chainlit.io/get-started/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integrations\",\"item\":\"https://docs.chainlit.io/integrations/fastapi\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"LiteLLM\",\"item\":\"https://docs.chainlit.io/integrations/litellm\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.chainlit.io/integrations/litellm#article\",\"headline\":\"LiteLLM\",\"name\":\"LiteLLM\",\"url\":\"https://docs.chainlit.io/integrations/litellm\",\"mainEntityOfPage\":{\"@id\":\"https://docs.chainlit.io/integrations/litellm#webpage\"},\"dateModified\":\"2026-10-23T09:16:26.063Z\",\"publisher\":{\"@id\":\"https://docs.chainlit.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.chainlit.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Chainlit\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Chainlit","nav":{"global":{"anchors":[{"anchor":"Chainlit Help","icon":"comment","href":"https://help.chainlit.io"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Overview","href":"/get-started/overview"},{"title":"Project status","href":"/get-started/project-status"},{"title":"Installation","href":"/get-started/installation"},{"title":"In Pure Python","href":"/get-started/pure-python"},{"group":"Integrations","pages":[{"title":"FastAPI","href":"/integrations/fastapi"},{"title":"LangChain/LangGraph","href":"/integrations/langchain"},{"title":"OpenAI","href":"/integrations/openai"},{"title":"Semantic Kernel","href":"/integrations/semantic-kernel"},{"title":"Mistral AI","description":null,"href":"/integrations/mistralai"},{"title":"LiteLLM","href":"/integrations/litellm"},{"title":"Llama Index","description":null,"href":"/integrations/llama-index"},{"title":"Embedchain","href":"/integrations/embedchain"},{"title":"vLLM, LMStudio, HuggingFace","href":"/integrations/message-based"}]}]},{"group":"Deploy","pages":[{"title":"Overview","href":"/deploy/overview"},{"group":"Platforms","pages":[{"title":"Web App","href":"/deploy/webapp"},{"group":"React","pages":[{"title":"Overview","href":"/deploy/react/overview"},{"title":null,"href":"/deploy/react/installation-and-setup"},{"title":null,"href":"/deploy/react/usage"},{"title":null,"href":"/deploy/react/additional-resources"}]},{"title":"Copilot","href":"/deploy/copilot"},{"title":"Teams","href":"/deploy/teams"},{"title":"Slack","href":"/deploy/slack"},{"title":"Discord","href":"/deploy/discord"}]}]},{"group":"Basic Concepts","pages":[{"title":"Chat Life Cycle","href":"/concepts/chat-lifecycle"},{"title":"Starters","href":"/concepts/starters"},{"title":"Message","href":"/concepts/message"},{"title":"Step","href":"/concepts/step"},{"title":"User Session","href":"/concepts/user-session"},{"title":"Element","href":"/concepts/element"},{"title":"Action","href":"/concepts/action"},{"title":"Command","href":"/concepts/command"},{"title":"Modes","href":"/concepts/modes"}]},{"group":"Advanced Features","pages":[{"title":"Streaming","href":"/advanced-features/streaming"},{"title":"MCP","href":"/advanced-features/mcp"},{"title":"Ask User","href":"/advanced-features/ask-user"},{"title":"Multi-Modality","href":"/advanced-features/multi-modal"},{"title":"Chat Profiles","href":"/advanced-features/chat-profiles"},{"title":"Chat Settings","href":"/advanced-features/chat-settings"},{"title":"Testing \u0026 Debugging","href":"/advanced-features/test-debug"}]},{"group":"Data Persistence","pages":[{"title":"Overview","href":"/data-persistence/overview"},{"title":"Chat History","href":"/data-persistence/history"},{"title":"Human Feedback","href":"/data-persistence/feedback"},{"group":"Open Source Data Layers","pages":[{"title":"Overview","href":"/data-layers/overview"},{"title":"Official Data Layer","href":"/data-layers/official"},{"title":"SQLAlchemy Data Layer","href":"/data-layers/sqlalchemy"},{"title":"DynamoDB Data Layer","href":"/data-layers/dynamodb"}]},{"title":"Tags \u0026 Metadata","href":"/data-persistence/tags-metadata"}]},{"group":"Authentication","pages":[{"title":"Overview","href":"/authentication/overview"},{"title":"Password","href":"/authentication/password"},{"title":"Header","href":"/authentication/header"},{"title":"OAuth","href":"/authentication/oauth"}]},{"group":"Customisation","pages":[{"title":null,"href":"/customisation/overview"},{"title":"Translation","href":"/customisation/translation"},{"title":"Avatars","href":"/customisation/avatars"},{"title":"Logo and Favicon","href":"/customisation/custom-logo-and-favicon"},{"title":"Theme","href":"/customisation/theme"},{"title":"JS","href":"/customisation/custom-js"},{"title":"CSS","href":"/customisation/custom-css"}]},{"group":"Backend","pages":[{"group":"Config","pages":[{"title":"Overview","href":"/backend/config/overview"},{"title":"Project","href":"/backend/config/project"},{"title":"Features","href":"/backend/config/features"},{"title":"UI","href":"/backend/config/ui"}]},{"title":"Environment Variables","href":"/backend/env-variables"},{"title":"Command Line Options","href":"/backend/command-line"}]},{"group":"Guides","pages":[{"title":"Async / Sync","href":"/guides/sync-async"}]},{"group":"Migration Guides","pages":[{"title":"Migrate to Chainlit v2.9.4","href":"/guides/migration/2.9.4"},{"title":"Migrate to Chainlit v2.3.0","href":"/guides/migration/2.3.0"},{"title":"Migrate to Chainlit v2.1.0","href":"/guides/migration/2.1.0"},{"title":"Migrate to Chainlit v2.0.0","href":"/guides/migration/2.0.0"},{"title":"Migrate to Chainlit v1.1.404","href":"/guides/migration/1.1.404"},{"title":"Migrate to Chainlit v1.1.400","href":"/guides/migration/1.1.400"},{"title":"Migrate to Chainlit v1.1.300","href":"/guides/migration/1.1.300"},{"title":"Migrate to Chainlit v1.1.0","href":"/guides/migration/1.1.0"},{"title":"Migrate to Chainlit v1.0.500","href":"/guides/migration/1.0.500"}]}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples/cookbook"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/lifecycle-hooks/on-chat-start"}]}]},"basePath":"","title":"LiteLLM - Chainlit","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":["10e4515597"],"chunks":["BannerMarkdown-DIeMibn4.js","dist-DJnKvr0g.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-B2v50t8t.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}