Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ for chunk in llm.chat("hello", stream=True):
</details>

<details>
<summary>Use your own client (Like OpenAI)</summary>
<summary>Use your own client (like OpenAI)</summary>

<br/>

Expand Down Expand Up @@ -260,6 +260,30 @@ print(llm.list_conversations())
```
</details>

<details>
<summary>Multiple models, same conversation</summary>

<br/>

One application of LitAI is to reduce costs of chats by using separate models for the same conversation. For example, use a cheap model to answer
the first question and a more expensive model for something that requires more intelligence.

```python
from litai import LLM

llm = LLM(model="openai/gpt-4")

# use a cheap model for this question
llm.chat("Is this a number or word: '5'", model="google/gemini-2.5-flash", conversation="help_session")

# go back to the expensive model
llm.chat("Generate a story about that number like Lord of the Rings", conversation="help_session")

print(llm.get_history("intro")) # View all messages from the 'help_session' thread
```

</details>

<details>
<summary>Switch models on each call</summary>

Expand Down
Loading