> ## Documentation Index
> Fetch the complete documentation index at: https://inference-docs.cerebras.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CePO: Cerebras Planning & Optimization​

> Improving Llama's reasoning abilities with test-time compute

<Tip>**To get started with a free API key, [click here](https://cloud.cerebras.ai?utm_source=3pi_cepo\&utm_campaign=capabilities).**</Tip>

CePO (Cerebras Planning & Optimization) is a framework that adds advanced reasoning capabilities to the Llama family of models by utilizing test-time compute. This approach enables Llama to address complex reasoning tasks that can be difficult for standard one-shot or instruct models.

CePO is implemented using Cerebras inference, which currently supports llama3.1-8b at 2,200 reasoning tokens/s. This level of inference speed enables efficient test-time computation for more sophisticated reasoning tasks.

### How CePO Works

CePO demonstrates how additional test-time computation can improve Llama’s reasoning.

<img src="https://mintcdn.com/cerebras-inference/b3jx4ZXgBWCXv7Rn/images/cepo.png?fit=max&auto=format&n=b3jx4ZXgBWCXv7Rn&q=85&s=cfb40a5295144db2bf2a305e5409d360" alt="" width="1920" height="524" data-path="images/cepo.png" />

The process involves four main stages:

1. **Planning:** The LLM produces a plan to solve a given problem step by step.

2. **Execution:** The LLM executes the plan multiple times, generating multiple responses.

3. **Analysis:** The model analyzes the responses to detect inconsistencies across executions, helping catch and correct mistakes.

4. **Best-of-N:** Responses are evaluated within a Best-of-N framework that includes a structured confidence scoring mechanism.

### Getting Started with CePO

<Steps>
  <Step title="Step 1: Prerequisites">
    CePO is built on the popular, open-source [OptiLLM library](https://github.com/codelion/optillm/tree/main). To get started, install OptiLLM and make sure you have the latest version of the Cerebras Inference SDK installed.

    ```bash theme={null}
    pip install --upgrade cerebras_cloud_sdk 
    pip install --upgrade optillm
    ```

    Next, configure your API key, which can be found in our [developer platform](https://cloud.cerebras.ai/?utm_source=3pi_cepo\&utm_campaign=capabilities).

    ```bash theme={null}
    export CEREBRAS_API_KEY='your_api_key_here'
    ```
  </Step>

  <Step title="Step 2: Run OptiLLM with CePO">
    Finally, run the OptiLLM script with CePO

    ```bash theme={null}
    optillm \
      --base-url https://api.cerebras.ai \
      --approach cepo 
    ```

    If you would like to print intermediate states in the OptiLLM log, you can optionally add:

    ```bash theme={null}
    --cepo_print_output true 
    ```
  </Step>
</Steps>

### Continued Research

Further work on CePO includes:

* **More advanced prompting frameworks** that leverage comparative reasoning.

* **Synthetic data** optimized for inference-time computation.

* **Enhanced verification mechanisms** for complex reasoning chains.

If you have questions or would like to discuss your findings, please join the `#research` channel in our [discord community](https://discord.gg/a5TYzrJ444).

### Read More

For more information on the implementation details and results, see the full [CePO announcement](https://cerebras.ai/blog/cepo).
