Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f03c319
Update requirements to include Cerebras dependency
pawelf-cerebras Dec 18, 2024
7849714
Add support for CePO
pawelf-cerebras Dec 18, 2024
380f1be
Initial version of CePO
pawelf-cerebras Dec 18, 2024
53f2f12
Add support for Cerebras client
pawelf-cerebras Dec 19, 2024
80bc1ee
Add pairwise rating and clean up
pawelf-cerebras Dec 19, 2024
b368ff6
Fix default rating type
pawelf-cerebras Dec 19, 2024
4762550
Add modification of CePO configs through yaml and cli arguments
erich-cerebras Dec 19, 2024
6b97e89
Fix default CePO config yaml
erich-cerebras Dec 19, 2024
3775054
Merge pull request #2 from CerebrasResearch/erich/yaml_config
erich-cerebras Dec 19, 2024
9a72052
Fix check if cepo_config_file provided
pawelf-cerebras Dec 26, 2024
6cbda31
Add cepo to readme
pawelf-cerebras Jan 2, 2025
36751b1
Minor cleaning
pawelf-cerebras Jan 2, 2025
fbec344
Add VS Code to ignore list
pawelf-cerebras Jan 2, 2025
d6eccb5
Minor readibility improvements
pawelf-cerebras Jan 3, 2025
162851b
Removed unnecessary comment
pawelf-cerebras Jan 6, 2025
48c42e2
Add cepo results
pawelf-cerebras Jan 9, 2025
d5c5763
Make cepo_config.yaml define the default values instead of the datacl…
pawelf-cerebras Jan 9, 2025
093da4b
Updated documentation of CePO
pawelf-cerebras Jan 9, 2025
8ebdd26
Add description of CePO method
pawelf-cerebras Jan 9, 2025
c240dbe
Update CePO section of README
pawelf-cerebras Jan 10, 2025
75e5762
Add results for LiveCodeBench and SimpleQA
pawelf-cerebras Jan 10, 2025
846e230
Correct type of the output of cepo
pawelf-cerebras Jan 13, 2025
4f47f9f
Minor fixes and add docstrings
pawelf-cerebras Jan 13, 2025
0c2a8c8
Updatee README.md to add the discord/research channel link
emmac-cerebras Jan 15, 2025
3b3a396
Merge pull request #3 from emmac-cerebras/patch-1
pawelf-cerebras Jan 15, 2025
3e9d83d
Create NOTICE.md
emmac-cerebras Jan 15, 2025
d29b203
Update .gitignore
emmac-cerebras Jan 15, 2025
c9e8069
Update NOTICE.md
emmac-cerebras Jan 15, 2025
b4a265b
Update optillm.py
emmac-cerebras Jan 15, 2025
cd8d05b
Update cepo.py
emmac-cerebras Jan 15, 2025
f7391f8
Fix typo
pawelf-cerebras Jan 15, 2025
e07c864
Make cepo_config required parameter
pawelf-cerebras Jan 17, 2025
45d0463
Convert multi-turn conversations back to messages
codelion Jan 2, 2025
feb1905
Update publish.yml
codelion Jan 2, 2025
693cd34
Update setup.py
codelion Jan 2, 2025
53d8d1f
Update setup.py
codelion Jan 2, 2025
9ef6cca
Update setup.py
codelion Jan 2, 2025
377421f
Update setup.py
codelion Jan 2, 2025
64a6331
Update readurls_plugin.py
codelion Jan 2, 2025
b67200b
Update publish.yml
codelion Jan 2, 2025
de77e4a
Update setup.py
codelion Jan 2, 2025
396986a
Update readurls_plugin.py
codelion Jan 2, 2025
2b16159
Update Dockerfile
codelion Jan 3, 2025
656d7e4
Fix streaming response
codelion Jan 3, 2025
b3f124b
return a list
codelion Jan 3, 2025
5134a1e
prep for new release
codelion Jan 3, 2025
21f78b3
Fix the docker file path
codelion Jan 3, 2025
8514832
prep for new release
codelion Jan 3, 2025
5e465f1
Update README.md
codelion Jan 3, 2025
3902338
add gui using new gradio app
codelion Jan 8, 2025
e0c63f2
Update setup.py
codelion Jan 8, 2025
2f995fd
Use modernbert based router
codelion Jan 9, 2025
c747685
Update setup.py
codelion Jan 9, 2025
243c8dd
Update optillm.py
codelion Jan 10, 2025
a3b81e5
Update eval_aime_benchmark.py
codelion Jan 10, 2025
9fcf5c1
Update eval_aime_benchmark.py
codelion Jan 10, 2025
f15ebbc
Update setup.py
codelion Jan 10, 2025
077e5cb
Update README.md
codelion Jan 12, 2025
75ff794
Update README.md
codelion Jan 12, 2025
089938d
Update eval_arena_hard_auto_rtc.py
codelion Jan 19, 2025
3ba1009
Update coc_plugin.py
codelion Jan 19, 2025
e1b5397
Update coc_plugin.py
codelion Jan 19, 2025
d51cd3f
fix dependenices on GPU for local inference
codelion Jan 19, 2025
5fc3ba1
update dependencies
codelion Jan 20, 2025
8335cf7
Update inference.py
codelion Jan 20, 2025
d9dd5df
Revert "Update inference.py"
codelion Jan 20, 2025
c6ca852
add plugindir flag and env var
codelion Jan 20, 2025
dcef2c8
Update publish.yml
codelion Jan 20, 2025
e495f81
Update eval_aime_benchmark.py
codelion Jan 20, 2025
9e97d6b
Update publish.yml
codelion Jan 20, 2025
2047553
Add modification of CePO configs through yaml and cli arguments
erich-cerebras Dec 19, 2024
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
31 changes: 31 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.git/
.gitignore
.github/
__pycache__/
*.pyc
*.pyo
*.pyd
.Python
*.so
*.egg
*.egg-info/
dist/
build/
*.egg-info/
.eggs/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.pytest_cache/
.env
.venv/
env/
venv/
ENV/
.idea/
.vscode/
75 changes: 72 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Upload Python Package to PyPI when a Release is Created

name: Upload Python Package and Docker Image on Release
on:
release:
types: [created]
Expand All @@ -25,6 +24,76 @@ jobs:
pip install setuptools wheel
- name: Build package
run: |
python setup.py sdist bdist_wheel # Could also be python -m build
python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

docker-publish:
name: Publish Docker image
runs-on: ubuntu-latest
needs: pypi-publish
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata for proxy_only image
- name: Extract metadata for proxy_only Docker
id: meta-proxy
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: |
suffix=-slim
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
latest

# Build and push proxy image
- name: Build and push proxy_only Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.proxy_only
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-proxy.outputs.tags }}
labels: ${{ steps.meta-proxy.outputs.labels }}
cache-from: type=gha,scope=proxy
cache-to: type=gha,scope=proxy,mode=max

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
latest

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Apache license 2 - modified after the fork to add VS code

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -164,3 +166,6 @@ cython_debug/
# Ignore Mac DS_Store files
.DS_Store
**/.DS_Store

# VS Code
.vscode/
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Build stage
FROM python:3.12-slim AS builder

# Define build argument with default value
ARG PORT=8000
# Make it available as env variable at runtime
ENV OPTILLM_PORT=$PORT

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev \
build-essential \
python3-dev \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*

# Copy only the requirements file first to leverage Docker cache
Expand Down Expand Up @@ -40,8 +48,8 @@ USER appuser
# Set environment variables
ENV PYTHONUNBUFFERED=1

# Expose the port the app runs on
EXPOSE 8000
# Use the ARG in EXPOSE
EXPOSE ${PORT}

# Run the application
ENTRYPOINT ["python", "optillm.py"]
55 changes: 55 additions & 0 deletions Dockerfile.proxy_only
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Build stage
FROM python:3.12-slim AS builder

# Define build argument with default value
ARG PORT=8000
# Make it available as env variable at runtime
ENV OPTILLM_PORT=$PORT

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*

# Copy only the requirements file first to leverage Docker cache
COPY requirements_proxy_only.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements_proxy_only.txt

# Final stage
FROM python:3.12-slim

# Install curl for the healthcheck
RUN apt-get update && apt-get install -y --no-install-recommends \
curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy installed dependencies from builder stage
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin

# Copy application code
COPY . .

# Create a non-root user and switch to it
RUN useradd -m appuser
USER appuser

# Set environment variables
ENV PYTHONUNBUFFERED=1

# Use the ARG in EXPOSE
EXPOSE ${PORT}

# Run the application
ENTRYPOINT ["python", "optillm.py"]
24 changes: 24 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## NOTICE

This project is a fork of [https://github.com/codelion/optillm/tree/main](https://github.com/codelion/optillm/tree/main)

The [original project](https://github.com/codelion/optillm/tree/main) is licensed under the Apache 2 License as detailed in [the original LICENSE](https://github.com/codelion/optillm/blob/main/LICENSE). The fork was created from a December 2024 fork of the original project.


This project, i.e., [CePO](https://github.com/CerebrasResearch/cb_optillm/tree/cepo), is licensed under the Apache License, Version 2.0 as detailed in [this LICENSE](./LICENSE)


Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Initial change:
Adding Cerebras Planning and Optimization (CePO). CePO is a method to empower Llama with reasoning, via test-time compute. [Learn more in the blog](https://cerebras.ai/blog/cepo)

At a high-level, in CePO, we make m attempts to generate n step-by-step plans, refine the plans, check inconsistencies between them, use the above feedback to generate the final plan and produce the answer. This process is then repeated N times in a classical best of n manner.

Ongoing Apache-licensed contributions:
* Added the implementation of CePO
* Integrated CePO with optillm
See updated files [here](https://github.com/codelion/optillm/compare/main...CerebrasResearch:cb_optillm:cepo)


Last updated: 01/14/2025
Loading