Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elia #25

Merged
merged 1 commit into from
Apr 17, 2024
Merged

elia #25

Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
# ADD NEW Dockerfile directories HERE!!!
contexts: [deepspeed-mii]
contexts: [deepspeed-mii, elia]
steps:
- uses: actions/setup-go@v4
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
Expand Down
10 changes: 10 additions & 0 deletions containers/elia/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:latest

RUN apt update -y
RUN apt install -y --no-install-recommends pipx git-core
RUN pipx ensurepath
RUN pipx install git+https://github.com/darrenburns/elia
ENV OPENAI_API_KEY=none
ENV PATH=$PATH:/root/.local/bin

CMD ["elia"]
90 changes: 90 additions & 0 deletions examples/elia-tui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
apiVersion: premlabs.io/v1alpha1
kind: AIModelMap
metadata:
name: phi-2-chat
spec:
localai:
- variant: base
uri: "l3utterfly/phi-2-layla-v1-chatml-gguf"
# The LocalAI model description. Note that the model is called gpt-4-turbo because Elia has the models hardcoded at the time of writting
engineConfigFile: |
name: gpt-4-turbo
mmap: true
parameters:
model: huggingface://l3utterfly/phi-2-layla-v1-chatml-gguf/phi-2-layla-v1-chatml-Q8_0.gguf

template:
chat_message: |
<|im_start|>{{if eq .RoleName "assistant"}}assistant{{else if eq .RoleName "system"}}system{{else if eq .RoleName "user"}}user{{end}}
{{if .Content}}{{.Content}}{{end}}
<|im_end|>
chat: |
{{.Input}}
<|im_start|>assistant
completion: |
{{.Input}}
context_size: 4096
f16: true
stopwords:
- <|im_end|>
- <dummy32000>
usage: |
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "gpt-4-turbo",
"messages": [{"role": "user", "content": "How are you doing?", "temperature": 0.1}]
}'
---
apiVersion: premlabs.io/v1alpha1
kind: AIDeployment
metadata:
name: phi-2-chat
namespace: default
spec:
engine:
name: "localai"
options:
imageTag: v2.12.4-cublas-cuda12-ffmpeg
endpoint:
- port: 8080
domain: "phi-2-chat.127.0.0.1.nip.io"
models:
- modelMapRef:
name: phi-2-chat
variant: base
deployment:
accelerator:
interface: "CUDA"
minVersion:
major: 7
resources:
requests:
cpu: 4
memory: 8Gi
limits:
cpu: 32
memory: "16Gi"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: elia
spec:
replicas: 1
selector:
matchLabels:
app: elia
template:
metadata:
labels:
app: elia
spec:
containers:
- name: elia
image: premai/elia
env:
- name: OPENAI_API_BASE
value: "http://phi-2-chat:8080"
ports:
- containerPort: 3000
stdin: true
tty: true
Loading