This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'm using gcc 14, Ninja Build and cmake 3.21 | |
# cmake -G Ninja -S . -B out -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON | |
# cmake --build out | |
# ./out/bench | |
cmake_minimum_required (VERSION 3.17) | |
project (bench LANGUAGES C) | |
add_executable (bench bench.c) | |
if (MSVC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
VERSION = 1 | |
EPOCH = 1700000000 | |
# id,station_id,commodity_id,supply,supply_bracket,buy_price,sell_price,demand,demand_bracket,collected_at | |
# 1,128000000,128049152,0,-1,0,81368,901,-1,1715284476 | |
# Trade Dangerous Data Listing Format: | |
# Trade-Dangerous Data Listing, based on jsonl. | |
# line 1: dict describing the listing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write a rust program that takes counts the number of non-whitespace characters outside of c++ style comments in files. Count stdin unless file name arguments are supplied. Output only the total count, unless "--verbose" or "-v" is specified as an argument, in which case list the count per file, followed by the total. | |
Run with no arguments, and 0 characters: output = "0" | |
Run with "-v", 0 files, 0 characters: output = "<stdin>: 0" | |
Run with 0-byte files file1, file2, file3: output = "0" | |
Run with 0-byte files file1, file2, file3, and "-v": output = "file1: 0 | |
file2: 0 | |
file3: 0\*total: | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
building_task = """ | |
Generate a set of agents to design, develop, document and test a complete rust program minus version control. | |
Ensure there is an agent who writes any generated command/configuration/scripts to disk, and a separate, dedicated executor agent who runs commands via docker, so that the agents cannot simply pretend to be writing code. | |
""" | |
agent_list, agent_configs = builder.build(building_task, llm_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import autogen | |
from textwrap import dedent | |
import os | |
try: | |
del os.environ['OPENAI_API_BASE'] | |
except: | |
pass | |
os.putenv("OPENAI_API_BASE", "http://localhost:5000") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(venv) root@b7e76e6d82d8:/workspace# echo $OPENAI_API_BASE | |
http://localhost:11434/ | |
(venv) root@b7e76e6d82d8:/workspace# litellm --test --port ${LITELLM_PORT} | |
LiteLLM: Making a test ChatCompletions request to your proxy | |
An error occurred: OpenAIException - Error code: 401 - {'error': {'message': 'Incorrect API key provided: none. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} | |
Debug this by setting `--debug`, e.g. `litellm --model gpt-3.5-turbo --debug` | |
INFO: 127.0.0.1:35604 - "POST /chat/completions HTTP/1.1" 200 OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Work in progress. V0.1 | |
# ALL THE THINGS. | |
ARG APT_PROXY #=http://apt-cacher-ng.lan:3142/ | |
ARG PIP_INDEX_URL #=http://devpi.lan:3141/root/pypi/+simple | |
ARG PIP_TRUSTED_HOST #=devpi.lan | |
ARG JUPYTER_PORT=37799 | |
ARG LITELLM_PORT=11111 | |
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 as build-llama |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit: AutoGPT using OpenAI gpt4 | |
import argparse | |
import json | |
import os | |
import random | |
import shutil | |
from pathlib import Path | |
from random import randint | |
NewerOlder