Skip to content

Commit

Permalink
[apps/deepseek] add deepseek example
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Jan 26, 2025
1 parent 223458f commit 1aaddc9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/apps-devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ jobs:
hal9 deploy apps/openai --name openai --access public --url https://api.devel.hal9.com --title OpenAI --description "Makes use of OpenAI O1";
elif [[ "$file" == apps/swarm/* ]]; then
hal9 deploy apps/swarm --name swarm --access public --url https://api.devel.hal9.com --title Swarm --description "Makes use of OpenAI Swarm";
elif [[ "$file" == apps/deepseek/* ]]; then
hal9 deploy apps/deepseek --name deepseek --access public --url https://api.devel.hal9.com --title DeepSeek --description "Makes use of DeepSeek";
fi
done
2 changes: 2 additions & 0 deletions .github/workflows/apps-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ jobs:
hal9 deploy apps/openai --name openai --access public --title OpenAI --description "Makes use of OpenAI O1";
elif [[ "$file" == apps/swarm/* ]]; then
hal9 deploy apps/swarm --name swarm --access public --title Swarm --description "Makes use of OpenAI Swarm";
elif [[ "$file" == apps/deepseek/* ]]; then
hal9 deploy apps/deepseek --name deepseek --access public --title DeepSeek --description "Makes use of DeepSeek";
fi
done
18 changes: 18 additions & 0 deletions apps/deepseek/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from openai import OpenAI

client = OpenAI(
api_key="hal9",
base_url="http://localhost:5000/proxy/server=https://api.deepseek.com")

stream = client.chat.completions.create(
model="deepseek-chat",
messages=[
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": input()},
],
stream=True
)

for chunk in stream:
if len(chunk.choices) > 0 and chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")
1 change: 1 addition & 0 deletions apps/deepseek/hal9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
welcome: 👋 I'm DeepSeep 🐳
Binary file added apps/deepseek/thumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1aaddc9

Please sign in to comment.