Saravanan666/pypi-org huggingface dataset:
Package: local-llm
Local-LLMLocal-LLM is a simplellama.cppserver that easily exposes a list of local language models to choose from to run on your own computer. It is designed to be as easy as possible to get started with running local models. It automatically handles downloading the model of your choice and configuring the server based on your CPU, RAM, and GPU. It also includesOpenAI Styleendpoints for easy integration with other applications. Additional functionality is built in for voice cloning text to speech and a voice to text for easy voice communication entirely offline after the initial setup.PrerequisitesGitPowerShell 7.XDocker Desktop(Windows or Mac)Additional Linux PrerequisitesDockerDocker ComposeNVIDIA Container ToolkitInstallationgitclonehttps://github.com/Josh-XT/Local-LLMcdLocal-LLMEnvironment SetupExpand Environment Setup if you would like to modify the default environment variables, otherwise skip to Usage. All environment variables are optional and have useful defaults. Change the default model that starts with Local-LLM in your.envfile.Environment Setup (Optional)None of the values need modified in order to run the server. If you are using an NVIDIA GPU, I would recommend setting theGPU_LAYERSandMAIN_GPUenvironment variables. If you plan to expose the server to the internet, I would recommend setting theLOCAL_LLM_API_KEYenvironment variable for security.THREADSis set to your CPU thread count minus 2 by default, if this causes significant performance issues, consider setting theTHREADSenvironment variable manually to a lower number.Modify the.envfile to your desired settings. Assumptions will be made on all of these values if you choose to accept the defaults.Replace the environment variables with your desired settings. Assumptions will be made on all of these values if you choose to accept the defaults.LOCAL_LLM_API_KEY- The API key to use for the server. If not set, the server will not require an API key when accepting requests.DEFAULT_MODEL- The default model to use when no model is specified. Default isphi-2-dpo.WHISPER_MODEL- The model to use for speech-to-text. Default isbase.en.AUTO_UPDATE- Whether or not to automatically update Local-LLM. Default istrue.THREADS- The number of CPU threads Local-LLM is allowed to use. Default isyour CPU thread count minus 2.GPU_LAYERS(Only applicable to NVIDIA GPU) - The number of layers to use on the GPU. Default is0. Local-LLM will automatically determine the optimal number of layers to use based on your GPU's memory if it is set to 0 and you have an NVIDIA GPU.MAIN_GPU(Only applicable to NVIDIA GPU) - The GPU to use for the main model. Default is0.Usage./start.ps1For examples on how to use the server to communicate with the models, see theExamples Jupyter Notebook.OpenAI Style Endpoint UsageOpenAI Style endpoints available athttp://<YOUR LOCAL IP ADDRESS>:8091/v1/by default. Documentation can be accessed at thathttp://localhost:8091when the server is running.
Package: local-llm-cli
local_llm_clilocal_llm_cliis a Python package that allows you to converse with a GPT4All Language Model (LLM) locally. This can be useful for testing, developing, and debugging.Currently, this library supports interacting with the GPT4All model. However, support for other models and additional functionalities are planned for future updates.InstallationTo installlocal_llm_cli, you can usepip:pipinstalllocal_llm_cliYou'll also need to ensure that you have the necessary model files available locally.UsageTheconversesublibrary provides a function to load a GPT4All LLM and converse with it.Here's a simple usage example:fromlocal_llm_cli.converse.chatimportload_and_interact# define the model pathmodel_path='path/to/your/model'# call the function to start conversing with the LLMload_and_interact(model_path)In this example, themodel_pathshould be the path to the GPT4All model files on your local system.Theload_and_interactfunction also accepts optional arguments to specify the model context (model_n_ctx) and batch size (model_n_batch). If these arguments are not provided, they default to 1024 and 8, respectively.Here's an example with custom context and batch size:load_and_interact(model_path,model_n_ctx=2048,model_n_batch=16)You can stop the conversation at any time by typingexit.LicenseThis project is licensed under the MIT License. See theLICENSEfile for more details.This package was crafted with ❤️ by Harsh Avinash in approximately 22 minutes. Enjoy conversing with your local LLM!
Package: local-llm-function-calling
Local LLM function callingOverviewThelocal-llm-function-callingproject is designed to constrain the generation of Hugging Face text generation models by enforcing a JSON schema and facilitating the formulation of prompts for function calls, similar to OpenAI'sfunction callingfeature, but actually enforcing the schema unlike OpenAI.The project provides aGeneratorclass that allows users to easily generate text while ensuring compliance with the provided prompt and JSON schema. By utilizing thelocal-llm-function-callinglibrary, users can conveniently control the output of text generation models. It uses my own quickly sketchedjson-schema-enforcerproject as the enforcer.FeaturesConstrains the generation of Hugging Face text generation models to follow a JSON schema.Provides a mechanism for formulating prompts for function calls, enabling precise data extraction and formatting.Simplifies the text generation process through a user-friendlyGeneratorclass.InstallationTo install thelocal-llm-function-callinglibrary, use the following command:pipinstalllocal-llm-function-callingUsageHere's a simple example demonstrating how to uselocal-llm-function-calling:fromlocal_llm_function_callingimportGenerator# Define a function and modelsfunctions=[{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA","maxLength":20,},"unit":{"type":"string","enum":["celsius","fahrenheit"]},},"required":["location"],},}]# Initialize the generator with the Hugging Face model and our functionsgenerator=Generator.hf(functions,"gpt2")# Generate text using a promptfunction_call=generator.generate("What is the weather like today in Brooklyn?")print(function_call)Custom constraintsYou don't have to use my prompting methods; you can craft your own prompts and your own constraints, and still benefit from the constrained generation:fromlocal_llm_function_callingimportConstrainerfromlocal_llm_function_calling.model.huggingfaceimportHuggingfaceModel# Define your own constraint# (you can also use local_llm_function_calling.JsonSchemaConstraint)deflowercase_sentence_constraint(text:str):# Has to return (is_valid, is_complete)return[text.islower(),text.endswith(".")]# Create the constrainerconstrainer=Constrainer(HuggingfaceModel("gpt2"))# Generate your textgenerated=constrainer.generate("Prefix.\n",lowercase_sentence_constraint,max_len=10)Extending and CustomizingTo extend or customize the prompt structure, you can subclass theTextPrompterclass. This allows you to modify the prompt generation process according to your specific requirements.
Package: localmail
LocalmailFor local people.Localmail is an SMTP and IMAP server that stores all messages into a single
in-memory mailbox. It is designed to be used to speed up running test suites on
systems that send email, such as new account sign up emails with confirmation
codes. It can also be used to test SMTP/IMAP client code.Features:Fast and robust IMAP/SMTP implementations, including multipart
messages and unicode support.Includes simple HTTP interface for reading messages, which is useful for
checking html emails.Compatible with python’s stdlib client, plus clients like mutt and
thunderbird.Authentication is supported but completely ignored, all message go in
single mailbox.Messages not persisted by default, and will be lost on shutdown.
Optionally, you can log messages to disk in mbox format.Missing features/TODO:SSL supportWARNING: not a real SMTP/IMAP server - not for production usage.Running localmailtwistdlocalmailThis will run localmail in the background, SMTP on port 2025 and IMAP on 2143,
It will log to a file ./twistd.log. Use the -n option if you want to run in
the foreground, like so.twistd-nlocalmailYou can pass in arguments to control parameters.twistdlocalmail--imap<port>--smtp<port>--http<port>--filelocalmail.mboxYou can have localmail use random ports if you like. The port numbers will be logged.
TODO: enable writing random port numbers to a file.twisted-nlocalmail--randomEmbeddingIf you want to embed localmail in another non-twisted program, such as test
runner, do the following.importthreadingimportlocalmailthread=threading.Thread(target=localmail.run,args=(2025,2143,8880,'localmail.mbox'))thread.start()...localmail.shutdown_thread(thread)This will run the twisted reactor in a separate thread, and shut it down on
exit.If you want to use random ports, you can pass a callback that will have the
ports the service is listening on.importthreadingimportlocalmaildefreport(smtp,imap,http):"""do stuff with ports"""thread=threading.Thread(target=localmail.run,args=(0,0,0,None,report))thread.start()History0.4 (2015-08-14)support for using random port numbersavailable as a universal wheel, general packaging improvementsSimple HTTP interface for browsing mail (requires jinja2)Support writing to mbox fileFixed date to work with mutt, example muttrc included in package.0.3 (2013-05-24)Multipart message support [via Ed Jannoo]IMAP UID supportSupport python 2.6, 2.7 and pypy, tested via tox0.2 (2012-11-13)Initial public releaseBasic SMTP/IMAP serverCredits“localmail” is written and maintained by Simon DavyContributorsThe following people contributed directly or indirectly to this project:Ed Jannoo <ed@azordi.com>
Package: localmentor
LocalMentorTrained on 1000+ hours of tech and startup podcast discussion, LocalMentor is a chatbot startup advisor that runs entirely on your local computer.SetupRequirementsPython 3PyPI:pip install localmentorOr pip install from source:git clone https://github.com/remyxai/LocalMentor.git
cd LocalMentor && pip install .QuickstartAsk your startup question:localmentorask--prompt"What are three things to look for when hiring employees at an early stage startup?"FeaturesPython UsageSimply import the library and pass your command as a string tomentorfromlocalmentorimportmentormentor("What are three things to look for when hiring employees at an early stage startup?")
Package: local-migrator
This support package simplifies data persistence between user sessions
and software version updates.The main idea of this package is simplify data migration between versions,
and allow to define migration information next to data structure definition.Basic usage (data serialization)If You only need to serialize data, then you could use only JSON hooksimportjsonfrompydanticimportBaseModelfromlocal_migratorimportEncoder,object_hookclassSampleModel(BaseModel):field1:intfield2:strdata=SampleModel(field1=4,field2="abc")withopen("sample.json","w")asf_p:json.dump(data,f_p,cls=Encoder)withopen("sample.json")asf_p:data2=json.load(f_p,object_hook=object_hook)assertdata==data2MigrationsTo register this information there isregister_classdecorator.
It has 4 parameters:version- version of data structuremigration_list- list of tuple (version.migration_function).old_paths- list of fully qualified python paths to previous class
definitions. This is to allow move class during code refactoring.use_parent_migrations- if True, then parent class migrations
will be used.Lets imagine that we have such codefromlocal_migratorimportEncoder,object_hookclassSampleModel(BaseModel):field1:intfield_ca_1:strfield_ca_2:floatwithopen("sample.json","w")asf_p:json.dump(data,f_p,cls=Encoder)But there is decision to move bothcafield to sub structure:classCaModel(BaseModel):field_1:strfield_2:floatclassSampleModel(BaseModel):field1:intfield_ca:CaModelThen withlocal_migratorcode may look:fromlocal_migratorimportobject_hook,register_classclassCaModel(BaseModel):field_1:strfield_2:floatdefca_migration_function(dkt):dkt["field_ca"]=CaModel(field1=dkt.pop("field_ca_1"),field2=dkt.pop("field_ca_2"))returndkt@register_class("0.0.1",[("0.0.1",ca_migration_function)])classSampleModel(BaseModel):field1:intfield_ca:CaModelwithopen("sample.json")asf_p:data=json.load(f_p,object_hook=object_hook)Assume that there is decision to renamefield1toid.
Then code may look:fromlocal_migratorimportobject_hook,register_class,rename_keyclassCaModel(BaseModel):field_1:strfield_2:floatdefca_migration_function(dkt):dkt["field_ca"]=CaModel(field1=dkt.pop("field_ca_1"),field2=dkt.pop("field_ca_2"))returndkt@register_class("0.0.2",[("0.0.1",ca_migration_function),("0.0.2",rename_key("field1","id"))])classSampleModel(BaseModel):id:intfield_ca:CaModelwithopen("sample.json")asf_p:data=json.load(f_p,object_hook=object_hook)More examples could be found inexamplessection of documentationAdditional functionsrename_key(from_key: str, to_key: str, optional=False)->Callable[[Dict],Dict]- helper
function for rename field migrations.update_argument(argument_name:str)(func:Callable)->Callable- decorator to keep backward
compatibility by convertingdictargument to some class base on function type annotationContributingContributions are encouraged! Please create pull request or open issue.
For PR please remember to add tests and documentation.Additional notesThis package is originally namednmebut was rename to clarify its purpose.This package is extracted fromPartSegproject for simplify reuse it in another projects.
Package: local_mutex
#local_mutex本地锁,通过fcntl针对文件加锁实现的. 需要强烈注意的是,多线程下是无效的,原因? [查看链接](http://xiaorui.cc)#Usage:最简单的例子,适合一个程序同时跑一个的场景.```import sysfrom local_mutex import LocalMutextry:lock = LocalMutex('app.lock')except LockError:sys.exit('already running')try:print 'doing'finally:lock.release()```使用wait参数不停的试图获取Lock, 直到获取锁.```lock = LocalMutex('/var/run/app.lock', wait = True)try:print 'doing'finally:lock.release()```使用with关键词```with LocalMutex('app.lock', wait = True):print 'doing'```如果是多线程环境,直接用threading的Lock```import threadinglock = threading.Lock()with lock:pass```
Package: localnet
Module and script to test local network membership (IPv4)===========================================================A set of utility functions and a command-line script useful in testing localmachine membership in IPv4 networks. Requires no external modules("batteries-included" only).Command-line usage++++++++++++++++++#. Sample usageTest all network interfaces, and return success if any interface has an IPaddress in the 10.100.3.0/24 network:.. code-block:: bashuser@localhost$ local_net 10.100.3.0/24; echo $?0user@localhost$Specific interfaces may be tested by inclusion of the -i/--iface flag, whichmay be repeated:.. code-block:: bashuser@localhost$ local_net -i etho -i wlan2 192.168.1.0/24Asserting that no local interface is a member of a given network is alsopossible by using the -n/--negate flag:.. code-block:: bashuser@localhost$ local_net -n 10.1.0.0/16Test success or failure is indicated by exit status code - 0 for success, 1for failure. This allows for ease of use in conditional statements and othertests (e.g. ssh config 'exec' testing). Exit status 64 is returned if anunrecoverable error occurs (e.g. an interface was passed that does not exist),and error information may be written to stderr. Otherwise, no output is made.Requirements and compatibility++++++++++++++++++++++++++++++The code should work on any POSIX-compatible system, but has only been testedon modern Linux installs. Pull requests and bug reports for other operatingsystems are welcome. Supports Python versions 2.6+.  Python versions < 3.3require a system libc which supports if_nameindex() to get around lack of samein socket module.=========Changelog=========All notable changes to this project will be documented in this file.The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.[0.2.0] - 2018-09-30++++++++++++++++++++Changed-------- Don't import ctypes until we need it.- Catch exception from all_ifaces() in _main so we can exit correctly.- Add LICENSE file- Fix this CHANGELOG[0.1.0] - 2018-09-30++++++++++++++++++++Added------ CHANGELOG.rst- MANIFEST.in- README.rst- localnet.py- setup.cfg- setup.py- .gitignore
Package: localnow
localnowDescriptionThis small Python package is a drop-in replacement fordatetime.datetime.nowthat returns the current time in the
local timezone.UsageSuppose you want the current date and time. You could do this:importdatetimex=datetime.datetime.now()By default,xwill be in UTC.datetime.datetime.nowtakes an optionaltzargument that you can use to specify a
different timezone. However, if you want to use yourlocaltimezone, wherever that may be, you need an extra step:importdatetimetz=datetime.datetime.utcnow().astimezone().tzinfox=datetime.datetime.now(tz=tz)Personally, I find thetz = ...line to be a bit of a distraction and difficult to remember, so I made this package.
It provides a drop-in replacement fordatetime.datetime.nowthat is essentially does the same as the code above but
with a little less code:fromlocalnowimportnowx=now()That's it.InstallationYou can install this package from PyPI:pipinstalllocalnowLicenseMIT
Package: localpip
LocalPIPLocalPIP is an offline package manager for Python...It solves packages dependencies conflict issues and compiling errors.Internet access is required only for the first time of downloading LocalPIP repository.Once downloaded, you can install packages completely offline.LocalPIP initialization:DescriptionCommandTo install LocalPIPpip install localpipTo download the local repo for the first timelocalpip downloadTo update the local repolocalpip updateAbout localpiplocalpip aboutUsagelocalpip <Action> <PackageName>localpip <Action> <PackageName1> <PackageName2>DescriptionCommandActionsinstall / uninstall / upgradePackageNameone package / multiple packagePackages management (lpipcan be used instead oflocalpip)DescriptionCommandTo install one packagelocalpip install pandasTo install multiple packageslocalpip install pandas openpyxl KerasTo install requirement filelocalpip install reqTo uninstall a packagelocalpip uninstall pandasTo upgrade a packagelocalpip upgrade pipTo onlone upgrade a packagelocalpip onlineupgrade pipTo uninstall a packagelocalpip uninstall pandasTo check all installed packageslocalpip listCurrent available packages:LocalPIP Packages
Package: localpoly
localpolyThis package uses Local Polynomial Regression to create a fit to the data. The model conveniently also estimates the first and second derivative of the fit.The main functions are LocalPolynomialRegression.fit, which creates the fit and LocalPolynomialRegressionCV.bandwidth_cv, which finds the optimal bandwidth for the kernel which is used for the fit.Read the documentation for the theoretical background and examples.InstallationVia pippip install localpolyOr via download from git:pip install git+https://github.com/franwe/localpoly#egg=localpolyNote that in order to avoid potential conflicts with other packages it is strongly recommended to use a virtual environment (venv) or a conda environment.
Package: local-port-scanner
Local Port ScannerTooling that scan specific IP orautomatesscan all the local IPs on your network.Table of contentsInstalling Local Port ScannerRunning Local Port ScannerUpdating Local Port ScannerInstallationpipinstalllocal-port-scannerImportant:depending on your system, make sure to usepip3andpython3instead.If you would like to install a specific version of Local Port Scanner you may do so with:pipinstalllocal-port-scanner==0.0.2Running Local Port ScannerLocal Port Scanner is not only a tool but also it is a moduleUse as a toolRun the port scanner as the following Example.python-mport_scanner-aThere are specific commands to use in Port Scanner.'-a' command is used to auto-discover host in your local network and scan if there are open ports.'-H' command is used to specify the host.If you want to know more commands use '-h' command.Run the netdiscover as the following Example.python-mnetdiscoverIt just discovers all the host IPs and Mac addresses.Use as a moduleThere are two classes you can use.port_scannerTo scan specific targetfromloacl_scannerimportScanScan(target='127.0.0.1')netdiscoverTo discover host in the Local networkfromloacl_scannerimportNetDiscoverNetDiscover(output=True)Updating Local Port Scannerpipinstalllocal-port-scanner-UDisclaimer: Please Note that this is a research project. I am by no means responsible for any usage of this tool.
Package: localproxy
HTTP proxy server in twisted. If there is a directory with same name as target host (e.g.: www.example.com), contents of the directory are returned instead of making a request to the target host.Install$ pip install localproxyUsageThe following command invokes localproxy.$ localproxyBy default, Localproxy listens for connections at port 8080. You can change the proxy setting of your Web browser tolocalhost:8080.To use HTTPS proxy with CONNECT command, you should create your private key and x509 certificate.$ mkdir ~/my_dir
$ cd ~/my_dir
$ openssl genrsa > privkey.pem
$ openssl req -new -x509 -key privkey.pem -out cacert.pem -days 365Localproxy reads files from local directory if there is a directory with same name as target host name. Let’s say you want to serve files ofhttp://www.example.com, you can create the directory and file as follow:$ mkdir www.example.com
$ echo '<html>hello</html>' > www.example.com/index.htmlthen the file above will be displayed if you openhttp://www.example.comwith your browser.
Package: localpubsub
localpubsub===========-----.. contents:: **Table of Contents**:backlinks: noneInstallation------------localpubsub is distributed on `PyPI <https://pypi.org>`_ as a universalwheel and is available on Linux/macOS and Windows and supportsPython 2.7/3.5+ and PyPy... code-block:: bash$ pip install localpubsubLicense-------localpubsub is distributed under the terms of the`MIT License <https://choosealicense.com/licenses/mit>`_.